3 ms·
Usually you call something an internal DSL when it reads like its own language. The reason that Ruby lends itself to internal DSLs is how optional a lot of its
by kenbellows 11y ago
Usually you call something an internal DSL when it reads like its own language. The reason that Ruby lends itself to internal DSLs is how optional a lot of its punctuation is, especially parens around method parameters, making it easier to write code that looks like a variant of English. A good example of this is Rake.
- chrisseaton 11y agoI still don't get what 'reads like its own language' really means though. Rake is still Ruby syntax and semantics. Rake just adds new methods - they're still Ruby methods and calling them reads like any other Ruby method using the same parsing rules. I'm playing the fool here - I do know what an internal DSL is but I think the term is entirely meaningless when you really think about it.
- drakecoffeecake 11y agoLisps let you define the semantics and syntax of a form with macros. I would consider the loop macro in CL to have an internal DSL. --edited
- draegtun 11y agoAnd another example of this, but not using macros, would be Rebol's parse which is a top-down parsing dialect (internal DSL) within Rebol. ref: http://en.wikipedia.org/wiki/Rebol#parse http://en.wikipedia.org/wiki/Rebol#parse