caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: "Harrison, John R" <john.r.harrison@intel.com>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Saving the OCaml interpreter state
Date: Sun, 22 Apr 2007 12:00:34 +0200	[thread overview]
Message-ID: <462B3242.3040408@inria.fr> (raw)
In-Reply-To: <509223F0BF55E74FA1247D17207E7A0C014E5063@orsmsx419.amr.corp.intel.com>

Sorry for the late answer, I'm catching up with this list.

> In several read-eval-print loops for functional languages
> (e.g. Poly, SML/NJ, various LISPs), it\x19s possible to save and
> restore the current state so you can start up again in an
> environment with all the same objects and name bindings
> present. OCaml does not currently allow this. How hard would it be
> to modify OCaml to support save/restore of sessions?

Definitely not trivial.  In addition to the general problem with
external libraries mentioned by Gerd Stolpmann, there is a more
Caml-specific problem: code fragments generated by the toplevel reside
in many different blocks, which is something that the Caml marshaller
doesn't support.  There would be a lot of non-trivial code relocation
work to perform.

> More specifically, I want to
> know whether the facility to save and restore state doesn't exist
> because
> * None of the main OCaml developers particularly care about it
> or
> * There are non-trivial technical problems implementing it.

Both :-)  There are technical problems, and you are the only user who
expressed a strong desire for this feature.  Personally, it brings
back bad memories of early Lisp and ML implementations where saving
the state of the toplevel loop was the only way to build executable
programs.

Regards,

- Xavier Leroy


      parent reply	other threads:[~2007-04-22 10:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10 22:08 Harrison, John R
2007-04-12 12:27 ` [Caml-list] " Michael Nedzelsky
2007-04-12 15:53   ` Harrison, John R
2007-04-12 18:27     ` Jon Harrop
2007-04-12 23:52       ` Yaron Minsky
2007-04-13 19:07         ` Harrison, John R
2007-04-13 19:38           ` Gerd Stolpmann
2007-04-13 20:27             ` Daniel Bünzli
2007-04-14 11:59           ` Michael Nedzelsky
2007-04-22 10:00 ` Xavier Leroy [this message]

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=462B3242.3040408@inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=john.r.harrison@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).