Self hosting Python? (was: Python is just as good as C++ for real apps)

Russell Turpin russell_turpin at hotmail.com
Wed Jan 23 12:27:55 EST 2002


Courageous <jkraska at san.rr.com> wrote in message news:<b3as4ushqd8rni7389puglkk6hickhvgp5 at 4ax.com>...
> Why isn't Python self-hosting?

I wonder how many Lisp systems are fully self-hosted? Self
hosting is pretty easy with languages that include a low
level model of the machine, such as C. I have no experience 
doing this for higher-level languages. My first suspicion 
-- which may be wrong -- is that 100% self-hosting would  
be difficult to do *efficiently* without using a memory 
management library written in a different language, or
hand-translation of the some of the Python code. The
problem is that Python simply doesn't give you a way to
express memory management at the machine level. Everything
is a reference to an object. There is no way to code an 
"array of bytes," because that notion simply isn't in the
language. That's very good for everything .. EXCEPT byte
management. 

This all seems very reasonable to me. There is NO reason
that an application language should provide the constructs
for modeling the machine. Let's do the things that require 
such low-level notions in C, including standard memory
management and implementing numeric packages. Removing 
it from the domain of applications is a boon. Python isn't
just as good as C++ for real applications -- it is far 
better.

That said, it might be worthwhile to encapsulate the memory 
management (and other low-level mechanisms required) behind 
a fixed interface, implemented in C, and then make a Python 
compiler in Python. This would serve several goals. It 
would provide a route to performance improvement. It would 
make the semantics of the language more precise. It would 
help how people view Python. And it sounds like fun. If 
anyone wants to pay me to do this, I'm eager to jump into 
the internals of the language! 

[comp.lang.c++ trimmed]

Russell



More information about the Python-list mailing list