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 KAA19984; Mon, 8 Mar 2004 10:11:43 +0100 (MET) 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 KAA20661 for ; Mon, 8 Mar 2004 10:11:40 +0100 (MET) Received: from pop19.ucdavis.edu (pop19.ucdavis.edu [169.237.105.29]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i289BcV7028338 for ; Mon, 8 Mar 2004 10:11:39 +0100 Received: from manzanita ([128.120.141.214]) by pop19.ucdavis.edu (8.12.10/8.12.9/it-std-5.2.0) with SMTP id i289Bbj5022932 for ; Mon, 8 Mar 2004 01:11:37 -0800 (PST) Received: by manzanita (sSMTP sendmail emulation); Mon, 8 Mar 2004 01:11:28 -0800 From: "Issac Trotts" Date: Mon, 8 Mar 2004 01:11:28 -0800 To: caml-list@inria.fr Subject: [Caml-list] Announce: Nativize 0.1 Message-ID: <20040308091128.GA4026@manzanita> Mail-Followup-To: ijtrotts@ucdavis.edu, caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i 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; issac:01 trotts:01 ijtrotts:01 redwood:99 issac:01 0.1.:01 serialized:01 ocaml's:01 usr:01 3.07:01 trotts:01 redwood:99 cmo:01 cmo:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 73 Nativize : Compile and run native functions from the toplevel. http://redwood.ucdavis.edu/~issac/software/nativize-0.1.tar.gz Introduction ============ It is useful to be able to easily run native code from the toplevel. Nativize makes this possible for functions whose arguments and return values can be serialized using the functions in OCaml's Marshal module. Example: running Ackermann's function in the toplevel ===================================================== # #require "nativize";; Loading /usr/lib/ocaml/3.07/nativize/nativize.cma # Nativize.nativize "Ack1" " let rec ack m n = if m = 0 then n + 1 else if n = 0 then ack (m - 1) 1 else ack (m - 1) (ack m (n - 1));; " [];; Please type #load "Ack1.cmo";; - : unit = () # #load "Ack1.cmo";; # assert(Ack1.ack 5 0 = 65533);; (* Wait about 10 seconds. *) - : unit = () # let rec ack m n = if m = 0 then n + 1 else if n = 0 then ack (m - 1) 1 else ack (m - 1) (ack m (n - 1));; # ack 5 0;; (* Wait a good while longer. *) -- Issac Trotts http://redwood.ucdavis.edu/~issac ------------------- 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