Python interpreter in python?
Steven D. Majewski
sdm7g at virginia.edu
Tue Dec 19 14:41:03 EST 2000
On Tue, 19 Dec 2000, D-Man wrote:
>
> The problem with such a thing is that to run your interpreter you
> would need an existing interpreter (written in C/Java or other
> language). The only languages that can be implemented in themselves
> are compiled languages like C and C++.
>
That is absolutely untrue!
Lisp and Scheme are frequently implemented in themselves -- a
'metacircular interpreter' is a fairly typical student exercise.
I don't know of a Python-in-Python, but I don't know of any reason
you couldn't do one.
The only question is: how deeply do you want to emulate it? i.e.
are you allowed to use the existing parser module or do you want
to write one from scratch?
-- Steve Majewski <sdm7g @ Virginia.EDU>
More information about the Python-list
mailing list