Why don't people like lisp?
kaz at ashi.footprints.net
Wed Oct 22 23:56:47 CEST 2003
"Andrew Dalke" <adalke at mindspring.com> wrote in message news:<V5klb.389$I04.218 at newsread4.news.pas.earthlink.net>...
> Kaz Kylheku:
> > The input to a compiler should not be a character string, but
> > structured data.
> I think you're arguing naming preferences here. That's fine;
> Alex's point remains unchanged. In a dynamic language like
> Python, parsing a domain specific language can be done at
> run-time, parsed, converted to a Python parse tree, and
> compiled to Python byte codes, just like what you want and
> in the form you want it.
Ah, but in Lisp, this is commonly done at *compile* time. Moreover,
two or more domain-specific languages can be mixed together, nested in
the same lexical scope, even if they were developed in complete
isolation by different programmers. Everything is translated and
compiled together. Some expression in macro language B can appear in
an utterance of macro language A. Lexical references across these
nestings are transparent:
... establish some local variable foo ...
... reference to local variable foo set up in language-a!
The Lisp parse tree is actually just normal Lisp code. There is no
special target language for the compiler; it understands normal Lisp,
and that Lisp is very conveniently manipulated by the large library of
list processing gadgets. No special representation or API is required.
Do people write any significant amount of code in the Python parse
tree syntax? Can you use that syntax in a Python source file and have
it processed together with normal code?
What is Python's equivalent to the backquote syntax, if I want to put
some variant pieces into a parse tree template?
More information about the Python-list