3 ms·
The lack of punctuation characters makes this a DSL and not bog-standard Ruby code? > ... instead of creating DSL people usually implement some kind of config
by chromatic 17y ago
The lack of punctuation characters makes this a DSL and not bog-standard Ruby code?
> ... instead of creating DSL people usually implement some kind of config file format instead. or just use XML.
Writing a grammar or a parser means you haven't created a DSL?
Unless by "DSL" you mean "Ruby syntax and Ruby semantics with symbol names chosen by the programmer", I have no idea what you mean by "DSL".
- jimbokun 17y agoHow about this: Ruby's syntactic flexibility and semantic model mean that many cases handled by a change to the language spec or delegating to another language (XML config files, for example) can be cleanly handled in Ruby itself. The end result is often something that looks like a little language for a specific task, such as Rake, Rails, etc. (I'm not a Ruby programmer, so I hope those are good examples.) So with Ruby, there are very few cases where writing a custom grammar or parser is necessary. Ruby's flexibility gives you the ability to do things that might require a custom grammar or parser in other languages.
- draegtun 17y agoHowever even Jim Weirich doesn't like Rake being called a "DSL". I think Piers Cawley was dead on by calling things like this a Pidgin refs: * http://www.infoq.com/interviews/jim-weirich-discusses-rake http://www.infoq.com/interviews/jim-weirich-discusses-rake * http://www.bofh.org.uk/2007/08/08/domain-specific-pidgin http://www.bofh.org.uk/2007/08/08/domain-specific-pidgin
- flogic 17y agoCommon usage of DSL seems to mean an API whose usage looks more like a secondary language rather than the host language. At least that's my interpretation. A case example would be jQuery. Which while it is JavaScript, idiomatic code using jQuery isn't written in the same style as traditional JavaScript.