A detailed porting guide for translating Bun's Zig source code to Rust, covering Phase A of a multi-phase migration. The document provides exhaustive mapping rules for type conversions (slices, pointers, error types, tagged unions), idiom translations (defer/deinit to Drop, comptime to generics/const, allocators), naming conventions, crate layout, banned dependencies (tokio, hyper, async-trait), memory management strategies (arenas vs global allocator), concurrency patterns, and dispatch strategies for hot vs cold paths. Includes specific guidance on strings, collections, FFI boundaries, and borrow-checker reshaping.

36m read timeFrom github.com
Post cover image
Table of contents
Ground rulesCrate mapType mapIdiom mapComptime reflectionStringsAllocatorsConcurrencyDispatch ( union(enum) across crate tiers)Pointers & ownershipCollectionsJSC typesFFIPlatform conditionalsDon't translateOutput format

Sort: