[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rather, DSSLs increase modularity, productivity




Dan Sugalski <dan@sidhe.org> writes:
> To a large extent, yes. But don't discount the startup costs here -- if
> you start with lex and yacc you're starting with the intent to build a
> full language. Many, possibly most, DSLs start as a sort of a hack because
> someone needs the functionality and it was easy enough to hand-code
> something to get by. Things quickly get out of hand from there. :)

The most effective argument I ever made for using a pre-existing
extension language, rather than inventing one from scratch, went
something like this:

   Don't put yourself in a situation where, five years down the road, you
   have to write a paragraph in your manual like this one (from the GNU
   Make manual):

        Commas and unmatched parentheses or braces cannot appear in the
     text of an argument as written; leading spaces cannot appear in the
     text of the first argument as written.  These characters can be put
     into the argument value by variable substitution.  First define
     variables `comma' and `space' whose values are isolated comma and
     space characters, then substitute these variables where such
     characters are wanted, like this:
     ...

My comments at LL3 in defense of sloppiness aside, I think a lot of
the worst language design happens via the incremental addition of
features, while trying to preserve backward-compatibility.  I think
that's the explanation for the Bourne shell and the C shell.

But where this leads, I don't know.  I just hope it's to something
more helpful than "You shoulda thunk harder [dope slap]."