[concurrency-interest] thoughts about stackless languages?

Dhanji R. Prasanna dhanji at gmail.com
Sun Jul 16 21:37:21 EDT 2006


On 7/17/06, Joe Bowbeer <joe.bowbeer at gmail.com> wrote:
> On 7/16/06, Peter Veentjer <alarmnummer at gmail.com> wrote:
> > classic multithreaded approach. What are the opinions about adding
> > stackless functionality to the java vm? Is it possible? Is it
> > desirable? Is it overrated?
> >
>

lazy evaluation in java would be great! You could work with infinitely
sized lists or arrays and not worry about memory issues.

Im really not sure how mutable states or scoped states are achieved in
a stackless machine, but I would assume they are "faked" (with
continuations as joe suggested). Python achieves this to a certain
extent even in its stackful version with the "yield" keyword.
But a zero-side effect paradigm, I feel, is at odds with the
imperative and OO bent of java.

Consider that a stackless machine also makes iteration difficult,
which is why looping is  faked with tail-recursion in languages like
haskell.

As for asynchronous programming, I think that can be achieved much
more naturally in java with the use of selectors (as is done in
java.nio). You're still a multithreaded language under the hood, but
it is an elegant solution.


More information about the Concurrency-interest mailing list