Writing an interpreter for language similar to python!!

Daniel Nogradi nogradi at gmail.com
Fri Mar 2 06:36:50 EST 2007


> I am new to python and working on a project that involves designing a
> new language. The grammar of the language is very much inspired from
> python as in is supports nearly all the statements and expressions
> that are supported by python. Since my project is in initial stage, so
> I think it would be appropriate if I clarify the following questions:
>
> 1. Would it make sense if I parse the whole program from scratch and
> then construct the valid python strings back so that they can be
> executed using ''exec'' and ''eval'' commands?
> 2. Recently, I came across PLY (Python-Lex-Yacc) module that can be
> used to implement interpreters. It seems quite friendly to work with.
> Is there any implementation of python interpreter using ply? Any such
> reference would be extermely helpful for me to continue.
>
> Any kind of suggestions/ comments would be highly appreciated.


You might want to look at the pypy project:

http://codespeak.net/pypy/dist/pypy/doc/news.html

A javascript interpreter has already been written using pypy:

http://codespeak.net/svn/user/santagada/javascript_interpreter_sop.txt



More information about the Python-list mailing list