From: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
To: Ceri Storey <cez@mrtall.compsoc.man.ac.uk>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Continuations
Date: Wed, 11 Dec 2002 10:19:14 +0100 [thread overview]
Message-ID: <3DF70312.9090308@univ-savoie.fr> (raw)
In-Reply-To: <20021210184936.GA9279@mrtall.compsoc.man.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]
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
---------------------------------------------
[-- Attachment #2: Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2002-12-11 9:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-10 18:49 Ceri Storey
2002-12-11 1:43 ` [Caml-list] Site down Eric Merritt
2002-12-11 9:19 ` Christophe Raffalli [this message]
2002-12-12 5:51 ` [Caml-list] Re: Continuations Michaël Grünewald
2002-12-15 17:06 ` [Caml-list] Continuations: an implementation Christophe Raffalli
2004-08-13 21:27 [Caml-list] Continuations Sébastien Hinderer
2004-08-16 9:46 ` Keith Wansbrough
2004-08-23 22:32 ` Nathaniel Gray
2004-08-24 6:47 ` skaller
2004-08-24 22:18 ` Nathaniel Gray
2004-08-25 11:13 ` skaller
2006-08-30 15:24 Continuations Tom
2006-08-30 17:08 ` [Caml-list] Continuations Jacques Carette
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DF70312.9090308@univ-savoie.fr \
--to=christophe.raffalli@univ-savoie.fr \
--cc=caml-list@inria.fr \
--cc=cez@mrtall.compsoc.man.ac.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox