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 KAA31880; Wed, 11 Dec 2002 10:22:43 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA32451 for caml-list@pauillac.inria.fr; Wed, 11 Dec 2002 10:22:42 +0100 (MET) 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 KAA31603 for ; Wed, 11 Dec 2002 10:18:41 +0100 (MET) Received: from julie.univ-savoie.fr (univax.univ-savoie.fr [193.48.120.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gBB9IeX04757 for ; Wed, 11 Dec 2002 10:18:40 +0100 (MET) Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by julie.univ-savoie.fr (8.9.3/jtpda-5.3.3) with ESMTP id KAA16718 ; Wed, 11 Dec 2002 10:19:06 +0100 (CET) Received: from univ-savoie.fr (d85.lama.univ-savoie.fr [193.48.123.85]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id gBB9J2VH016473 ; Wed, 11 Dec 2002 10:19:02 +0100 Message-ID: <3DF70312.9090308@univ-savoie.fr> Date: Wed, 11 Dec 2002 10:19:14 +0100 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ceri Storey CC: caml-list@inria.fr Subject: Re: [Caml-list] Continuations References: <20021210184936.GA9279@mrtall.compsoc.man.ac.uk> X-Enigmail-Version: 0.65.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig42396DFF6C64684597ACF033" Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig42396DFF6C64684597ACF033 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Ceri Storey wrote: > I was just wondering if there any possibility of there being support > for continuations in a future version of ocaml? > > They'd be useful in all sorts of situations, eg: restarable network > protocol parsers, or co-routines. Continuations are nice ... but they need to save all the stack. This can be done in a reasonable way by saving only one page (or two if the first one is almost empty) of the stack and marking the other pages as unwritable and saving the next pages only when needed but: - This is not portable to all platforms (windows may be OK ?). - Intensive use of continuations are still time consuming. - Saving all the stack leads to important memory leaks because in general only some of the information in the stack are necessary to call the continuation and the other leads to useless pointer kept for the GC. It is in general better to implement yourself the bactracking you need by keeping a minimal record containing the information you need to backtrack and adding one argument (with such a list of records) to all the functions that may trigger backtracking. But, still, if you program well, and you know about the possible memory leaks, you can program with continuations and it is a pity they are not there in OCaml :-( Especialy for those (like me) who extract programs from classical proofs :-) -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature --------------------------------------------- --------------enig42396DFF6C64684597ACF033 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE99wMSSQDyWB/+xBwRAtwTAJ9EZEgGuQhcvSB3uvBnfF1bX0krUQCgz5g4 En0nFX+0uNcCnljOZUJgBYQ= =+GYv -----END PGP SIGNATURE----- --------------enig42396DFF6C64684597ACF033-- ------------------- 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