home ¦ Archives ¦ Atom ¦ RSS

Freeze: Creating Ruby DSLs

Warning, serious nerd stuff coming.

So I'm trying to wrap my head around the recent buzz around DSLs, domain specific languages, given I was really into PLDI when there were a couple of academic conferences on the topic. As best I can tell, DSLs are really hot in the Ruby community, and JIm Freeze's introduction, "Creating DSLs with Ruby" is the most accessible I've seen so far. Can't say I'm overwhelmed so far, as these Ruby DSLs mainly look like crafty usage of a syntactic shortcut, eval, and default method lookup. Declarative style languages are handled straightforwardly but how does this face up to other design points. While very useful, I don't see a path to doing some of the major syntactic extensions ala Paul Graham in On Lisp, such as anaphoric macros. Another good point, made by Oleg Kiselyov, via Anton von Straaten, is that macros allow one to abstract over the stuff that isn't first class in the language.

Bonus: Lambda The Ultimate has a couple of good sections on DSLs

© Brian M. Dennis. Built using Pelican. Theme by Giulio Fidente on github.