Hacker News new | ask | show | jobs
by mattfenwick 4306 days ago
This seems to be implemented as an external DSL, with a brand new syntax and semantics. So my question is, why do that instead of implement it as an embedded DSL?

(Disclaimer: this is an honest question out of curiosity. I don't mean to imply that an embedded DSL is the right way, or that it's better -- but I do believe there's a tradeoff here and am interested in how that tradeoff factored in to the decision to implement this as a separate language.)

1 comments

I don't understand what you mean. Can you elaborate?
I don't know what you would like clarified, so please let me know if this doesn't cover it:

IMHO, the OP is presenting a DSL (DSL = domain specific language), and there are at least two common ways to implement DSLs, embedded and external (i.e. not embedded):

from http://en.wikipedia.org/wiki/Domain-specific_language:

     embedded (or internal) domain-specific languages, implemented as libraries
     which exploit the syntax of their host general purpose language or a subset 
     thereof, while adding domain-specific language elements (data types, routines,
     methods, macros etc.)
An example would be with parsers. Parser combinators are usually an embedded DSL. Tools like Lex and YACC are not embedded DSLs (as far as I know).

-----

Disclaimer: both have pros and cons, etc. etc. Interested in the author's motivations, not in debating which way is better, etc. etc.