python interpreter in smalltalk

Keith Ray k1e2i3t4h5r6a7y at 1m2a3c4.5c6o7m
Thu Feb 15 12:37:56 EST 2001


In article <3A8B8B6C.A19DC08D at phoenix-edv.netzservice.de>, Marten 
Feldtmann <marten at phoenix-edv.netzservice.de> wrote:

> Keith Ray schrieb:
> > 
> > In article <7MGJOov0nvx+VW3xYgkmsmMz2tDQ at 4ax.com>, sma at 3plus4.de wrote:
> > 
> > > On Sat, 03 Feb 2001 02:57:36 GMT, Keith Ray
> > > <k1e2i3t4h5r6a7y at 1m2a3c4.5c6o7m> wrote:
> > >
> > > >Has anyone tried to write a Python interpreter in Smalltalk?
> > >
> > > I tried this, although using Squeak Smalltalk not Dolphin Smalltalk.
> > > I never finished the project but there's a partially working parser
> > > which I could share.
> > >
> > > bye
> > > --
> > > Stefan Matthias Aust____Truth until Paradox!____________________
> > >      Jobs? ==> jobs at baltic-online.de   www.baltic-online.de
> > 
> > I have the desire to see Python running inside Squeak
> > <http://www.squeak.org/>.
> > 
> 
>  Why not call Python via it's C interface ?

Because that wouldn't allow writing Python subclasses of Smalltalk 
classes and vice versa. Both Python and Squeak use bytecodes, and run in 
a kind of VM. Squeak can call out to C code, but C code can't call into 
Squeak -- the hooks are not there (yet).

Squeak happens to be implemented "in itself" -- that is, its virtual 
machine was written and debugged in a subset of normal Smalltalk (I 
think they call it 'Slang'). Then a translator (also written in 
Smalltalk) converts the Slang code into C code, which is compiled and 
becomes the real virtual machine. The original Slang-based virtual 
machine can also be executed in Squeak -- so you have an "emulated" 
virtual machine running (very slowly) inside a real virtual machine.

If Squeak can be made to handle multiple sets of byte-codes types, then 
it could transparently handle Python, Java, and Smalltalk in its 
"universal VM". 

Or the JPython route -- implement Python within the host language/vm... 
Jython allows interoperating with Java the way I want Python to 
interoperate with Squeak Smalltalk.

Squeak can reconstuct the source code of a method from the byte-code 
(does not include comments and probably not the local variable names), 
it is possible that a combined Squeak/Python vm could let you choose to 
view a method in Smalltalk syntax or in Python syntax.

Squeak has been ported to many platforms, including some that don't have 
an operating system (ported to the "bare metal"). It has really good 
MacOS support (my preferred platform).

-- 
       <http://homepage.mac.com/keithray/resume.html>



More information about the Python-list mailing list