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

28 points by pscanf


nickmonad

This is nuts. Looking at the "Idiom map", it's absolutely littered with unsafe and is going to produce a ton of non-idiomatic Rust code. The mapping for @fieldParentPtr("field", ptr) is particularly wild. Although I guess this "phase A" is just about the (basically) line-for-line translation, and they will attempt to prompt-refactor into more idiomatic and maintainable Rust. The issue is, of course, language design can and does push implementations into a particular direction, and there will be some gnarly things to unravel. I suspect to the point where a good ol' fashioned rewrite would have been the better path.