14 ms·
Ocaml also has a long standing claim to being an oo plus functional language for the future that hasn’t seen a lot of uptake. It would have been heartening and
by le-mark 6y ago
Ocaml also has a long standing claim to being an oo plus functional language for the future that hasn’t seen a lot of uptake. It would have been heartening and reassuring for the author to explore more candidates than Scala.
- sfRattan 6y agoThe complaints I remember about ocaml the last time I checked it out were related to multithreading. No idea if that's changed. But I do see ocaml very often in use to write a compiler, especially for languages that aren't yet self-compiling, most recently when looking into Haxe.
- cptwunderlich 6y agoNot yet, but it's a work in progress: https://discuss.ocaml.org/t/multicore-ocaml-february-2021/7449/3 https://discuss.ocaml.org/t/multicore-ocaml-february-2021/74...
- yawaramin 6y agoNode.js, Python, and Ruby are single-threaded. They all have ways to achieve concurrency and multi-process usage right now, and so does OCaml. I get it, people really want OCaml multicore–and it's coming–but that by itself is not stopping OCaml from being an industrial-strength, production-ready language right now.
- pjmlp 6y agoFor generations, the only way to use multiple CPUs was multiple process and asynchronous syscalls. So for C it was ok, but for OCaml a reason not to use the language.
- zepto 6y agoOcaml is awesome. The syntax presents a paradox though. It makes it slower to approach than curly brace languages or even lisps, but once you learn it, it’s a secret weapon of conciseness.
- jolux 6y agoIt's pretty close to Lisp without parentheses.
- canadianfella 6y agoIn what way?
- acjohnson55 6y agoIn my brief usage of OCaml, it seemed like the consensus was that the OO features were better off forgotten.
- lostcolony 6y agoThat feels like the consensus for every language that mixes OO with FP...
- acjohnson55 6y agoI disagree. OO features are very heavily used in Scala and the languages it influenced. TypeScript and Swift particularly come to mind. I think the key here is that Scala paved the way for type systems capable of modeling OOP and FP idioms, cleaning up what OCaml attempted. Although one could argue that none of the other post-Scala languages inherit the full toolkit of typed FP features as much as Scala (pattern matching, everything is an expression, true ADTs).
- lostcolony 6y agoEvery user of Scala I've ever talked to has said something to the effect that the more they became comfortable with Scala, the more functional their code became. That includes people who have never used a functional language before taking up Scala. I've never met any who said their code became more object oriented. In fact, most "best practices" in OO eschew some of the key OO features, i.e., composition over inheritance; of those two the latter is a distinctly OO concept, and the former isn't.
- pjmlp 6y agoLike Lisp and Smalltalk?
- yawaramin 6y agoIt's not so much that, but rather that OCaml's dominant paradigm of modules and functions is just so powerful that you almost never need OOP. But when you do, it's super useful to have.