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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 7DA96BC6B for ; Wed, 12 Dec 2007 23:52:08 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFj1X0fC2fJXnmdsb2JhbACPbQEBAQEHBAYp X-IronPort-AV: E=Sophos;i="4.24,158,1196636400"; d="scan'208";a="5580758" Received: from anchor-post-37.mail.demon.net ([194.217.242.87]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Dec 2007 23:52:07 +0100 Received: from orion.metastack.com ([80.177.38.218]) by anchor-post-37.mail.demon.net with esmtp (Exim 4.68) id 1J2aQw-00033Y-PK for caml-list@yquem.inria.fr; Wed, 12 Dec 2007 22:52:07 +0000 Received: from countertenor (cpc3-cmbg6-0-0-cust100.cmbg.cable.ntl.com [81.101.140.101]) (authenticated bits=0) by orion.metastack.com (8.13.4/8.13.3) with ESMTP id lBCMhene018564 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 12 Dec 2007 22:43:41 GMT From: "David Allsopp" To: References: <11708011a623.11a623117080@osu.edu> Subject: RE: [Caml-list] OCaml as an application scripting language (like Guile)? Date: Wed, 12 Dec 2007 22:52:03 -0000 Organization: MetaStack Solutions Ltd. Message-ID: <005201c83d11$9d6d8d40$6c7ba8c0@countertenor> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: Acg9DakLSJ5I3WCsTKS07s87I+7wyQAAn6Cg In-Reply-To: <11708011a623.11a623117080@osu.edu> X-Scanned-By: MIMEDefang 2.63 on 172.16.28.218 X-Spam: no; 0.00; ocaml:01 bytecode:01 compiler:01 bytecode:01 toplevel:01 topmain:01 ocaml:01 compiler:01 runtime:01 threads:01 wrote:01 exception:01 caml-list:01 linking:02 linking:02 Jan Ober wrote: > I had a hard time finding how one would go about getting the > bytecode compiler and bytecode interpreter integrated > in a library-like fashion. toplevel/topmain.ml and driver/main.ml in the OCaml sources are both pretty good start-points to show how the compiler and runtime work. Section 18.7.4 of the manual explains embedding OCaml code within a C(++) library (and there have been various threads in the past on this list on the subject). I have no idea (though would be interested to know) what the licensing aspects of doing that would be... I had a brief look at the code a few months ago for another project and reckoned that there'd be no need to alter any of the OCaml source files, but I don't know whether the linking exception in the licence for OCaml extends to linking the compiler into an application! David