4 ms·
I often read that Ruby (or Forth, for that matter) is great for DSL because you can "misuse" the language tokenizer/parser directly as parser for your DSL, as l
by vog 12y ago
I often read that Ruby (or Forth, for that matter) is great for DSL because you can "misuse" the language tokenizer/parser directly as parser for your DSL, as long as it's similar enough to ruby (e.g. tokens are whitespace delimited and such). Unfortunately, Ruby's macro power is nowhere near LISP.
I wasn't aware that this is possible in LISP, too. That's really great!
- zachbeane 12y agoCertain things are still hardwired into the Common Lisp reader. For example, because of how colons are treated in symbols, you can't trivially support something like JSON via reader macros. It still works best if the input bears a pretty good resemblance to lisp. That's not such a big deal, because there are plenty of tools for conventional input parsing in Common Lisp.
- draegtun 12y agoThere are a few languages that are good for (internal) DSL, ie. Dialects - https://news.ycombinator.com/item?id=8394181 https://news.ycombinator.com/item?id=8394181 Unfortunately the Dialecting wikipedia link given in above comment now just redirects to http://en.wikipedia.org/wiki/Dialect_(computing) http://en.wikipedia.org/wiki/Dialect_(computing) The original page listed... Forth, Lisp, Rebol, Ruby & XL - https://web.archive.org/web/20140708161345/http://en.wikipedia.org/wiki/Dialecting https://web.archive.org/web/20140708161345/http://en.wikiped...