Stackless/microthreads merge news

Christian Tismer tismer at tismer.com
Wed May 3 19:16:29 EDT 2000


Joe Kraska wrote:
> 
> Christian Tismer wrote:
> >Courageous wrote:
> >> Quite. I corresponded with the Kiev implementors a while
> >> back, asking them why they hadn't added continuations to
> >> Java. They responded back with "impossible on the JVM".
> >
> >Ah, this is the elixier. Gimme more impossibles, and I'll fly.
> 
> Well, of course what they meant was "impossible with
> the current JVM". Their project set out to be JVM-
> compatible. They implemented first class functions in
> Java, closures, variadic argument support, and a variety
> of other things and were still JVM-compatible. Given
> the Lispishness of Kiev, I began to wonder if they'd
> considered doing continuations. Continuations can be
> very helpful in a modeling & simulation environment,
> as it sometimes becomes necessary to do your own
> scheduling in such environments. But they claimed that
> the current JVM couldn't do it.

That sounds much better.

> Sure would be nice if it could!

The problem appears to be similar to make Viper stackless.
I discussed this with John Skaller quite some time ago.
It is harder than for Python. Python already gives you
frames, and the step to use them alone is quite in reach.
Compiled stack machines are different, but I have a concept.
Doing it generally, for "all C programs", would be nearly
impossible without changing compilers, or with doing
non-portable assembly hacks. Not so for a VM, there you
have much more freedom, since you just have to keep the
interfaces, but nobody dictates how you build your
stack layout, if you are carrying a little additional
info on each call, etc.
With some thought, it is possible to add continuations,
even if you still have a stack layout, with a few more info.
Continuations that appear in the stack can create heap-like
structures on demand, only if needed. Just see the stack as
a special case of a heap, that happens to be allocated in
invocation order in a large structure. This is fine for most
cases and efficient. But we might want to break it if we need
to do so.

Well, that's all too early, there are a couple of hundred thousands
of source code left for me to read...

ciao - chris

[no Michael, I'm going to write that book anyway, be assured:]

-- 
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
     where do you want to jump today?   http://www.stackless.com




More information about the Python-list mailing list