Abelson and Python

Chris Mellon arkanes at gmail.com
Fri Nov 24 14:56:22 CET 2006

On 11/23/06, Scott David Daniels <scott.daniels at acm.org> wrote:
> markscottwright wrote:
> > Fredrik Lundh wrote:
> >> markscottwright wrote:
> >>
> >>  > If it were that easy, the PyPy guys would be done by now.
> >>
> >> if the PyPy guys had focused on writing a Python interpreter in Python,
> >> they'd been done by now.
> >>
> >> </F>
> >
> > Isn't that the point of PyPy?  It's what their mission statement says
> > (http://codespeak.net/pypy/dist/pypy/doc/architecture.html#mission-statement):
> >
> > "PyPy is an implementation of the Python programming language written
> > in Python itself, flexible and easy to experiment with."
> >
> > This is something that is amazingly easy to do in scheme, since the
> > language is so simple, but is typically pretty difficult to do in other
> > languages....
> >
> > That said, I see now that the course we're talking about isn't the same
> > as the old 6.001 course, and presumably has different pedagogical goals.
> >
> There are a more than a few library functions in the Python code that
> are written in C in CPython.  Not only is PyPy trying to get the
> _entire_ Python system into Python, it is trying to do so in a
> friendly-to-translation-in-a-statically-typed-language way.
> Besides, if you can freely use "eval" and "exec", how hard is a pure
> python language interpreter?

It's pretty trivial, and thats why I've always been unimpressed by
"implemente a <x> language interpreter in <y> lines" type statements.
It's a cute toy but what's the real learning  opportunity there?

Now, writing a compiler/interpreter from the ground up is a more
valuable experience, but does it really matter if the language is the
same one you wrote the compiler in? It gets harder the more
complicated the syntax and semantics of the language are, but, say,
python 1.0 would probably be a suitable goal for coursework.

More information about the Python-list mailing list