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

Jonathan Gardner jgardner at jonathangardner.net
Fri Jan 9 13:43:28 EST 2009


On Jan 8, 7:25 am, J Kenneth King <ja... at agentultra.com> wrote:
> Jonathan Gardner <jgard... at jonathangardner.net> writes:
>
> It seems we're defining "DSL" in two different ways.
>
> You can't write a DSL in Python because you can't change the syntax and
> you don't have macros.
>
> You can write a compiler in Python that will compile your "DSL."
>

Yes, that's what I'm saying. You can get the same results even thought
you can't manipulate the Python language itself as it's compiling
Python because you can feed it Python code that you've generated.


> As another poster mentioned, eventually PyPy will be done and then
> you'll get more of an "in-Python" DSL.

Of course, such a language wouldn't be Python anymore because Python
doesn't have such features.



More information about the Python-list mailing list