Repository navigation
Replies: 1 comment 1 reply
|
Hey bro, porting that layer to pure Rust is definitely a great idea. The main reason it is still in C and C++ right now is just to save time and rely on code that is already battle-tested. For the short term, it looks like the plan is to keep the C version around to maintain stability while the massive new Rust codebase settles down. But in the long term, a pure Rust port makes total sense because Rust natively supports the exact single-thread reactor model that Bun relies on. Doing a full native port would wipe out the C boundary, get rid of all those unsafe |
Uh oh!
There was an error while loading. Please reload this page.
Hi Bun team,
I saw that
packages/bun-usocketsandpackages/bun-uwsare Bun's own fork and not synced from upstream uNetworking anymore. They also changed a lot (QUIC, fault inject, only epoll/kqueue and libuv left, manyBun__*hooks).Since the Rust rewrite is going on, I am wondering is it a good idea to port this layer to pure Rust too? Now
src/uws_sysis mostly FFI bindings with a lot ofunsafeblocks, so a native port could remove most of them and also the C/Rust boundary.Also it can be nice for Rust users, maybe one day it can be a standalone crate for people who want to use native usockets in Rust instead of tokio.
So my questions:
Thanks for the great work!
All reactions