Python questions -> compiler and datatypes etc
richard at bizarsoftware.com.au
Thu Oct 11 02:39:54 CEST 2001
On Thursday 11 October 2001 10:26, Paul Rubin wrote:
> Richard Jones <richard at bizarsoftware.com.au> writes:
> > Do a search in the python mailing list for "python compiler". The
> > answer is invariably "it's bloody hard". This stems from the
> > fundamental dynamic typing of python. It's very very very hard to
> > write a compiler when you don't know the type of the objects you're
> > dealing with beforehand. Java knows these types, because it's
> > statically typed. Therefore it's relatively trivial (compared to
> > python) to write a compiler for Java.
> I think the real answer to why there's no Python compiler is no one
> has really wanted to write one.
That's not true - as I have mentioned in my last post, there have been
efforts and as far as I recall there is an ongoing effort right now. I just
can't find the reference at the moment.
> Python's runtime semantics are pretty
> similar to Lisp systems, and native-code Lisp compilers have existed
> since the 1960's or maybe even earlier. It might even be feasible
> to adapt one to compile Python.
I believe I've seen a similar proposal along those lines in the past too.
I don't believe it's a case of people not wanting to do it - it's would just
required huge resources. The kind of resources only a commercially funded
operation could provide at the moment. And I guess that at the moment, no-one
can make a business case for it.
More information about the Python-list