From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 4A6257EFCD for ; Fri, 31 Oct 2014 15:42:37 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=pra; client-ip=130.149.7.33; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=mailfrom; client-ip=130.149.7.33; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.tu-berlin.de) identity=helo; client-ip=130.149.7.33; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="postmaster@mail.tu-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEBAIifU1SClQchnGdsb2JhbABchDqDBtMGFgEBAQEBEQEBAQEBCAsJCRQuhCwPAUU2AgUWCwILAwIBAgFLDQYCAQEXiCamAI9ClSSBLZJhgVQFpWOQJAwtHoFba4JLAQEB X-IPAS-Result: AjEBAIifU1SClQchnGdsb2JhbABchDqDBtMGFgEBAQEBEQEBAQEBCAsJCRQuhCwPAUU2AgUWCwILAwIBAgFLDQYCAQEXiCamAI9ClSSBLZJhgVQFpWOQJAwtHoFba4JLAQEB X-IronPort-AV: E=Sophos;i="5.07,295,1413237600"; d="scan'208";a="85595819" Received: from mail.tu-berlin.de ([130.149.7.33]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Oct 2014 15:42:35 +0100 X-tubIT-Incoming-IP: 130.149.172.228 Received: from brego.uebb.tu-berlin.de ([130.149.172.228]) by mail.tu-berlin.de (exim-4.72/mailfrontend-5) with esmtpa for id 1XkDPN-0008IA-7P; Fri, 31 Oct 2014 15:42:34 +0100 Message-ID: <54539FD9.1050709@tu-berlin.de> Date: Fri, 31 Oct 2014 15:42:33 +0100 From: =?UTF-8?B?Q2hyaXN0b3BoIEjDtmdlcg==?= Organization: Technische =?UTF-8?B?VW5pdmVyc2l0w6R0IEJlcmxpbg==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: caml users Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: [Caml-list] is it possible to embed an OCaml interpreter into an OCaml Module? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dear all, I already asked this on stackoverflow and was pointed to compiler-libs.toplevel - indeed this API seems to be sufficient to run an OCaml interpreter from inside an OCaml program (as that seems to be what utop does). But ist it also possible in some way to embed that interpreter safely in an OCaml Module (so I can reuse it e.g. from within utop)? Currently, it seems that there is exactly one dedicated toplevel for every running bytecode interpreter and when running utop, it is already in use. So what I would need would be the ability to execute a phrase from within a call of execute_phrase. I already clonded the toploop module and for tehe time being I am fine with that. What I need is a way to a) safe the already set ('outer') toplevel value bindings b) restore the nested value bindings c) execute the compiled bytecode d) restore the 'outer' value bindings is there someone who can point me to a solution? - -- Christoph Höger Technische Universität Berlin Fakultät IV - Elektrotechnik und Informatik Übersetzerbau und Programmiersprachen Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin Tel.: +49 (30) 314-24890 E-Mail: christoph.hoeger@tu-berlin.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRTn9kACgkQhMBO4cVSGS97QwCfX59enOE89WWwvBu555V9LNM/ mCwAoLJ4PLkDlrLwA6A8OKzj8Elnpu0B =uWdx -----END PGP SIGNATURE-----