4 ms·
Comparing Standard ML and OCaml
- beering 14y agoNothing said about multithreading and parallel processing? Seems like a big omission if you're comparing languages.
- dons 14y agoThe reason is that neither OCaml nor SML support language-level parallelism or concurrency. These features are /somewhat/ available as 3rd party libs (OCaml), but you won't see GHC or Erlang-style thread use.
- Altenuvian 14y agothere were some attempts to include multithreading into standard ml. john reppy's manticore project came quite far but wasn't fully implemented. currently mythryl, a sml/nj derivative with c-flavored syntax, is about to get a full multithreading support. check out mythryl.org and the status updates on the mailing list.
- rwmj 14y agoThe user group explicitly rejected multithreading at the OCaml Users conference a couple of years back. (There was a working implementation called oc4mc). The reasons were that it will slow down single-threaded performance, and threads as a programming model is not robust (compared to, eg. forking, message passing, MPI etc). Also actual graphs of 4- and 8-way SMP performance showed pretty poor scaling for real problems, so the benefits aren't that great compared to going for full MPI, which you have to do for NUMA anyhow.
- scott_s 14y agoAlso actual graphs of 4- and 8-way SMP performance showed pretty poor scaling for real problems Do you mean for OCaml, or in general? Because lots of problems are amenable to 4 and 8 way threading on SMPs or multicores.
- Evbn 14y agoGHC has a compiler flag to enable multi threaded runtime. Why can't OCaml have that? It is a bit rigid to have to build two versions of a binary, but for folks who run their own code, no problem at all.
- rwmj 14y agoSure, you can run OCaml and oc4mc. You'll also end up with two different binaries. oc4mc isn't as well tested, so I guess you'll hit more bugs. This still doesn't solve the horrible programming model [I've been cursing a multithreaded C program in the past few days. It's amazing how much stuff you have to remember and how much simply doesn't work in C when you've got threads]. Nor does it let your program scale past the limit of a single NUMA node. Whereas message passing a la Erlang lets you scale over NUMA and across machines and networks.
- jackfoxy 14y agoF# is practically OCaml, from my understanding. I don't know if it has all the same current .NET multithreading support under Mono. Worth looking into.
- pjmlp 14y agoI have adopted it as my main scripting language when doing Windows projects. :)
- opminion 14y agoWhat's a good F# tutorial/reference you've used?
- jackfoxy 14y agoSee my article http://jackfoxy.com/a-course-of-fsharp-study/ http://jackfoxy.com/a-course-of-fsharp-study/ I've got a bunch of references to F# tutorials, articles, and references. IMO the best tutorial is http://en.wikibooks.org/wiki/F_Sharp_Programming http://en.wikibooks.org/wiki/F_Sharp_Programming
- pjmlp 14y agoI already knew Caml so it was easy to learn F# just by reading the MSDN articles and Channel 9 videos. There is plenty of good stuff there. http://msdn.microsoft.com/en-us/magazine/ee310108.aspx http://msdn.microsoft.com/en-us/magazine/ee310108.aspx http://channel9.msdn.com/Tags/fsharp http://channel9.msdn.com/Tags/fsharp http://channel9.msdn.com/Tags/functional+programming http://channel9.msdn.com/Tags/functional+programming
- iskander 14y agoThey really diverge when it comes to more advanced language features. I make heavy use of functors in my code and my (possibly mistaken) understanding is that F# simply doesn't support them. Ditto for first-class modules, polymorphic variants, GADTs, and OCaml's object system. Of course, in exchange for a wimpier core, F# gives you a lot of convenient polish and proper support for parallelism & concurrency.
- gtani 14y agothis was Leroy's post in 2002 about multithreaded runtimes http://web.archive.org/web/20110724004117/http://caml.inria.fr/pub/ml-archives/caml-list/2002/11/64c14acb90cb14bedb2cacb73338fb15.en.html http://web.archive.org/web/20110724004117/http://caml.inria.... Here are recent commentaries: http://stackoverflow.com/questions/1302272/is-inria-going-to-add-concurrency-primitives-to-ocaml http://stackoverflow.com/questions/1302272/is-inria-going-to... http://www.reddit.com/r/ocaml/comments/xxxn4/interesting_development_on_the_ocaml_on_multicore/ http://www.reddit.com/r/ocaml/comments/xxxn4/interesting_dev... http://stackoverflow.com/questions/10705526/is-there-a-survey-on-concurrency-parallelism-libraries-for-ocaml http://stackoverflow.com/questions/10705526/is-there-a-surve...
- deleted 14y ago[deleted]
- Wilya 14y agoRegarding build systems, ocamlbuild is included with the standard ocaml distribution and gives a high-level interface that is much simpler to use than ocamldep and friends. Especially when combined with findlib.
- nrlucas 14y agoYeah, this is really old. I remember seeing it six years ago when I started using OCaml.
- batgaijin 14y agoUrgh! I want to see Jocaml posts around here!