3 ms·
Multicore is there, STM instead of mutable imperative logic in all the libraries developed for the past two decades: not so much though.
by ghostwriter 4y ago
Multicore is there, STM instead of mutable imperative logic in all the libraries developed for the past two decades: not so much though.
- c-cube 4y agoI haven't heard anyone talk about STM for OCaml, funny. People talk about, or work on, lightweight fibers, lockfree data structures, io_uring, etc. but not STM. Is it falling out of fashion? Even in clojure I hear that few people actually use it.
- grumpyprole 4y agoIt works great in Haskell. The problem is that it really needs typed effects, hopefully OCaml will get typed algebraic effects at some point.
- kcsrk 4y agoStill early days, but I had done some exploratory work in the past on Reagents, a composable lock-free library [1]. Now that OCaml 5 is released, we're reviving this work. It's semantics is weaker than STM -- unlike STM, it doesn't provide serializability but Reagents can compile down to multi-word compare and swap operations, which can be implemented with the help of hardware transactions (when present) or efficient software implementations of it [2]. Hence, Reagent programs should be faster than STM. [1] https://github.com/ocaml-multicore/reagents https://github.com/ocaml-multicore/reagents [2] https://arxiv.org/pdf/2008.02527.pdf https://arxiv.org/pdf/2008.02527.pdf