Why don't people like lisp?

Paul Rubin http
Thu Oct 23 01:09:56 EDT 2003


"Andrew Dalke" <adalke at mindspring.com> writes:
> In other words, writing the domain language as an S-exp
> is a short cut to make it easier on the programmer, and not
> on the domain specialist.  Unless the domain is programming.
> And you know, very few of the examples of writing a domain
> specific language in Lisp have been for tasks other than
> programming.

Actually in my experience that hasn't been a problem.  For example, I
wrote a program that crunched EDI documents.  There were hundreds of
different document types each with its own rudimentary syntax.  We had
a big 3-ring binder containing a printed copy of the ANSI standard
that had a semi-formal English description the syntax of each of these
documents.  My program had an embedded Lisp interpreter and worked by
letting you give it the syntax of each document type as a Lisp
S-expression.  The stuff in the S-expression followed the document
description in the printed EDI standard pretty closely.  I typed in
the first few syntax specs and then was able to hand off the rest to a
non-programmer, who was able to see pretty quickly how the
S-expressions worked and code the rest of them.  I think that the
version of the system we actually shipped to customers still had the
S-expression syntax specs buried in its guts somewhere, but my memory
about that is hazy.

The instructions about how to process specific documents were also
entered as Lisp programs at first.  That let us very quickly determine
the semantic features we wanted in processing scripts, even though we
knew that our customers wouldn't tolerate Lisp.  Once we had the
semantics figured out, we were able to design a language that
superficially looked like an unholy marriage of Basic and Cobol.  We
wrote a Yacc script that parsed that language and built up
S-expressions in memory, and then eval'd them with the Lisp
interpreter.  

> > Do people write any significant amount of code in the Python parse
> > tree syntax?

Peter Norvig talks about this some in his Python/Lisp comparison page:

   http://www.norvig.com/python-lisp.html

Basically the Python AST structure is awful, but you arrange your life
so you don't have to deal with it very much.

> There's very little evidence that Lisp is significantly better
> than Python (or vice versa) for solving most problems.
> It's close enough that it's a judgement call to decide which
> is more appropriate.

There's one area where Lisp absolutely rules, which is providing a way
to write down complicated data structures without much fuss.  These
days, XML is used as a Bizarro cousin of Lisp S-expressions in all
kinds of applications for similar purposes.  The EDI program I
mentioned earlier was not originally intended to have an embedded
interpreter.  I typed in some EDI syntax specs as S-expressions just
to have something to work with.  I then wrote something like a Lisp
reader to read the S-expressions.  I found myself then writing a Lisp
printer to debug the Lisp reader.  Having a reader and printer it was
then entirely natural to add an eval and gc.  The result became a
fairly important product in the EDI world for a time.




More information about the Python-list mailing list