3 ms·
Or choose OCaml: http://engineering.issuu.com/2015/09/17/ocaml-production.html http://engineering.issuu.com/2015/09/17/ocaml-production.htm... It's enterprise-
by yawaramin 9y ago
Or choose OCaml: http://engineering.issuu.com/2015/09/17/ocaml-production.html http://engineering.issuu.com/2015/09/17/ocaml-production.htm...
It's enterprise-ready. Seriously.
Hate the syntax? Wait a little bit and try out ReasonML (new syntax for OCaml), e.g. the following OCaml
channel
|> Channel.push "new_msg" [%obj { body = "a" }] ~timeoutMs:10_000.0
|> Push.receive "ok" (Js.log2 "Created message")
will become (pretty much) the following Reason
channel
|> Channel.push("new_msg", { "body": "a" }, timeoutMs::10_000.0)
|> Push.receive("ok", Js.log2("Created message"));
- aaron-lebo 9y agoStill waiting for Duke Nukem Forever, aka multicore, until then OCaml has major limitations for such a low-level and performance-oriented language.
- yawaramin 9y agoLet's be honest. You don't really need multicore (i.e. language-level parallelism support) for most enterprise work. Hence people use NodeJS just fine. OCaml has not one but two very nice concurrency libraries so for most backend work you will be absolutely fine.
- Can_Not 9y agoSure, but for specific projects, I'd leave NodeJS faster if OCaml had multicore.
- yawaramin 9y agoYou don't even need to leave NodeJS to get all the OCaml benefits: BuckleScript compiles to readable JS. Compare the input and output of the example: https://github.com/bucklescript/bucklescript#an-http-server https://github.com/bucklescript/bucklescript#an-http-server You can get all the type safety benefits of OCaml right now, on NodeJS.
- mlevental 9y agoin what sense is ocaml production ready? does it have the tooling? ecosystem? is there even another stl than jane street's library?
- noncoml 9y agoAs much as I like Ocaml and would love to use it for everything, I tend to agree with you. The ecosystem is severely lacking, making it impractical as your general, everyday language.
- yawaramin 9y ago> does it have the tooling? Yup. Opam (package manager) + Merlin (editor integration, type hints, error messages) + VSCode are a killer combo. And if you use ReasonML you also get refmt, which is the equivalent of gofmt. > ecosystem? Yup. The opam ecosystem is high-quality, growing, and has all the essentials. If you need something out of the ordinary you can call out to C libraries, or even compile to JavaScript and use (almost) the entire npm ecosystem with BuckleScript. > is there even another stl than jane street's library? That's odd. Usually people criticise OCaml for having more than one stdlib. But yes, there's a minimal but useful stdlib that ships with the OCaml compiler: https://caml.inria.fr/pub/docs/manual-ocaml/libref/index.html https://caml.inria.fr/pub/docs/manual-ocaml/libref/index.htm... . And there's also the community-driven Batteries library: http://batteries.forge.ocamlcore.org/ http://batteries.forge.ocamlcore.org/