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

J Kenneth King james at agentultra.com
Tue Jan 6 15:24:43 EST 2009


Jonathan Gardner <jgardner at jonathangardner.net> writes:

> On Jan 6, 8:18 am, sturlamolden <sturlamol... at yahoo.no> wrote:
>> On Jan 6, 4:32 pm, mark <mark.fi... at googlemail.com> wrote:
>>
>> > I want to implement a internal DSL in Python. I would like the syntax
>> > as human readable as possible.
>>
>> Also beware that Python is not Lisp. You cannot define new syntax (yes
>> I've seen the goto joke).
>
> This isn't really true. You can, for instance, write a program (in
> Python) that takes your pseudo-Python and converts it into Python.
> This is what a number of templating libraries such as Mako do.

Which is not even close to being the same.

Lisp - the program source is also the data format

Python - the program source is a string

I could go on a really long rant about how the two are worlds apart, but
I'll let Google tell you if you're really interested.



More information about the Python-list mailing list