What does HackerNews think of eio?
Effects-based direct-style IO for multicore OCaml
Look at Eio here: https://github.com/ocaml-multicore/eio
[2] https://marketplace.visualstudio.com/items?itemName=ocamllab...
[3] https://discuss.ocaml.org/t/the-road-to-ocaml-5-0/8584
[4] https://github.com/ocaml-multicore/eio
[5] https://github.com/anuragsoni/sandbox/tree/main/ocaml/effect...
There's also now https://github.com/talex5/lwt_eio, which allows you to run existing Lwt code alongside code using effects, to aid with porting.
"The Unix library provided with OCaml uses blocking IO operations, and is not well suited to concurrent programs such as network services or interactive applications. For many years, the solution to this has been libraries such as Lwt and Async, which provide a monadic interface. These libraries allow writing code as if there were multiple threads of execution, each with their own stack, but the stacks are simulated using the heap.
The multicore version of OCaml adds support for "effects", removing the need for monadic code here. Using effects brings several advantages:
1. It's faster, because no heap allocations are needed to simulate a stack.
2. Concurrent code can be written in the same style as plain non-concurrent code.
3. Because a real stack is used, backtraces from exceptions work as expected.
4. Other features of the language (such as try ... with ...) can be used in concurrent code.
Additionally, modern operating systems provide high-performance alternatives to the old Unix select call. For example, Linux's io-uring system has applications write the operations they want to perform to a ring buffer, which Linux handles asynchronously."