This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: guile-vm-0.0



I guess I was too terse, sorry.  I was thinking about cheap
continuations, tail calls and support for multi threading.


Keisuke Nishida <kxn30@po.cwru.edu> writes:

> After execution is done and the stack is cleared [...]

And if not?  How do you map the scheme execution model onto a stack
centric execution model?  For example:

(define cont 0)
(define (thunk)
  (call-with-current-continuation 
   (lambda (kont)
     (set! cont kont)))
  (thunk2))

(define (thunk2) (cont 1))

If you execute that, the stack will grow and grow because those $n$
thunk2's never return and thunk keeps creating new thunk2's on the
stack.

And what about multithreading? I think you'll have to copy the whole
stack.


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.


I think a quick fix would be to allocate frames on the
heap and link them together.  Of course, solutions 2--5 
will be slower than solution 1 but will they be much slower?
I think a slowdown up to factor 2 would be acceptable.


Jost


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]