Jpython and continuations

Tim Peters tim_one at email.msn.com
Wed Feb 16 22:46:14 EST 2000


[Tim]
> Discussions on this stretched over many months last year,
> beginning in about May.  Guido developed a nearly complete
> implementation plan for generators in the "Generator details"
> thread of July '99, in the Python-Dev archives.

[Paul Prescod]
> One thing to consider is what of this can be easily added to
> JPython.  I'm a little leery about continuations because JPython
> uses the Java stack, doesn't it? It does have a concept of a
> Python frame but the "instruction pointer" is implicit in
> the JVM, not explicit in an interpreter loop.

+ All attempts I'm aware of to implement Scheme on a JVM gave up on full
continuations (anyone know of an exception?).

+ Generators can be implemented via much more conventional means than can
continuations (continuations are merely *an* implementation technique for
generators; generators can be implemented in many ways -- they're more of a
variant of "regular calls", and, in particular, generator control flow is
stack-like).

+ JPython is to CPython as Jcon is to Icon.  Icon (ditto Jcon) doesn't have
continuations, but makes extremely heavy use of generators and light use of
coroutines.  The Jcon port implements both.  A good tech report on the Jcon
implementation can be gotten from a link near the bottom of:

    http://www.cs.arizona.edu/icon/jcon/index.htm

Coroutines in Jcon are implemented on top of Java threads (my own ancient
implementation of coroutines via raw Python threads has been referenced
enough here recently <wink>).  Generators are implemented directly in Jcon,
but do seem to be more of a pain than in Icon's C implementation.

not-especially-inclined-to-let-the-limitations-of-the-jvm-
    limit-languages-other-than-java-ly y'rs  - tim






More information about the Python-list mailing list