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
Dynamic loading. Again.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fabrice Le Fessant <fabrice.le_fessant@i...>
Subject: Re: Dynamic loading. Again.

Last year, Mark Hayden and I did some work on dynamic linking of
native code for Linux. It worked, with few modifications in the
compiler to generate relocatable code in the ELF format, but the code
was really big (something like twice the normal size) and really slow
(about twice slower). It was for ocaml 2.??, but it should probably
work with a few changes for the current version. If you want the
patch, I will try to find it in my archives. It was a few days work,
so we dit not optimize it as it should be, but it can be used as a
start point.

If you are only interested with linking some code -- not time
critical --, you can try the dynlink library which is included in the efuns
package ( It will allow you to
dynamically link BYTECODE modules inside NATIVE code programs. These
modules will be executed slower than the native code, and even slower
than the bytecode run by ocamlrun, but they will use native functions
for all functions which were included in the program, so that it would
be good to execute powerful configuration scripts, or computation


- Fabrice