Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kevin S. Millikin <kmillikin@a...>
Subject: RE: [Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml
On Tuesday, December 16, 2003 9:42 AM, Kenneth Knowles 
[SMTP:kknowles@uclink.berkeley.edu] wrote:

> SML/NJ is a continuation-passing style compiler, so they are trivial.
> It is "possible, even in the presence of native compilation
> exceptions," but in a traditiional call stack compilation it requires
> some sort of stack copying, making them extremely inefficient.  (in
> SML/NJ every program is slower, while continuations have almost no
> penalty)

> There may be new tricks for avoiding copying of the whole stack, but 
I
> wouldn't hold your breath for continuations in ocaml.

You don't *have* to copy the stack on continuation capture, just mark 
the point where the continuation was captured and seal it off.  You do 
have to copy stack frames (but not the whole stack)---on continuation 
restore or upon stack segment underflow.

Programs that use continuations are (for the most part) the ones that 
pay the price, and they pay that (bounded) price upon continuation 
invocation or returning past a captured continuation.

For details on these new tricks, you can read Hieb, Dybvig, and 
Bruggeman's 1990 PLDI paper.

----
Kevin S. Millikin           Architecture Technology Corporation
Research Scientist          Specialists in Computer Architecture
(952)829-5864 x162          http://www.atcorp.com

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners