code is data

Kay Schluehr kay.schluehr at gmx.net
Mon Jun 19 12:26:14 EDT 2006


Ravi Teja wrote:

> People have however written various language interpreters (Scheme,
> Forth and yes, even Basic) in Python, just for kicks. Still does not
> make it a DSL language anymore than it makes C a DSL language.
>
> At present, the closest thing to writing a DSL in Python is Logix
> http://livelogix.net/logix/
> Too bad though, the project is defunct and there has never been enough
> interest in it.

You might be interested in EasyExtend:

http://www.fiber-space.de/EasyExtend/doc/EE.html

Unlike Logix there are no macros defined in application code and there
are no runtime macro expansions. So extension language semantics is
always fixed at compile time.

> Personally, I would like to see macros in Python (actually Logix
> succeeding is good enough). But I am no language designer and the
> community has no interest in it. When I absolutely need macros, I will
> go elsewhere.

Although Logix was written in Python and compiled to CPython bytecodes
it was a language on its own right: a Python / Lisp hybrid. Opposed to
this EasyExtend is a Python framework for language extensions and not
itself a language. A quite typical use case may not involve any new
grammar rules or terminals, but just generates code. See the coverage
fiber as an example.




More information about the Python-list mailing list