Mailing List Archive


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

Re: [tlug] Alternatives to sed + awk



On 11/03/2011 04:32, Stephen J. Turnbull wrote:
> So real
> attempts at DSLs in Lisp will either display a lot of Lisp syntax, or
> have a separate lex/parse stage like Maxima does.

Well, this is exactly my (and chromatic)'s point. People have been throwing
the DSL label onto things which are clearly not DSLs, and I'd say your example
is a borderline case. It's a domain specific language for specifying
loops, sure, *so long as* the content of those loops happens to be LISP code.

In other words, if you have someone who's an absolute expert on specifying
loops (whatever that might mean) they'll find this a great, expressive way of
specifying a loop, but they'll still have to hand over to a LISP programmer to
put some LISP code in the middle. To my mind this makes it a language
extension, not a DSL in its own right. The most I'm prepared to say is that
it's a DSL for a domain that's so incomplete that you can't do anything useful
with it at all.

I agree with what you're saying - your choices are: (a) a clean DSL without a
parser but which can't do anything interesting, (b) a "dirty" DSL without a
parser that's so embedded in a higher-level programming language that you
force your domain experts to learn the syntax and semantics of that language,
or (c) write your own parser and do it properly, dammit, then you get to call
it a DSL.

When the Ruby folks say "we can write DSLs without a parser", what they mean
is option (b), "we can write DSLs that display a lot of Ruby syntax without a
parser", and therefore what they're actually saying is "we can write subroutines."

S


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links