Regarding the author's point, I tend to agree but wonder if non-programmers would feel the same way. I suspect they would, as I;ve known some Word junkies and they loved creating macros and that sort of thing but wouldn't have confessed to being programmers.|
> Agreed, but IMHO the real issue is *how fast you grow* your DSL.
> It's unrealistic to think that a DSL ideally adapted to a specific
> domain can be designed on a first pass. It might be better to stick
> with a General Purpose Language + Domain Specific Library for awhile
> until some experience in dealing with the particular domain has been
> Hypothesis: DSL's are best grown by internalizing commonly found
> design patterns into the language.
Jon, since you 'fessed up to trolling in another thread, I suppose this remark was intended to drag a Lisp bigot, such as myself, out of hiding. Well you're in luck!
I'm in broad agreement with the above statements and would like to rant a bit about patterns, macros and Lisp. Patterns indicate a flaw in languages. Specifically the inability to turn patterns into idioms. Guy Steele presented a very nice pattern on ll1-discuss:
Hm. There's a very interesting pattern, the "if-then-else"
pattern, that has been used for a long time but got raised
in people's consciousnesses as an important pattern only with
the advent of Structured Programming and its thesis that all
control structure in a procedure could (should?) be expressed
in terms of sequencing, if-then-else, and while-do iteration.
The gist of the pattern is:
You want to do one of two things S and T depending on the
value of some boolean predicate P.
branch if not(P) to L
branch unconditionally to E
L: execute T
Now, should we say that this pattern is more useful precisely
because it is not wedded to particular language hacks such as
Scheme's "(IF P S T)" or C's "if (P) S else T" or "P?S:T" ?
On the contrary. It is good to know the pattern in case you need
to use a low-level language (every compiler writer knows this
pattern and several related ones), but it is also good to have
this extremely commonly used pattern packaged up as an idiom
in most programming languages. The fact that different languages
express it in syntactically different ways makes it no less useful.
So languages have grown by turning patterns into idioms. They just don't do it fast enough. If they did we wouldn't need patterns!
Ideally we'd want a language that allows itself to be extended into a DSL. This saves the cost of reimplementing the runtime and so reduces the barrier to entry for a DSL. It also allows more organic growth - you don't need to design the DSL, just grow it naturally out of the domain-specific libraries and patterns of interaction with those libraries. This all comes around to extensible syntax, i.e. macros, which in turn comes around to Lisp (though there are decent macro languages available for other languages such as Java).