I've heard good things about OCaml elsewhere, but my experience with functional languages is limited to a bit of Scheme and Haskell. I've thought about trying out OCaml but this makes me possibly want to reconsider...
I've heard good things about OCaml elsewhere, but my experience with functional languages is limited to a bit of Scheme and Haskell. I've thought about trying out OCaml but this makes me possibly want to reconsider...
Note how instead of saying, "Ocaml doesn't have with-open-file or unwind-protect", he says, "Here's how you have to do with-open-file and unwind-protect in Ocaml". No! You do not go around trying to turn other languages into Lisp if you want to code in Lisp. If you want to code in Lisp, you code in Lisp.
Similarly, he just dismisses the syntax as "pretty much unreadable". Bollocks. The language syntax is fine. Sure, it's different from what most people are used to, unless said people have used SML or Haskell. But it's a decent synatx - yes, with it's own quirks and problems - which is most certainly not "unreadable".
"No Polymorphism; Cannot add an int to a float - need an explicit cast" - what he means to say is that it's a very strong-typed language. If you use the "O" part of "Ocaml" (Objective Caml", polymorphism exists and works.
Now, a lot of his points are valid, like the one about the standard library. But in general, I feel that he really discredits himself by his persistence in writing Lisp code in Ocaml. When in Rome, do as the Romans do.
(Disclaimer: I've used Ocaml, but not to any grand extend. Maybe 10,000 lines of code written in it. Paradigm-wise, I'd have to say I might prefer Lisp, although I find that CL is slightly annoying often times.)
What would be the OCaml solution for the problem that unwind-protect solves? In Haskell, I would use bracket, and appropriately the API documentation of bracket gives the definition of withFile as an example:
withFile name mode = bracket (openFile name mode) hClose
(see http://haskell.org/ghc/docs/latest/html/libraries/base/Contr...)I think this article makes it very clear how having a huge existing set of libraries can really put a language into warp drive, whereas not having one means you are going to spend some time re-inventing the wheel. (But even in straight Ocaml, I fail to see the problem)
http://caml.inria.fr/pub/ml-archives/caml-list/2003/07/5ff66...
For instance, there's no packages for http, json, or xml in the standard library.