5 ms·
I'm studying this language right now at a french school, with INRIA researcher. And, well... I'm not really satisfied with it. OCaml produces a small amount of
by lesterpig 11y ago
I'm studying this language right now at a french school, with INRIA researcher.
And, well... I'm not really satisfied with it. OCaml produces a small amount of code, but is really slow and hard to understand. Sometimes, it looks like obfuscated code!
Documentation and libraries are not polished, and I would recommend Haskell instead of OCaml. Good for research and some algorithms, bad for applications.
And... God... "This page was last updated on 17 June 2006."
- superboum 11y agoSame feeling, and why are they ignoring EVERY programming convention ? One more thing I really hate is there are many way to the same basic thing, ie. declaring a new function or doing a pattern matching. Finally, standard libraries are not well named (List.split will not do what you think) nor easy to use (List.last ? Nope !).
- FraaJad 11y agoThere are two things here: 1. "unfamiliar" syntax. Well... It is unfamiliar if your first exposure to programming stopped at Java. Guess what .. pattern matching is quite an old convention in programming languages old (Prolog, Erlang, ML, Haskell)... and new (Rust, Swift).. 2. Standard libraries are a crap shoot... cruft accumulates in standard libraries just like any piece of software but harder to clean up owing to demands of backward compatibility. Just go and look at Python standard library. Even on a superficial level, the stdlib is a mix of CamelCase and under_score .. which can be irritating. OCaml is not unique in this regard.
- implicit 11y agoThis is very consistently my biggest problem with OCaml: it just doesn't follow conventions set in other ecosystems. I predict this is the sole reason it could never be "the next Java." It's worth noting, however, that I've had very, very few problems with the semantic properties of the language. I think the slog is worth it for that reason.
- rbehrends 11y ago> This is very consistently my biggest problem with OCaml: it just doesn't follow conventions set in other ecosystems. Well, the reason is that Caml predates those ecosystems; the original Caml was released nearly a decade before Java [1], and ML itself dates back to the 1970s. [1] http://caml.inria.fr/about/history.en.html http://caml.inria.fr/about/history.en.html
- implicit 11y agoRight. I mean only to say that OCaml's superficial strangeness is regrettably offputting. Talk of syntax is almost always history and religion, not science.
- CHY872 11y agoThere is zero need for a general purpose List.last. It encourages programming using List.last, when in most cases that leads to crap performance (as it would run in O(n) time). It's a one line function to write, but it certainly has no business being in the standard library.
- FraaJad 11y agoLooks like OCaml was not your first language. I suspect you are coming from a imperative language background. OCaml is slow? and your recommendation is to use Haskell instead... That doesn't compute well if we were to assume that you are writing some compute-intensive tasks for which (unoptimized non-C language can be "slower". It more likely the case that students hate whatever languages the university teaches in place of language-de-jour. (Just read the reviews of SICP on Amazon). And yes there are pages on the internet that are older than 2006, so what? No one goes "Pffft.. this is 300 years old.." when they come across Newton's Principa.
- zak_mc_kracken 11y ago> And yes there are pages on the internet that are older than 2006, so what? No one goes "Pffft.. this is 300 years old.." when they come across Newton's Principa. The difference is that programming languages evolve all the time. Having such an old page still up and promoted to the front page of Hacker News tells everyone that OCaml hasn't evolved since 2006.
- FraaJad 11y agoThe issue is with the moderator changing the link from an inner page pointing to (IIRC) http://www2.lib.uchicago.edu/keith/ocaml-class/userdefined.html http://www2.lib.uchicago.edu/keith/ocaml-class/userdefined.h... to the top level course page.
- lesterpig 11y agoWell, I pretty love javascript, is it an imperative language? ;) Please don't be so sharp, I really don't understand why this link is in HN, and I'm just exposing my point of view, after practising OCaml a lot. So what, I'm a student so my opinion is worthless?
- FraaJad 11y agoAh yes, the "functional" and "object oriented" Javascript, how I love thee. When you are starting out, convenience and familiarity (which are visceral) can trump abstract notions like "pure", "correct", "reason-able". I'm not saying your opinion is worthless, just that your judgement could be coloured by inexperience. My sincere recommendation is to use "Real World OCaml" - https://realworldocaml.org/ https://realworldocaml.org/ as a reference to learn OCaml instead of old and busted tutorials littering the internet. Trust me, I have been trying to learn OCaml "on the side" for a few years and RWO is the first book that I have absolute love (even accounting for a wide variety of PL books I read) for being practical, current and explaining stuff.
- mercurial 11y ago> OCaml produces a small amount of code, but is really slow and hard to understand. Do you mean that OCaml produces small binaries, or that the language itself is compact? As for being slow, that's the first time I hear this charge being leveled. Single-thread performance is usually really good.