4 ms·
One of the main reason I got into Ocaml (coming from C++) was that it had bytecode compilation (and obviously a bytecode interpreter) next to the native one. Th
by toolslive 7y ago
One of the main reason I got into Ocaml (coming from C++) was that it had bytecode compilation (and obviously a bytecode interpreter) next to the native one. This is really fast (5-7 times faster last time I measured) and perfect during development, when you don't really care about performance.
- pdimitar 7y agoI wanted to use OCaml several types but the lack of parallelism and the GIL have put me off. Still waiting for Multicore OCaml.
- toolslive 7y agoyes. if you need parallelism, you need to go via the process model. (we did this, but it's quite painful) Anyway, the official road map states something along the lines of "Multicore: probably next release" (but that was also said for previous releases)
- pdimitar 7y agoSadly all you said has been confirmed by other people as well. I really like OCaml. It's mind-bogglingly fast and well-made in basically almost every regard I can think of. The lack of proper parallelism nowadays however is a huge NOPE. I know JaneStreet and Inria have a lot of valid usages for it and don't care what the rest of us think but it's very sad to have one of of the highest quality languages and compilers be left to fringe usage of several organisations only. :(
- pjmlp 7y agoIt supports parallelism the same way UNIX clones did for their first two decades, which is quite good for plenty of workloads, and then there is Lwt for concurrency. And it is safer. :) In any, case multicore runtime is getting closer, https://discuss.ocaml.org/t/multicore-ocaml-january-2020-update/5090 https://discuss.ocaml.org/t/multicore-ocaml-january-2020-upd...
- pdimitar 7y agoIf we have to mention inter-process communication where every process is single-threaded then IMO the battle has been lost. Best IPC is no IPC, wouldn't you agree? In-process function calls can't be beaten. Give me a mix of OCaml and Rust with the runtime of Erlang/Elixir and I ain't learning another programming language until the day I die! Thank you for the link, I found it really interesting.
- pjmlp 7y agoIn the times of Spectre, Meltdown and in-process exploits due to threading issues, everyone doing microservices, I don't see the inter-process communication route as that bad.
- pdimitar 7y agoSure, pretty good point actually. I'm just saying that in these same times many problems fall into the category of embarrassingly parallel and there's no reason to wait 4s for a result that can easily take 0.5s. But you're also correct.