5 ms·
Ouch, pretty harsh. Any OCaml fans around want to counter some of those complaints? Are these things that don't bother most programmers, or can be avoided by pr
by camccann 17y ago
Ouch, pretty harsh. Any OCaml fans around want to counter some of those complaints? Are these things that don't bother most programmers, or can be avoided by proper idiomatic code?
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...
- marketer 17y agoI used to be a huge user and advocate of ocaml, but the language is heavily constrained by the standard library, and the maintainers come from a pure research background so they aren't inclined to make it more practical. For instance, there's no packages for http, json, or xml in the standard library.
- PieSquared 17y agoErgh! Sure, some of these things are true, but some just reek of a stubborn refusal to do things the way the language intends for them to be done. 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.)
- noste 17y ago"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." 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/Control-Exception.html#v:bracket http://haskell.org/ghc/docs/latest/html/libraries/base/Contr...)
- DanielBMarkham 17y agoFWIW, F# has "using". Between "using" and IDispose, you've got all the resource-unlocking, unwinding, and rollbacks you'd ever want. 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)
- nearestneighbor 17y agoYou can implement your own unwind-protect: http://caml.inria.fr/pub/ml-archives/caml-list/2003/07/5ff669a9d2be35ec585b536e2e0fc7ca.en.html http://caml.inria.fr/pub/ml-archives/caml-list/2003/07/5ff66...
- nearestneighbor 17y agoI'm a fan, but I mostly use C++ and Python these days. My counter to the complaints is that I could make a longer list of things that suck about any language out there.