C interpreter in Lisp/scheme/python
Mark Tarver
dr.mtarver at ukonline.co.uk
Thu Jul 8 06:27:03 EDT 2010
On 14 June, 00:07, bolega <gnuist... at gmail.com> wrote:
> I am trying to compare LISP/Scheme/Python for their expressiveness.
>
> For this, I propose a vanilla C interpreter. I have seen a book which
> writes C interpreter in C.
>
> The criteria would be the small size and high readability of the code.
>
> Are there already answers anywhere ?
>
> How would a gury approach such a project ?
>
> Bolega
Probably you want to look at this thread
http://groups.google.co.uk/group/comp.lang.lisp/browse_frm/thread/7b1ab36f5d5cce0a/54afe11153025e27?hl=en&lnk=gst&q=minim#54afe11153025e27
where I specified a toy language Minim (much simpler than C) and the
goal was to construct an interpreter for it. Similar problem.
Many solutions were given in different languages. The thread is very
long.
One thing you might look at is whether some sort of lexer/parser is
supported in any of your targets. Qi supports a compiler-compiler Qi-
YACC that allows you to write in BNF which makes this kind of project
much easier.
See
http://www.lambdassociates.org/Book/page404.htm
for an overview
Mark
More information about the Python-list
mailing list