[Python-ideas] Statements vs Expressions... why?
Cliff Wells
cliff at develix.com
Mon Sep 15 05:48:47 CEST 2008
On Mon, 2008-09-15 at 14:23 +1200, Greg Ewing wrote:
> Leonardo Santagada wrote:
>
> > The only clean way to support DSL in python in my view would be to
> > support something like pyparsing or ANTLR and make it generate a parser
> > and some simple form of compilation to python bytecodes. How can we
> > support that? Is this even desired?
>
> The way to go is probably to have the parser build an AST.
> That way you get to reuse the compiler machinery for generating
> bytecode, without having to worry about the messy details
> of generating textual Python source.
This is the approach Logix took, which is probably why it no longer
works under Python 2.5. This is exactly why I find this type of
approach unappealing (vs writing an internal DSL).
I'm not sure what approach EasyExtend takes, but it's another potential
player in this field:
http://www.fiber-space.de/EasyExtend/doc/EE.html
Regards,
Cliff
More information about the Python-ideas
mailing list