Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Lamda expressions and a caml interpreter
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-03-12 (16:19)
From: Alex Baretta <alex@b...>
Subject: [Caml-list] Lamda expressions and a caml interpreter
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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: