looking for tips on how to implement "ruby-style" Domain Specific Language in Python

Jonathan Gardner jgardner at jonathangardner.net
Fri Jan 9 13:45:55 EST 2009


On Jan 8, 8:03 am, Kay Schluehr <kay.schlu... at gmx.net> wrote:
> On 8 Jan., 16:25, J Kenneth King <ja... at agentultra.com> wrote:
>
> > As another poster mentioned, eventually PyPy will be done and then
> > you'll get more of an "in-Python" DSL.
>
> May I ask why you consider it as important that the interpreter is
> written in Python? I see no connection between PyPy and syntactical
> Python extensions and the latter isn't an objective of PyPy. You can
> write Python extensions with virtually any Python aware parser.
> M.A.Lemburg already mentioned PLY and PLY is used for Cython. Then
> there is ANTLR which provides a Python grammar. I also know about two
> other Python aware parsers. One of them was written by myself.

If you're going to manipulate the Python compiler/interpreter from the
Python program itself, it's only reasonable that the Python compiler/
interpreter be written in Python so that it can be manipulated.

If you haven't already made it through SICP, you really should. It
will help you understand why being able to write a language in itself
is a big deal and why having the language around to be manipulated
from within the language is very useful.



More information about the Python-list mailing list