Why don't people like lisp?

Paolo Amoroso amoroso at mclink.it
Wed Oct 22 11:25:55 EDT 2003


Andrew Dalke writes:

> Paul Rubin:
>> You could of course do something similar in Lisp, but normally you'd
>> just use S-expressions instead of concocting your own weird syntax
>> every time you want to build a small language into something.  Then
>> you just use the regular Lisp "read" function and the S-expressions
>> get parsed automatically for you.  Your whole parser becomes just one
>> line of code.
>
> Ahh, but that's writing the domain language to fit the implementation
> language.  The moral equivalent for Python would be to use Python's
> syntax to define a function, which is simple.  Eg, Suppose the domain

Bingo, that's exactly the point :-)

The idiomatic way of developing little/domain-specific languages in
Lisp is to leverage its sexp-based syntax whenever possible and
appropriate. And yes, the scary macros are one of the main tools used
for this. Python's mileage might (and the current threads suggest that
it does :) vary.

Is Lisp's approach complicated or confusing for certain domain experts
or non programmers? Quite possibly. But they may not be the intended
audience of Lisp.

Learning Lisp, and the idiomatic ways of using it, does take time and
effort, but Lispers believe that this pays off. Those who prefer other
approaches have lots of alternatives, including Python.

As to why one may want to design little/domain-specific languages with
sexp-based syntax, some insight is provided in this paper by Olin
Shivers:

  A Universal Scripting Framework - or - Lambda: the ultimate "little language"
  http://www.ai.mit.edu/~shivers/ll.ps

  Abstract: The "little languages" approach to systems programming is
  flawed: inefficient, fragile, error-prone, inexpressive, and
  difficult to compose. A better solution is to embed task-specific
  sublanguages within a powerful, syntactically extensible, universal
  language, such as Scheme. I demonstrate two such embeddings that
  have been implemented in scsh, a Scheme programming environment for
  Unix systems programming. The first embedded language is a highlevel
  process-control notation; the second provides for Awk-like
  processing. Embedding systems in this way is a powerful technique:
  for example, although the embedded Awk system was implemented with
  7% of the code required for the standard C-based Awk, it is
  significantly more expressive than its C counterpart.

Although Shivers presents examples in Scheme, the ideas apply to other
Lisp dialects, and possibly also to other languages. The `scsh' system
mentioned in the paper is available at:

  http://scsh.sourceforge.net


Paolo
-- 
Paolo Amoroso <amoroso at mclink.it>




More information about the Python-list mailing list