3 ms·
My initial reaction was that this is pure insanity but in fairness this is a fairly 1:1 port of existing code, so the developer's mental model of it should stil
by IshKebab 6mo ago
My initial reaction was that this is pure insanity but in fairness this is a fairly 1:1 port of existing code, so the developer's mental model of it should still match fairly well.
For instance look at this Zig function: https://github.com/oven-sh/bun/blob/ed1a70f81708d7d137de8de057d11668c5f4e220/src/ast/scope.zig#L90-L174 https://github.com/oven-sh/bun/blob/ed1a70f81708d7d137de8de0...
Versus this Rust version: https://github.com/oven-sh/bun/blob/ed1a70f81708d7d137de8de057d11668c5f4e220/src/ast/scope.rs#L154-L240 https://github.com/oven-sh/bun/blob/ed1a70f81708d7d137de8de0...
I did pick that at random but it does look like the best case. I skimmed through a lot of the Rust code and there's a surprisingly small amount of `unsafe`.
Still pretty insane to merge this in such a short time with so little testing, but I can easily think of bigger software engineering mistakes. Hell it's not like Bun even needs to be commercially successful any more.
- jwpapi 6mo agoIt’s still 400k more lines
- IshKebab 6mo agoDunno where you got that number from but it's half that. Tokei says: =============================================================================== Language Files Lines Code Comments Blanks =============================================================================== Zig 1298 711112 577946 57772 75394 Rust 1443 931232 737485 114373 79374 So it's 28% more lines of code (not comments/blanks).
- travisgriggs 6mo agoRust is mostly ~20% bigger. Except comments. Where they basically doubled... what's with that?