From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA04382; Tue, 16 Dec 2003 19:06:09 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA04297 for ; Tue, 16 Dec 2003 19:06:08 +0100 (MET) Received: from moby.atcorp.com (moby.atcorp.com [204.72.172.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hBGI66H21578 for ; Tue, 16 Dec 2003 19:06:07 +0100 (MET) Received: from SAILFISH (sailfish.atcorp.com [204.72.172.128]) by moby.atcorp.com (8.11.6/8.11.2) with SMTP id hBGI9oZ17519 for ; Tue, 16 Dec 2003 12:09:50 -0600 Received: by localhost with Microsoft MAPI; Tue, 16 Dec 2003 12:06:10 -0600 Message-ID: <01C3C3CC.FE467180.kmillikin@atcorp.com> From: "Kevin S. Millikin" Reply-To: "kmillikin@atcorp.com" To: "caml-list@inria.fr" Subject: RE: [Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml Date: Tue, 16 Dec 2003 12:06:09 -0600 Organization: ATC X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 python's:01 lisp's:01 c's:01 knowles:99 slower:01 avoiding:01 breath:01 bounded:01 invocation:01 pldi:01 specialists:99 952:99 829:99 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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