4 ms·
Well, this is (one of my) areas so here goes. DSLs are a concept, not an implementation. As implemented they can vary from chained procedure calls to actual
by throwaway_pdp09 6y ago
Well, this is (one of my) areas so here goes. DSLs are a concept, not an implementation. As implemented they can vary from chained procedure calls to actual sub languages with lexers and parsers (and I tend to consider the latter to be 'proper' DSLs, but that's just my view).
To have a 'proper' DSL I reckon you need two things, and understanding that a thing can and should be broken out into its own sublanguage, and the ability to do so. The first takes a certain kind of nouse, or common sense. The latter requires knowing how to construct a parser properly and some knowledge of language design.
Knowing how to write a parser is not particularly complex but as the industry is driven by requirements more of knowing 'big data' frameworks rather than stuff that is often more useful, well, that's what you get, and that includes people who try to parse XML with regular expressions (check out this classic answer <https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 https://stackoverflow.com/questions/1732348/regex-match-open...> Edit: if you haven't seen this check it out cos it's brilliant).
I think this reflects the fundamental problem in software development of the market's not knowing what's actually needed to solve real business problems.
++++
Edit, some reading material
https://www.amazon.co.uk/Language-Implementation-Patterns-Domain-Specific-Programming/dp/193435645X/ https://www.amazon.co.uk/Language-Implementation-Patterns-Do...
https://www.amazon.co.uk/Definitive-ANTLR-Reference-Domain-Specific-Programmers/dp/0978739256 https://www.amazon.co.uk/Definitive-ANTLR-Reference-Domain-S...
https://www.amazon.co.uk/yacc-Nutshell-Handbook-Doug-Brown/dp/1565920007 https://www.amazon.co.uk/yacc-Nutshell-Handbook-Doug-Brown/d...
They're all worth investing the time in.
- vishnugupta 6y agoThanks a lot! This is very useful information and follow up books.