From: "M. Edward (Ed) Borasky" Date: 2006-10-01T19:40:49+09:00 Subject: Re: "Succinctness is Power", by Paul Graham Martin Coxall wrote: > In any case, there's a question about about to what extent you *should* > host DSLs internally. It's my feeling that if you want to inline a DSL > in your code, make sure that language is still syntactically > recognizably a Ruby. Ruby on Rails is a classic example. The problem I have with the two best-known Ruby DSLs, Rails and Rake, is the somewhat non-intuitive mix of words that don't begin with colons, and symbols, which do. And Rails requires YAML in some places that are jarring to the reader. Why is the database connection description file in YAML and not in "a Ruby"? > If you want to create a non-idiomatic, syntactically strange DSL and > inline it in your code via abuse of language facilities, that's how you > end up with Common Lisp's 'Loop' Macro. It's not good, and it's > definitely ugly, as Paul Graham says. > > Once you cross that line where your DSL is no longer 'a Ruby', create a > grammar for it and knock together a parser for it in Racc. Ah, but once you cross that boundary and start building an external DSL, what does Ruby have to offer that other compiler-compiler tools don't have? Mind you, I haven't yet tried to build anything with Racc, so I don't know if it's a significant improvement on Yacc, Bison or the Java thingie -- is it Antlr??