4 ms·
Yes of course, but in the context of a DSL, you're not really defining a new syntax. You've still got an AST at the end of the day. And of course, this isn't
by kgo 16y ago
Yes of course, but in the context of a DSL, you're not really defining a new syntax. You've still got an AST at the end of the day.
And of course, this isn't an attack on lisp. If it works for you, cool. But I just don't see how that distinguishes itself from a ruby DSL like say rspec.
I think the nicest feature of lisp DSLs is that lisp doesn't have the concept of an operator, and most langaguages make if difficult to define a function called or <- or something like that. But you can do that in Haskell or or ML, it's not really exclusive to S-exps.
- scott_s 16y agoI'm unfamiliar with rspec, but the major difference between designing and implementing DSLs in Lisps versus other languages is ease of code generation. That is, actually generating new code based on what the user of the DSL supplies. In Lisp, this is done because it's trivial to receive the AST that defines what the user wants to do. Then you can generate code directly based on that AST. No need for reflection or any such trickery because it's all just lists of list. In most other languages, if that sort of transformation is even possible, it is much less direct.