From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA03078; Fri, 25 Jul 2003 11:10:58 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA21176 for ; Fri, 25 Jul 2003 11:10:57 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6P9Arf10121; Fri, 25 Jul 2003 11:10:53 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA12155; Fri, 25 Jul 2003 11:10:52 +0200 (MET DST) Date: Fri, 25 Jul 2003 11:10:52 +0200 From: Xavier Leroy To: Lukasz Stafiniak Cc: caml-list@inria.fr Subject: Re: [Caml-list] Caml Machine and GP Message-ID: <20030725111052.B31893@pauillac.inria.fr> References: <008201c3514d$b88d3760$50ef4dd5@ppp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <008201c3514d$b88d3760$50ef4dd5@ppp>; from l_stafiniak@hoga.pl on Wed, Jul 23, 2003 at 08:53:11PM +0200 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 pretty-print:01 ocamlc:01 dynamically:01 dynlink:01 principled:01 metaocaml:01 invoke:01 compiler:01 ocaml:01 caml:01 approaches:01 bytecode:01 command:98 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I work on genetic programming with typed terms. I would like to use > OCaml bytecode-system to run my programs. If I understand correctly your needs, there are two approaches that don't involve hacking the OCaml system to death: 1- The pedestrian approach: pretty-print your programs in OCaml syntax to a file, invoke the "ocamlc" compiler with Sys.command, then dynamically load the compiled bytecode using the Dynlink library. 2- The principled approach: have a look at MetaOCaml (http://www.cs.rice.edu/~taha/MetaOCaml/), which provides clean mechanisms for meta-programming in Caml, i.e. manipulating and executing Caml code from within Caml programs. Hope this helps, - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners