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] mod_caml's bytecode restriction due to Apache or just CGI dyn'linking?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-21 (04:47)
From: Basile Starynkevitch [local] <basile.starynkevitch@i...>
Subject: Re: [Caml-list] mod_caml's bytecode restriction due to Apache or just CGI dyn'linking?
On Sun, Jun 20, 2004 at 11:38:32PM +0200, James Leifer wrote:

> I had a question about mod_caml's design.  I understand from the web
> page that confining CGIs to bytecode isn't particularly onereous. [...]
> Yet for some applications, native would be useful.  For example, for
> read-only data that changes only a few times a day, one can pack it in
> Ocaml hash tables and get high perfomance queries right in Ocaml.  In
> such a setup where Ocaml handles both the page layout *and* the
> functionality of a db, native code looks a lot more attractive.
> So... Is the limitation to use bytecode due to the desire to support
> *dynamic* linking of CGIs or for other reasons?  [...]

Sorry for the shameless plug - but I think that ocamljit can be used
to accelerate a bit such Ocaml propulsed web pages.

The GNUmakefile of ocamljit not only build the ocamljitrun executable
(a replacement for ocamlrun), but also a libcamljitrun.a which should
be a replacement for libcamlrun.a and hence might be useable (at least
on x86/linux) with mod_caml.

I suppose that mod_caml don't fork a process for every HTTP request
(in contrast to a pure CGI approach). This is particularily
appropriate for ocamljit since the overhead of bytecode to native
machine code translation is much less relevant here. (On pure CGI
short runs with ocamljitrun the translation time might be significant
- a few tenths of seconds for a "big" bytecode file).

Feel free to ask me about any practical problems of using ocamljit
with mod_caml (I didn't try, but believe it should be trivial).

Ocamljit is available on and requires a recent
(ie CVS or future 3.08) ocaml system (source tree with built stuff)

Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr
Project - (temporarily) --- all opinions are only mine 

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