Comment by IshKebab

1 day 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/ed1a70f81708d7d137de8de0...

Versus this Rust version: 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.

It’s still 400k more lines

  • Dunno 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).