4 ms·
This is what you call an "internal DSL", a DSL implemented as a valid subset of another language. A DSL that is its own language requiring its own interpreter i
by kenbellows 11y ago
This is what you call an "internal DSL", a DSL implemented as a valid subset of another language. A DSL that is its own language requiring its own interpreter is sometimes called an "external DSL".
http://en.wikipedia.org/wiki/Domain-specific_language#Usage_patterns http://en.wikipedia.org/wiki/Domain-specific_language#Usage_...
- kyllo 11y agoAs a counterexample, Yesod (A Rails-like web framework for Haskell) uses (very appropriate IMO) external DSLs for defining URL routing and the data model. These are not runtime config, they are parsed into Haskell code, typechecked and compiled ahead of time: models: https://github.com/snoyberg/haskellers/blob/master/config/models https://github.com/snoyberg/haskellers/blob/master/config/mo... routes: https://github.com/snoyberg/haskellers/blob/master/config/routes https://github.com/snoyberg/haskellers/blob/master/config/ro...
- toothbrush 11y agoMaybe i'm a fundamentalist, but for me an internal DSL is more than what you describe. It is, for example, a syntax transformer (à la Racket) which is a new "keyword"-like thing. Valid in the host language, yes, but perhaps doing arbitrarily complex compilation-like steps before the final execution phase. IANAQCSY, though.