Multicore OCaml: May 2021
discuss.ocaml.org
discuss.ocaml.org
Long story short - my experience has been that OCaml (and Haskell) are often better phased out as the maturity of the team grows. I hope that one day I that will change - but as of today I would not advise a startup to bet on functional languages like OCaml. Happy to elaborate as to why if there is some interest.
I'm looking forward to hearing from people who disagree; and more importantly, have built successful products in OCaml.
Please elaborate because that is quite the leap.
Still using OCaml for side projects tho!
Please do.
Well I guess this is an indication of what it would take to get elisp to have real multi-processing. It will be interesting to follow this process to see how the workflow pans out, and should be of major interest as a case study. Making such invasive and extensive changes across a large codebase and countless 3rd party libraries is a daunting coordination problem for open source projects.
Unfortunately, it has the same problem, but for Linux instead; dot net core is not the same as dot net.
Now there is https://fdopen.github.io/opam-repository-mingw/installation/
Basically you just need Cygwin and you are good. It worked for me when I last tried it.
With a caveat. If you depend on some cygwin libs for your ocaml program you need them on the other machine too.
Maybe you can copy them over as well. Or not. Not a win dev, sorry.
IIRC, the .NET GC team were surprised at how poorly their GC performed in the first attempts to implement Haskell for .NET.
Another tradeoff for a classic 3-color tracing concurrent or incremental garbage collector is what the write barrier does when adding a reference to a maybe garbage (white) object from an already traced (black) object. The color invariant is that traced objects may never have references to garbage. In order to maintain the invariant, either the white object needs to be marked grey or the black object needs to be marked grey. If further modifications of the black object this cycle are unlikely, then the correct thing to do is to push the GC cycle forward by marking the white object grey. If further mutations of the black object are likely, the right thing to do is to defer potentially wasted work by marking the black object grey. Some garbage collectors make this decision on a per-type basis. For instance, IIRC LuaJIT's GC will mark black Tables grey if adding a white reference, and for other types, the GC will mark the white object grey. Languages that discourage mutation would tend to be tuned to mark white objects grey, and languages that tend to encourage mutation would tend to be tuned to mark black objects grey.
There's also the fact that all abstractions are leaky. If the semantic difference between your language and Go are small, then if you target Go, you can be relatively confident that the Go compiler has spent its finite complexity budget wisely for your language. If your source language semantics are very different from Go, then the Go compiler may skip some optimizations that would really help your programs, and may spend a lot of time in analysis that's unlikely to speed up your programs much.
The cost of tracing GC is proportional to the rate of object creation times the number of live objects. The cost of reference counting is proportional to the rate of reference destruction (with batching optimizations to reduce the cost of a small number of objects having lots of references created and destroyed.) If your programs create a lot of long-lived objects that rarely have their reference counts change, then cycle-detecting reference counting can be a big win.
[0] https://researcher.watson.ibm.com/researcher/files/us-bacon/...
You'd need an overlap of
1. An appreciation of ML and its extensions.
2. A relatively deep understanding of Go's semantics, performance hacks w/ GC, type system quirks, etc.
3. Belief that this would be useful.
4. Knowledge of compilers.
5. Time on your hands. This is a blocker for me :(