17 Comments
- jiminoc, on 10/12/2007, -3/+13you're single, don't lie
- drtyfrnk, on 10/12/2007, -2/+12I tried to install the Sexpressions on my girlfriend, but she BSOD'ed on me.
Ah well, I guess I'll try it on my Mistress. - reverendpaco, on 10/12/2007, -0/+6Interesting. A few months ago, I tried stretching the boundaries of Ruby's meta-programming and eDSL capabilities by trying to emulate the Haskell/Erlang pattern-matching.
The ideal scenario is where you can create your own 'def' syntax (a lisp-like macro)... something like:
def_part fib( in ), :where => (in == 0)
return 1
end
unfortunately I found (and this article confirms) that this bangs right up against the edges of Ruby's capabilities. No delayed-evaluation (aside from blocks) and no syntax-macros means that the syntax you create for things like multi-dispatch and pattern dispatch look way too heavily symbol based and string based.
Now don't get me wrong. I love Ruby. But there is a psychology to believing you have found an embedded DSL. The reason Rails and Rake work so well is that they _look_ like what they are supposed to. This article shows you how to do these advanced programming techniques in Ruby, but the adoption will not happen until the psychological barrier is broken -- it looks too 'shoe-horned'. Remember, you can do Object Oriented in C with function pointers, etc. You can do double-dispatch in Java with horrendous Design Patterns.... But do you want to?
Right now Ruby is perfect for creating embeddable _declarative_ DSLs.... because the class-level methods and the syntactic-sugar can look so much like what we expect a declarative language to be.
Still, I loved that someone actually did this. - bigdig, on 10/12/2007, -0/+6I must be missing something here. Look like Ruby is much more fun and exciting than I have known ...:-)
- Phoenyx, on 10/12/2007, -0/+3I wish the article went more into the reason/advantages of doing it these things (other than "language X has this obscure feature, let's try to duplicate it"). The ruby examples seemed pretty straightforward in comparison to the end results.
- JohnnySoftware, on 10/12/2007, -0/+3I did not realize that being a complete expert on every aspect of an article was a prerequisite for digging it. I shall try to remember that the next time I am about to digg any article on health, technology, science, etc. [grin]
There are a programmers around who know more than one language. More than a few know Ruby, LISP, LOGO, SVG, etc.
The idea of domain specific languages is not new by a long shot. To some degree, when someone puts together an object-oriented design that seeks to model the *problem* domain to allow programming the solution in a *declarative*, rather than purely procedural one - that is what they are doing. If you ever take a course on OOD/OOP - that is what you are instructed to do, ideally.
There is no problem with someone posting a link to an advanced programming article and other people digging it. Kevin Rose dug it, so I assume he feels doing so does not violate some canon of diggdom.
The current number of diggs (475) does not seem mind-bogglingly huge compared to the number of people around who know the technologies used in the article. There may have been a bunch of people who understood parts of it, even if they did not get the whole. It is still useful for them - and, they might want to show it to their friends and discuss/learn more about it.
The author did a nice job feeding the reader the pieces of the program step by step. The finished, complete program - which he included a link to - is stunningly short:
http://www.artima.com/rubycs/articles/code/ruby-logo.rb.txt
It is 70 lines long. It is not going to cause anyone's mental buffer to overflow when they read it!
The effect of the article is to make it clear that you can do useful things, like generate SVG, without scattering bits of XML elements, strings literals, or DOM calls everywhere. He has used some good design principles and coding techniques. In the one place where he did something less than elegant, he points that out - he does not obfuscate the fact.
I for one admire the article and the program. The author is trying to indroduce some people to something new, and he did. He does not have to be writing for the some imaginary quasi-universal audience in order for the article to be useful.
He had an audience, he spoke to it. He had a couple goals - to educate about some techniques and promote a piece of technology: he did it. He backed up what he said discussed with links to reference material with more information on the subject matters.
It is a legitimate piece of technical writing on Ruby programming, and somebody posted a link to it from the programming section of Digg. I see no problem with that at all. - 413x, on 10/12/2007, -0/+3a lot of people are learning / interested in ruby right now and some even dig(g) deeper into it. but on the other side they actually don't yet feel competent enough to comment on advanced articles such like this. so why not just being happy that there is an interest in ruby and computer language theorems in general. people are learning.. so isn't this a good thing? digging an article is appreciate it and like spreading the word.
btw: behind ruby there's also an eastern philosopy of kindness, not leetness. don't want to offend you, but i think prejudice is mostly just the same as being arrogant and snobbish. - Valence, on 10/12/2007, -1/+3For those who don't know how fun Ruby can be ...
http://www.rubyquiz.com/ - hoofarted, on 10/12/2007, -0/+2The funny thing is... 407 diggs and only 12 comments....
You guys don't know what the hell you are actually looking at. Do you have a "Auto RUBY DIGG" script running or something? This article is too high level for the average newbie out there and I cannot believe that all those diggs were from experts who know what the hell is going on here. - hoofarted, on 10/12/2007, -0/+1413x. I agree with everything you say. Just looking at the comments above, it seams like nobody understands what the article is about so I am confused about why there are so many diggs.
- Jagmatt, on 10/12/2007, -0/+1I wish the article made sense to me
- 413x, on 10/12/2007, -0/+1@hoofarted: ok, this is strange indeed. :)
- zitterbewegung, on 10/12/2007, -2/+0Has anyone ever heard of greenspun's 10th law??? Because once you add all of these features you have either CL with a few packages or http://www.scsh.net
- burke, on 10/12/2007, -3/+1Sweet. I would install the Sexp package, but apparently gem is broken. Oh well, I'll troubleshoot later. Great article! Go Ruby!
- inactive, on 10/12/2007, -6/+1Good find!!!
!digg and !send to Sonjaya Tandon :) - nmixer, on 10/12/2007, -5/+0Ha, i'm iwht both of you, jiminoc and bigdig!
- kurth, on 10/12/2007, -13/+7When I put my P device in my girlfriends primary V port, we sometimes exchange S-expressions, among other things. :-)


What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official