Stackless/microthreads merge news

Glyph Lefkowitz glyph at twistedmatrix.com
Sun May 7 13:11:37 EDT 2000


Christian Tismer <tismer at tismer.com> writes:

> Aaahh. Good advice. Is Classpath something where I
> should look at, too?

It's a free re-implementation of the Java class libraries.  Not bad,
if you're into that sort of thing.

>> [nda]
> 
> Gulp! No I won't do that :-)

Well, that's reassuring at any rate =).

> Well, not really for Java or Sun, but for JPython it is necessary to
> modify Java, probably.

Well ... it makes me wonder.  There are a few free java compilers out
there (jikes comes to mind immediately, as does Pizza) and I doubt
you'd get anywhere modifying the virtual machine.  Too many
implementations, too many platforms.  But if you could make a modified
compiler which added a few keywords and added continuations (maybe
*real* method pointers too?  hopehope? ^_^) to the language and
changed the way that stacks were managed *in bytecode compiled with
it*... in the same way that I assume stackless python can't affect
what C does to the stack, stackless java / jpython wouldn't be able to
affect what regular java did to the stack...

> Well, do you have an alternative idea where I should implant
> Stacklessness and continuations, with more feedback than
> in Python? Python is too small to find enough supporting people,
> I'd like to leave the small corner and get more publicity for
> this stuff, and a community to work on it. But where to go?

> Perl.
 erm ... no :-)

> Java.
>   Well, somewhat promising, since it gets so much hype and is
>   really used (although you're right, the reasons a weak).
>   But this stuff is again on the machine specific part, so I'd
>   have to do it for many VMs. And what is there for Windows???

Keep in mind that most Java VMs are commercial.  Unless you can make
your stacklessness compatible with the existing java bytecode
specification, you're unlikely to get anywhere.  (You're certainly not
going to get the code to Microsoft's VM) Also, I am guessing that the
problem of JITting in a stackless VM would be an interesting problem;
whereas if it's stackless bytecode it shouldn't matter.

Also; the hype that's used here is all about the "enterprise"
(whatever that is) and how Java is basically the new COBOL.
Continuations are a LISPish feature, and won't be appreciated, as far
as I can tell, by the ex-COBOL community now coming into Java.

> > Stay good, Chris, stay good
> 
> sigh...help...whatshouldIdo... ciao - chris

It seems to me like you've got a good thing going in the Python
community; but ... you need to convince Guido ;-)

The biggest problem I see with continuations (I've read all your
papers and whatnot) is that they're *hard*, and their usefulness is
not immediately apparent.  Microthreads are a good bonus, but I am
sure that I don't comprehend the true power and flexibility of
continuations (coroutines, etc).

If the average python programmer isn't bright enough to grok this
(I've seen some hintings along the lines that even *guido* isn't)
you're going to have a really hard time selling it to the Java
community at large; you certainly won't sway Sun's language-making
decisions.  Their language doesn't even do math right yet, and
practically noboyd cares (take a look at "How Java's Floating-Point
Hurts Everyone Everywhere",
http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf); they've got worse
problems than the fact that they use the C stack (sometimes).  Java
is, after all, money-oriented programming.  The average java
programmer isn't going to be interested in cool theoretical stuff;
whereas it seems that the average python programmer (once they're
integrated into the community) is.

So ... my advice, regardless of which language base you choose,
(keeping in mind that I am part of the *problem* here, not the
solution) is to try to come up with some effective marketing
... something like "How Continuations And Microthreads Are Useful To
Everyone"; attempting to explain in "layman's terms" what exactly it
is that's worthwhile about stacklessness, and why everyone savvy
enough to do so should be patching their Python 1.6 CVS trees and
keeping current to make sure that Guido can integrate it in 1.7.

I've read what you do have on the subject, and while it's certainly
interesting, I wouldn't call it compelling.

I can't really contribute, 'cause I don't "get it" yet; but if you
could impress this upon me somehow, or even give me pointers to
pre-existing documentation that might give me some enlightenment, I'd
gladly try to write something up for you.

(Joe Krasta, are you reading this?  You seem to get what's cool about
continuations just fine... maybe you could write something? ^_^)

-- 
                  __________________________________________
                 |    ______      __   __  _____  _     _   |
                 |   |  ____ |      \_/   |_____] |_____|   |
                 |   |_____| |_____  |    |       |     |   |
                 |   @ t w i s t e d m a t r i x  . c o m   |
                 |   http://www.twistedmatrix.com/~glyph/   |
                 `__________________________________________'




More information about the Python-list mailing list