From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 9E96CBC69 for ; Sun, 22 Apr 2007 12:00:35 +0200 (CEST) Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3MA0ZPg020128 for ; Sun, 22 Apr 2007 12:00:35 +0200 Received: from [192.168.1.2] (che78-2-82-237-71-191.fbx.proxad.net [82.237.71.191]) by smtp6-g19.free.fr (Postfix) with ESMTP id 011386D4A5; Sun, 22 Apr 2007 12:00:34 +0200 (CEST) Message-ID: <462B3242.3040408@inria.fr> Date: Sun, 22 Apr 2007 12:00:34 +0200 From: Xavier Leroy User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Harrison, John R" Cc: OCaml Subject: Re: [Caml-list] Saving the OCaml interpreter state References: <509223F0BF55E74FA1247D17207E7A0C014E5063@orsmsx419.amr.corp.intel.com> In-Reply-To: <509223F0BF55E74FA1247D17207E7A0C014E5063@orsmsx419.amr.corp.intel.com> X-Enigmail-Version: 0.91.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 462B3243.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 sml:01 bindings:01 ocaml:01 trivial:01 gerd:01 stolpmann:01 toplevel:01 non-trivial:01 non-trivial:01 toplevel:01 caml-list:01 lisp:01 fragments:01 loops:02 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), its 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