Lobste.rs

Bun (the js runtime) is being vibe-ported from zig to rust

Bun is getting out of control and I love it - YouTube

Zig → Rust porting guide You are translating one Zig file to Rust. Read this whole document before writing any code. The goal of Phase A is a draft .rs next to the .zig that captures the logic faithfully — it does not need to compile. Phase B makes it compile crate-by-crate. Ground rules Write the .rs in the same directory as the .zig, same basename. <area> is always the first path component under src/ (the crate root). If the .zig basename equals its immediate parent directory name (any depth), name it mod.rs; if it equals the top-level <area> dir, name it lib.rs. Examples: src/bake/DevServer/HmrSocket.zig → src/bake/DevServer/HmrSocket.rs; src/bake/DevServer/DevServer.zig → src/bake/DevServer/mod.rs; src/http/http.zig → src/http/lib.rs. Do not invent crate…

Continue reading at Lobste.rs github.com
Advertisement