4 ms·
regular expressions work so well people have stopped thinking of them as a dsl and just see them as a language feature.
by zem 9y ago
regular expressions work so well people have stopped thinking of them as a dsl and just see them as a language feature.
- evincarofautumn 9y agoCharacter escapes and string formatting (printf, String.Format in .NET) fall into this category as well. They’re weird little domain-specific sublanguages that are entirely unlike their host languages, which people don’t even think of as DSLs because they’re so pervasive and (somewhat) consistent across languages.
- TeMPOraL 9y agoI'd throw in pattern matching, which is becoming popular thanks to functional programming.
- zem 9y agoyeah, i pointed out racket's `match` in a sibling comment, where they added it to the language as a dsl. works beautifully.
- TeMPOraL 9y agoLikewise, Common Lisp has a powerful matching DSL library too - Optima[0]. I also found a pretty new alternative, Trivia[1], which claims to be a drop-in replacement for Optima, but more extensible. -- [0] - https://github.com/m2ym/optima https://github.com/m2ym/optima [1] - https://github.com/guicho271828/trivia https://github.com/guicho271828/trivia
- lostcolony 9y agoGood example! And maybe that's what happens; extremely successful DSLs stop being thought of as DSLs, but as languages or features in their own right.