mod_caml Comes Of Age
Richard W.M. Jones writes "mod_caml is a set of bindings between Objective Caml and the full Apache API. mod_caml 0.6 has bindings for the Apache API and a full Perl-like CGI and templating library. There's only two things you need to know about Objective Caml: it's a modern, fully-featured and highly-optimised language, and it has a good tutorial so Perl/Java/C/C++ programmers can join in the fun."
> Since CAML is a functional language, it's probably more productive to compare it with other functional languages than with more familiar procedural languages.
Actually no, it's worth comparing against imperative languages, because caml has those features as well, like fully mutable variables (believe it or not, it's not something you take for granted in the FP world -- erlang's variables are set-once, and haskell has only bindings aside from monad 'do' blocks).
Ocaml does have several annoying features though:
* No machine types. You cannot express an unsigned 32 bit int in ocaml. This would make writing an IP4 stack in ocaml somewhat onerous. Similarly, there's no "raw" struct types you can finely pack.
* No overloading at all. To implement the actual nuts and bolts of polymorphism, where the types diverge, you either have to use separate classes or pass along type information explicitly, something like a C++ traits object. Somewhat more palatable with closures, but the monomorphism restriction will then bite you in the ass. Modules are suggested as another mechanism, but I've yet to see actual code that makes them look anything like ad hoc polymorphism.
* Supremely stupid compiler feedback. My favorite is "the expression is of type foo but is used here with type foo". Perhaps a warning about redefined types would have been handy?
* Syntax gets uuuuuuugly when using polymorphic types and labels. Objective Labl has been in ocaml for years, but still feels bolted on.
Personally, I want haskell and ocaml to get together and have a baby, but that's probably asking too much...
I've finally had it: until slashdot gets article moderation, I am not coming back.