4 ms·
OCaml can compile to native. That makes it faster than F# running in a VM. OCaml can compile to bytecode as well. Also, if you ever need interfacing with C/CPP,
by ignoramous 12y ago
OCaml can compile to native. That makes it faster than F# running in a VM. OCaml can compile to bytecode as well. Also, if you ever need interfacing with C/CPP, OCaml is better suited (faster) to the task than, say, Ruby or JVM based languages.
Apart from that, multithreading in OCaml is a bit like on its on Python, IIRC, with GIL taking the sting out of it. But I am sure the researchers in France and elsewhere would bring true multithreading / multicore support to OCaml sooner rather than later.
More on what OCaml gets right: https://realworldocaml.org/ https://realworldocaml.org/ (which seems to be down right now).
- mercurial 12y agoThere is a multicore runtime in the works, with an ETA of "when it's done". That said, you have a couple of full-featured monadic concurrency libraries (Lwt and Async). It also has functors (they let you parametrize a module over other modules), which F# doesn't, and you can do AST rewriting at compile-time via PPX (don't know if F# has anything like that). On the other hand, F# has access to the .NET ecosystem (which is admittedly larger than the OCaml one, though it suffers from enterprisitis), and has some nice goodies like type providers.
- VesaKarvonen 12y agoFYI, my Hopac library (https://github.com/Hopac/Hopac https://github.com/Hopac/Hopac) is also a full-featured monadic concurrency library, inspired by Concurrent ML, for F# that is optimized for parallel programming.
- pjmlp 12y ago> OCaml can compile to native. F# as well, via mono -aot, NGEN and the upcoming .NET Native toolchain. > But I am sure the researchers in France and elsewhere would bring true multithreading / multicore support to OCaml sooner rather than later. This is being worked on. "OCaml 2014: Multicore OCaml" https://www.youtube.com/watch?v=FzmQTC_X5R4 https://www.youtube.com/watch?v=FzmQTC_X5R4 https://ocaml.org/meetings/ocaml/2014/ocaml2014_1.pdf https://ocaml.org/meetings/ocaml/2014/ocaml2014_1.pdf