8 ms·
No wonder OCaml compiled to native is faster than other MLs and Python. I rem stumbling on benchmarks elsewhere, where compiled OCaml rivaled CPP in terms of pe
by ignoramous 12y ago
No wonder OCaml compiled to native is faster than other MLs and Python. I rem stumbling on benchmarks elsewhere, where compiled OCaml rivaled CPP in terms of performance on certain tests.
In my experience with OCaml, I have found the syntax a bit too unfavourable like the author did, but the resulting code was very fast. With concurrency sorted out, I wonder if it could take on Rust, Nim, and Go as far as systems-programming is concerned (esp since Go has the weight of Google behind it).
It also helps that the language designers have written a large tutorial on systems programming: https://ocaml.github.io/ocamlunix/ https://ocaml.github.io/ocamlunix/
Then there's this epic Mirage OS built with Cloud Computing in mind by Anil and his team of OCaml zealots: http://openmirage.org/ http://openmirage.org/
- amirmc 12y agoI don't think anyone on the MirageOS team is a language zealot. Almost by definition, they'll be polyglots so understand the trade-offs you make when using different languages. It turns out that OCaml is pretty good for systems programming, hence projects like MirageOS can survive and grow.
- ignoramous 12y agoAgree. BTW, I meant "zealot" as a compliment.
- dorfsmay 12y ago> With concurrency sorted out The last time I looked at this (~ 2 years ago), there were a few efforts to solve this, but they all had lots of caveats and none were generally accepted as the solution. Has there been any progress since? I tried to solve a performance issue with OCaml, and the lack of concurrency and librairies were too limiting.
- mercurial 12y agoThere is a multicore runtime in progress, with an ETA of "when it's done".
- brudgers 12y agoMulti-core addresses parallelism, concurrency is a whole different can of worms.
- mercurial 12y agoFair point. For concurrency, you have lwt and Core.Async. Lwt is fairly nice, haven't tried Core.Async. I'll point out that "there is no parallelism" is one of the traditional complaints about OCaml, not "there is no solution for concurrency".
- steveklabnik 12y agoFun fact: the Rust compiler was originally written in OCaml.
- oconnor0 12y agoIt seems that many original compilers are written in OCaml.
- cannam 12y agoWhat is it written in now? (Rust?)
- steveklabnik 12y agoYup!