Objective CAML sure is strange. I know I shouldn't be
distracting myself with new stuff while involved in a
project that could actually become something else than just
a cob-webbed module in my local CVS repository, but I can't
help it :-)
As a plus, I now understand why so many people cringe in
horror at OCAML's type system -- it's pretty much everything
I've been looking to get away from in its almost Pascal-ish
typing. For example, the separate +-*/ operators for
integers and floating-point numbers. Helloooooo? What's the
freaking point here? I shouldn't have to rewrite the same
function if I want to do the same basic steps for
floating-point numbers. Or complex numbers. Or any numeric
type that has the required operators.
From my first impression with OCAML, I would say that it
is as close to a bondage-and-discipline language as
functional programming is going to get. This isn't
necessarily a bad thing (I'm sure that Pascal is one of
the more used languages, counting the 667 dialects), but I'd
be glad if the language picked up some polymorphism at some
point... The static typing probably allows for some
bitchin' optimizations by the compiler, though.
Like someone (can't remember who) somewhere once said,
LISP (probably also other dynamically typed languages) is
good for building organic, ever-changing systems while
statically typed languages are good for building pyramids,
where you'd better have a precise floorplan before you even
start building unless you want to tear down half of what
you have built merely because you chose the wrong kind of
mortar. Not that tearing down and reimplementing (aka
refactoring, like the OO-correct like to call it)
isn't a good thing some of the time -- I'm just not sure if
the language design should enforce it.