Forth like interpreter

Christian Tismer tismer at tismer.com
Sun Mar 12 13:54:25 EST 2000


Darrell wrote:
> 
> Christian Tismer wrote:
> > Then we move on to pluggable interpreters. Frames are then made
> > flexible enough to be used as the needed stacks, and we build a
> > small TIL (threaded interpreted language), probably smaller and
> > different from Forth, but in its spirit.
> >
> Love what your doing with Stackless.
:-)
> Are you thinking about moving some or all of the Python VM functionality
> into these TIL's ? To grok that I'll need another free weekend!

The first idea was to use that to build extensions without
a compiler, giving some fair speed.

But when I received your mail, I was just sitting over stuff
like PyInstance_DoBinOp which might call halfbinop twice,
and halfbinop might itself cause up to four PyObject_CallObjects
in the worst case.
In the morning, I thought "let's make BINARY_ADD stackless",
but at the moment, this looks fairly impossible.

There are so many chances that I would need to unwind and
restore... one would need to rewrite that, use tiny functions
and some piece of state, easy to enter and to leave...

In other words, certain operations appear to be quite
complicated. I would be easier if these were split into
a sequence of opcodes and tiny operations. This stuff
must be turned into tail position. Have a look at halfbinop
and instance_coerce, and you will see while I'm scratching hair.

Can it be that I need the TIL in 1.2, to make 1.3 really stackless?

I fear classobject.c and abstract.c need a complete rewrite.

oh well - ciao - chris :-)

stackless going forth?
-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list