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 TAA28221; Thu, 8 Apr 2004 19:26:34 +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 TAA28194 for ; Thu, 8 Apr 2004 19:26:33 +0200 (MET DST) Received: from host1.stonesfair.com (host1.stonesfair.com [208.184.191.145]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i38HQVYM017877 for ; Thu, 8 Apr 2004 19:26:32 +0200 Received: from mev (63-217-154-71.greystoneapts.com [63.217.154.71]) by host1.stonesfair.com (8.12.8/8.12.8) with ESMTP id i38H9KdP001778 for ; Thu, 8 Apr 2004 10:09:20 -0700 Received: from ijtrotts by mev with local (Exim 3.35 #1 (Debian)) id 1BBdHR-0003bT-00 for ; Thu, 08 Apr 2004 10:25:33 -0700 Date: Thu, 8 Apr 2004 10:25:33 -0700 To: caml-list@inria.fr Subject: Re: [Caml-list] Dynamically evaluating OCaml code Message-ID: <20040408172533.GA13798@mev> Mail-Followup-To: ijtrotts@ucdavis.edu, caml-list@inria.fr References: <20020104004356.GA1672@mev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i From: Issac Trotts X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 dynamically:01 issac:01 trotts:01 ijtrotts:01 2004:99 issac:01 trotts:01 lacking:01 ocaml's:01 inference:01 python:01 'eval':01 3.07:01 ocamlc:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 166 On Thu, Apr 08, 2004 at 01:24:45AM -0500, Brian Hurt wrote: > On Thu, 3 Jan 2002, Issac Trotts wrote: > > > That being so, how would you use OCaml as an extension language for a C > > program? > > > > I would use C as an extension language for Ocaml. > > This isn't meant to be a snarky answer. Ocaml is an applications > language- you should write the bulk of the code in Ocaml, and drop to C in > places where you need to. If you're looking for a language to embed, you > might try looking at one designed to be embeeded, like Lua. Or a Lisp > variant. But that isn't what Ocaml is designed for. It may still be good for it even if it wasn't designed for it. At any rate, it bothers me to write code in languages lacking OCaml's type safety. Maybe the solution is to graft Hindley-Milner type inference onto Scheme or Python. Some people at CMU did something like this with R4RS Scheme, but I don't know if they released the code. > Nor would it be a good language for that. Consider the complexity of the > Ocaml 'eval' function. On my system (Redhat 9, x86, Ocaml 3.07) Ocamlc is > 920K in size, and ocamlrun another 144K. You'd have to replicate the > majority of that in the eval function- so you're talking north of a > megabyte of code. As an application, that's small. As a library, that's > huge. It's of the same size as linking in libgtk (1.3M). No, you want a > small, simple language. Although this might not be so bad- libperl.so on > my machine weighs in at 3.2M. If I didn't know about OCaml I would say you are right, but OCaml is robust and easy to modify (hence its complexity is not such a problem for me), and easy on system resources (hence its code size is not such a problem for me either). So I would be very happy if I could use OCaml to do experimental, bottom-up programming within a graphical environment constructed in C. -- Issac Trotts http://mallorn.ucdavis.edu/~ijtrotts (w) 530-757-8789 ------------------- 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