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

Re: Rather, DSSLs increase modularity, productivity



On Mon, 17 Nov 2003, Miles Egan wrote:

> On Mon, 2003-11-17 at 08:11, Dan Sugalski wrote:
> > On Mon, 17 Nov 2003, Mike Newhall wrote:
> >
> > >
> > >        LISP-like languages aren't attractive solely for implementation
> > > reasons, I think; LISP wins for ease of programming.
> >
> > Well... maybe, but not in my experience. On the projects I've worked on
> > with embedded LISP-like languages we all swore with some regularity at the
> > languages *because* of their inherent LISP-y nature. Writing the code was
> > more of a headache and hassle, and went more slowly than it would've in
> > the embedding language. We used them, though, because there was no
> > alternative. We needed the embedded, dynamic language and had only a
> > little bit of I-space (even with overlays) to throw at the problem.
>
> How much easier is it really to implement a Lisp like language?

When your total addressible space is 64K of RAM? (Well, OK, 128K, split
into separately mapped I and D space) Much easier.

> Certainly lexing and parsing is easier, but with tools like lex/yacc and
> a sane syntax an infix language can be pretty lightweight and simple to
> implement too.  Once you get to an AST the rest is all more or less the
> same, right?

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. :)

> There's a discussion going on on the Bay Area Lispniks list on the pros
> and cons of s-expr syntax.  It seems to me that the only really killer
> application of s-exprs is in Lisp-style procedural macros, but perhaps
> my enlightenment is just around the corner.

S-exprs are useful as an intermediate representation even if you never
hand-create the representation. Any sort of pre-parsed representation of
code makes macros easier, though the more complex your syntax the nicer
they become.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk