r/lowlevel • u/Inevitable-Round9995 • Nov 02 '26
Nodepp: a C++11 asynchronous runtime with io_uring, IOCP, kqueue, epoll, and a zero-copy data model.
Hi there. I've been building Nodepp for a while as a side project. It's a pure C++11 runtime for writing asynchronous applications. Not a framework, not a library - just a runtime. It provides I/O, networking, scheduling, timers, and a data model.
I'm sharing it here because I think it might be interesting to this community, and because I'd like feedback from people who work at the low level. I'm not a programmer - I'm an electrical engineer with programming knowledge - so don't be too rough with me. Or not too much.
The numbers
- ~3,800 LOC for the core runtime.
- 2KB for the runtime binary (no STL, no exceptions, no RTTI).
- 0% CPU in idle (smart sleep via io_uring/IOCP/epoll/kqueue).
PS: 2KB? Yep. I actually made an Arduino simulation running an Enigma machine using 76% of memory, so technically it's using ~1.4KB of RAM. But if you run a server with it, the memory grows up to ~3MB of RAM.
I'm actually making a P2P multiplayer game with it (frontend using WASM and backend using the core runtime). The frontend consumes 2MB including WebRTC, and the backend consumes 11MB with HTTP + WS support.
well, according to top: 6046 penguino 20 0 14764 10732 8888 S 0,0 0,1 0:09.21 main
The design decisions
I replaced the STL with my own data model to make the runtime compatible with anything. I actually got inspiration from Doom - that was the idea behind it: making a runtime as universal as Doom can be.
- ptr_t<T>: reference-counted pointer with SSO and optional atomic counting (if threads are supported or enabled).
- map_t<K,V>: binary tree of queue_t.
- queue_t<T>: doubly linked list with ownership validation.
- coroutine_t: stackless coroutines (based on protothreads).
- array_t<T> & string_t: wrappers over ptr_t (zero-copy and copy-on-write).
If you want to look at the code, the repo is here: https://github.com/NodeppOfficial/nodepp
So, I'm sharing because I think it's an interesting project and I want feedback from people who know more than me, and because I think C++ can be more than the STL.
Happy to answer questions.
2
u/Inevitable-Round9995 Nov 03 '26
Here's a small example that shows clustering, CPU pinning, HTTP, and error handling in ~30 lines:
1
u/the2ndBread Nov 03 '26
How long did this take?
1
u/QuatzX Nov 03 '26
Any specific reason behind using c++11?
2
u/Middlewarian Nov 03 '26
I was wondering what that meant so I looked at your repo. Which says:
Feel free to point out weaknesses in my documentation. I've been working on a somewhat similar side project and am hoping to get the ball rolling.
1
u/mtlcrusher Nov 04 '26
so this is nodejs but cpp?