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 RAA16520; Fri, 12 Mar 2004 17:19:18 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA16467 for ; Fri, 12 Mar 2004 17:19:14 +0100 (MET) Received: from alex.baretta.com ([213.255.109.130]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2CGJXKW026739 for ; Fri, 12 Mar 2004 17:19:35 +0100 Received: from baretta.com (localhost.localdomain [127.0.0.1]) by alex.baretta.com (8.12.8/8.12.8) with ESMTP id i2CGJhRV004287 for ; Fri, 12 Mar 2004 17:19:44 +0100 Message-ID: <4051E31F.8000806@baretta.com> Date: Fri, 12 Mar 2004 17:19:43 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ocaml Subject: [Caml-list] Lamda expressions and a caml interpreter Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; baretta:01 baretta:01 dynamically:01 compiles:01 incompatible:01 ocamlopt:01 possibile:99 implemented:01 linked:01 ocaml:01 caml:01 caml:01 garbage:01 alex:01 alex:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 119 Dear Caml breeders, I am facing a big memory leak in a program which dynamically generates, compiles and links code by taking advantage of the toplevel library. Unfortunately, this approach to dynamic programming has two problems: it is incompatible with a native code compilation of the main program, which otherwise could take advantage of the speed benefits of ocamlopt, and a memory leak due to the impossibility of unlinking bytecode modules. The latter problem is the major one. I believe one possibile solution would be to compile the generated ocaml code halfway only, up to a lambda expression, and apply an interpreter function to it. Such a function could probably also be implemented in a native code program. Also, lambda expressions do not constitute linked code but data structures, so they would be garbage collected as soon as no closure refers to them. I wonder if such an interpreter exists. If it does not exist, it might be a worthwhile task to implement one (at least for me). Could anyone point me to some reference material on this matter? Thank you very much. Alex ------------------- 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