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_ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-12-12 (19:10)
From: Erik Arneson <erik@a...>
Subject: Re: [Caml-list] mod_ocaml
On 12 December 2002, Maxence Guesdon <> wrote:
> I've been told about a mod_ocaml for apache, available at
> I have not tested it, but I thought a lot of people might be interested.
> If some of you try it, can you tell us if it works ?

It works just fine!  It is a nice module for quick dynamic web pages,
like Mr Gushee pointed out, but I think there are a few changes that
could be made to make it safer and more robust for bigger applications.

First, it would be neat if there were a safer way to grab and validate
the query string.  A string replacement just doesn't work very well, and
it prints out an error if certain query string arguments aren't found,
so there's no easy way to just search for their existence.  There are
some OCaml modules out there to handle this, though, and I believe the
QUERY_STRING environment variable is still available for parsing.

Second, the OCaml interpreter is called every hit, which probably isn't
very scalable.  It would be really neat if the embedded OCaml page were
compiled to byte code and stored in memory somehow, so perhaps the OCaml
bytecode interpreter could only be called once.  Mod_perl does something
like this, and it seems to work very well.

The latter is a pretty big project, though.  I would have no idea where
to start, and I think mod_ocaml is a pretty neat beginning in any case!

;; Erik Arneson <>    AARG Net <> ;;
;; GPG Key ID: 2048R/8B4CBC9C           <> ;;
;; "Resistance to tyrants is obedience to God!" - Thomas Jefferson ;;

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