zig-libuv
libxev
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
zig-libuv
-
libxev: A cross-platform, high-performance event loop
This is my project.
I use it as the core cross-platform event loop layer for my terminal (https://mitchellh.com/ghostty). I still consider libxev an early, unstable project but the terminal has been in use by hundreds to now over a thousand beta testers daily for over a year now so at least for that use case its very stable. :) I know of others using it in production shipped software, but use it at your own risk.
As background, my terminal used to use libuv, and I think libuv is a great project! I still have those Zig bindings available (archived) if anyone is interested: https://github.com/mitchellh/zig-libuv
The main issue I had personally with libuv was that I was noticing performance jitter due to heap allocations. libxev's main design goal was to be allocation-free, and it is. The caller is responsible for allocating all the memory libxev needs (however it decides to do that!) and passing it to libxev. There were some additional things I wanted: more direct access to mach ports on macOS, io_uring on Linux (although I think libuv can use io_uring now), etc. But memory was the big one.
And it worked! Under heavy IO load in my terminal project, p90 performance roughly matched libuv but my p99 performance was much, much better. Like, 10x or more better. I don't have those numbers in front of me anymore to back that up and my terminal project hasn't built with libuv in a very long time. But I consider the project a success for my use case.
You're probably better off using libuv for your own project. But, the main takeaway I'd give people is: don't be afraid to reimplement this kind of stuff for you. A purpose-built event loop isn't that complicated.
libxev
-
libxev: A cross-platform, high-performance event loop
io_uring support is obviously great & excellent, fulfills the "high performance" part well.
i was not expecting "Wasm + WASI" support at all. that's very cool. implementation is wasi_poll.zig (https://github.com/mitchellh/libxev/blob/main/src/backend/wa...). not to be unkind, but this makes me wonder very much if WASI is already missing the mark, if polling is the solution offered.
gotta say, this is some very understandable clean code. further enhancing my sense that i really ought be playing with zig.
- Show HN: Async tasks in 350 lines of C
-
Epoll: The API that powers the modern internet (2022)
You might be interested in a pure Zig implementation of these primitives by Mitchell in his libxev library: https://github.com/mitchellh/libxev
-
Zig: The Modern Alternative to C
https://github.com/mitchellh/libxev
- one from the Tigerbeetle DB
- Libxev: A cross-platform, high-performance event loop
What are some alternatives?
unzig - Zig with Unused Variables
async_io_uring - An event loop in Zig using io_uring and coroutines
sokol-tools - Command line tools for use with sokol headers
http.zig - An HTTP/1.1 server for zig
zig-pico - Not so scuffed Zig project for using the Raspberry Pi Pico SDK
mach - zig game engine & graphics toolkit
aviary.sh - Minimal distributed configuration management in bash
bash2048 - Bash implementation of 2048 game
bashttpd - A web server written in bash
bitcoin-bash-tools - Set of bitcoin-related bash functions
otp - Erlang/OTP
hellepoll - A blazingly-fast async HTTP server written in C++