3 ms·
work has already begin on a direct-style IO library that internally uses effects. See: - https://github.com/ocaml-multicore/eio#readme https://github.com/ocaml
by avsm 5y ago
work has already begin on a direct-style IO library that internally uses effects. See:
- https://github.com/ocaml-multicore/eio#readme https://github.com/ocaml-multicore/eio#readme for more information on the Eio library
- https://watch.ocaml.org/videos/watch/74ece0a8-380f-4e2a-bef5-c6bb9092be89 https://watch.ocaml.org/videos/watch/74ece0a8-380f-4e2a-bef5... is a short talk on experiences using effects with some nice motivating examples
Note that Eio is more than just a direct replacement for Lwt and Async. We couldn't resist using some of the experiences also gained from the MirageOS (mirage.io) unikernel framework in EIO. This means that the backends are highly optimised to use the best syscalls available in the OS (e.g. io_uring by default in Linux). If you write your applications to use Eio natively, then performance is very high so far. The ergonomics of programming in it also compare favourably to using monadic concurrency.
- devmunchies 5y agoso EIO is a new IO implementation built on top of effect handlers? Will EIO also be part of the stdlib? ie. will the httpaf server library need to import it as an external dependency like it currently does with lwt, or will EIO already be available?
- rbjorklin 5y agoI just lurk the OCaml forums so don't take what I say as gospel but from what I've understood EIO will _not_ be part of stdlib. The OCaml devs go out of their way to not break things in stdlib so from what I've gathered they don't want to include it EIO until there's more real world experience with it and the API has started to settle down. Including it in stdlib might also never happen but that remains to be seen.
- avsm 5y agoIt's too early to say. Eio is still under very active development, so we'll have to see how it goes. The more useful feedback we get on it now, the more likely it'll be submitted for consideration in the OCaml stdlib when appropriate.