This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: continuation and multi-threading
- To: guile at sourceware dot cygnus dot com
- Subject: Re: continuation and multi-threading
- From: Jed Davis <jldavis at cs dot oberlin dot edu>
- Date: Mon, 31 Jul 2000 16:37:15 -0400
- cc: Keisuke Nishida <kxn30 at po dot cwru dot edu>
--On Monday, 31 July 2000 4:10 PM -0400 Keisuke Nishida <kxn30@po.cwru.edu>
wrote:
> Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE> writes:
>
[cheap continuations, tail calls, and support for multithreading]
>> AFAIK there are only 5 solutions for this problem:
>>
>> 1. Drop call/cc and threads and keep the stack centric model
>> 2. Use special markers and copy the stack when necessary
>> 3. Use stack segments
>> 4. "The stack is the heap"; Henry Baker's "Cheney on the M.T.A"
>> (we'll need a copying gc to implement that though)
>> 5. Put all frames on the heap.
>
> Is there any problem with dropping call/cc? I've heard continuation
> is not indispensable if we have a good exception handling and
> multi-threading support. Must we support it?
>
> The other day someone said that continuation is helpful to write
> translators, but hey, we have a VM. One may add any necessary
> instructions to write a compiler. I don't see any reason why
> continuation is so important.
>
> I think Guile is supposed to be a language for programmers, not for
> scientists. Guile must be a useful Scheme implementation before
> being a perfect Scheme implementation. There are lots of good
> Scheme implementations already, so we don't need to reinvent it.
> I want to write something practically very useful, not something
> academically interesting. (I am (supposed be) a scientist, too,
> but..)
>
> I think we can write a useful language without having continuation.
> If supporting continuation is so hard, I would choose to drop it.
> I don't expect Guile to tackle so hard problems.
My vote is for implementing continuations as stack copies; I think this is
how things are done currently, and it should be fairly simple, although
expensive in terms of runtime. For multiple threads things get a bit more
complicated, since a copy of one thread's stack could be copied onto the
stack of a different thread. Cheap continuations would certainly be nice
but I don't see how this would be possible for Guile; fortunately
continuation cheapness isn't IMHO very important for what is primarily an
extension/scripting language.
--Jed