From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 AC5F1BC88 for ; Mon, 7 Feb 2005 18:08:01 +0100 (CET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.204]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j17H80Es015684 for ; Mon, 7 Feb 2005 18:08:01 +0100 Received: by wproxy.gmail.com with SMTP id 69so790870wri for ; Mon, 07 Feb 2005 09:08:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=jMF9dAfZWEvm0iKdA/Ls8pzz2wg+PDl+qHkr41361XYYLNBxdVHC08SHN5/v+KALaSc5JVZsZA9BHVhH/XjDgUrHovliQPW1mDe9u9b0fMaLIR6ug4LuAd0j61maV/JrwwMt37JVpwgKFRsMCxQVYYyJskXIOLhIY3LKbdt2cWM= Received: by 10.54.48.33 with SMTP id v33mr3365wrv; Mon, 07 Feb 2005 09:08:00 -0800 (PST) Received: by 10.54.2.70 with HTTP; Mon, 7 Feb 2005 09:08:00 -0800 (PST) Message-ID: <891bd33905020709081e4fc18a@mail.gmail.com> Date: Mon, 7 Feb 2005 12:08:00 -0500 From: Yaron Minsky Reply-To: yminsky@cs.cornell.edu To: Jon Harrop Subject: Re: [Caml-list] OCaml expression evaluated in a OCaml program Cc: caml-list@yquem.inria.fr In-Reply-To: <200502071647.29407.jon@jdh30.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable References: <4207705F.4030501@nemoworld.info> <4207948D.6030705@yahoo.fr> <420793B9.3020504@neometsys.fr> <200502071647.29407.jon@jdh30.plus.com> X-Miltered: at concorde with ID 4207A070.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 caml-list:01 ocaml:01 ocaml:01 c--:01 wrote:01 wrote:01 runtime:01 toplevel:01 ocamlopt:01 marshalling:01 compiler:01 caml-list:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: There's also Lua-ML, which is used by the C-- project as an embedded scripting language. http://www.cminusminus.org/code.html#luaml On Mon, 7 Feb 2005 16:47:29 +0000, Jon Harrop wrote: > On Monday 07 February 2005 16:13, Nicolas Dufour wrote: > > sejourne_kevin wrote: > > > Nicolas Dufour a =E9crit : > > >> I try to know if I can evaluate OCaml expressions in a OCaml program > > >> during runtime ?? > > > > > > This is not possible. But you can try something with the toplevel: > > > http://caml.inria.fr/archives/200404/msg00282.html > > > > damned .. not possible ..... > > I hope it exists scriptic languages embedded in ocaml ... or i will hav= e > > to create one ... oh boy .... >=20 > I've done exactly this though, by spitting out an ocaml program, compilin= g it > with ocamlopt (linked against the running program) and invoking it using > marshalling to shuffle data back and forth. This is quite easy to impleme= nt > and is the simplest way to write a JIT compiler in ocaml. >=20 > If you don't really want to execute ocaml code but, rather, simple expres= sions > then you can write your own interpreter quite easily. Many tutorials cove= r > this. If you want to provide access to a few calls in your interpreter th= en > you can simply implement them in your own little language. There are many > tutorials on ocaml which describe simple interpreters. >=20 > -- > Dr Jon D Harrop, Flying Frog Consultancy Ltd. >=20 > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >