Live data from Hacker News

Rewrite Bun in Rust has been merged

github.com

591–600 of 822 posts

Re: Rewrite Bun in Rust has been merged

#591
post #397

> +1009257 -4024 Bun is now over 1M lines of Rust code. This is approaching the size of the Rust compiler itself; except that BunJs is mostly a JavaScript interpreter wrapper + a reimplementation of the NodeJS library (Rust STD wrapper). I think BunJS is becoming the canary for software complexity management in the LLM era.

Bun is not a JavaScript interpreter, it's "only" a reimplementation of the NodeJS library + various other libraries. Bun uses JavaScriptCore as its JS engine. So Bun itself does (or at least should do) no JavaScript parsing, interpreting or JITing. EDIT: I misread, sorry! You said "JavaScript interpreter wrapper ", which is correct.

Bun is now almost twice the size of JavaScriptCore, too, by linecount after this.

This is the 'world class' engineering that Jarred claims he can't hire Americans to do, by the way https://x.com/jarredsumner/status/1969751721737077247. This company is parasitic to its literal (javascript) core.

Re: Rewrite Bun in Rust has been merged

#592

PR so thick, the page failed to load the first time I opened it, and the comments still continue to fail to load. Absolutely hilarious. Though that may be just GitHub having a normal one, hard to tell these days. 1 009 257 lines added 4024 lines removed 6755 commits 2188 files touched I haven't the slightest clue how anyone would even remotely hope to review this. I guess by just using even more AI? Or maybe by throw…

The maddening thing is that there's a right way to do this if you have the patience and professionalism to do so. It requires building a bit of scaffolding (feature flags, cross-language calling support, harnesses for shadow testing, etc.), then you ship-of-theseus the codebase incrementally . This is not even incompatible with LLM-assistance, plus it breaks the thing up into smaller, reviewable changes that don't br…

Ah yes, you are actually describing fish shell's Rust rewrite. They specifically called it The Fish Of Theseus which is of course a reference to the ship of Theseus.

https://fishshell.com/blog/rustport/

Re: Rewrite Bun in Rust has been merged

#593

Earlier quoted context omitted.

The Bun codebase had a similar number of lines of code before the rewrite. There's nothing unusual about a rewrite coming in with a similar LOC number.

I was going to comment this same thing. I don't know enough about what Bun does... But Rust is so insanely complicated, it's hard for me to wrap my head around how Bun is equally complictated.

They are complicated in different ways. The rust compiler doesn’t include redis, Postgres, and S3 clients for instance.

Re: Rewrite Bun in Rust has been merged

#594

Earlier quoted context omitted.

The Bun codebase had a similar number of lines of code before the rewrite. There's nothing unusual about a rewrite coming in with a similar LOC number.

I think the unusual thing is that it was written in a week. I highly doubt that they read and understood all 1M lines. But if it works and people use it, what does that mean for software? Should we still care about the code that’s written? Should we even look? I’ve always thought so, but maybe I’m just biased.

I think we should care way more about what the validation story is of code. The obvious question does it all work? I'm happy to not look at any code if we have good ways to validate what is there. The other thing I care about is the architectural structure of the code. Given its a port I don't think that would have changed.

Re: Rewrite Bun in Rust has been merged

#595
post #308

Earlier quoted context omitted.

Cool you can just search specifically for potentially unsafe code in Rust. How do you search for unsafe code in Zig? Or do you just have to assume it's everywhere?

If half of your code is unsafe then unless you exercise tremendous discipline (Claude basically doesn't) you will just end up with a big ball of unsafe, peppered with hallucinations in whatever random documentary comments Claude decided to make. I doubt they enforced the confinement of unsafe to a specific architectural layer or anything like that.

Aren't the Rust unsafes a reflection of the Zig it was ported from? However now that you're working with Rust, you're in a position to continue improving and eliminating the unsafes.

Re: Rewrite Bun in Rust has been merged

#596
post #76

Still writing the blog post about this. Will share more details. For where this is coming from, skim the bugfixes in the Bun v1.3.14 and earlier release notes. Rust won’t catch all of these - leaks from holding references too long and anything that re-enters across the JS boundary are still on us. But a large % of that list is use-after-free, double-free, and forgot-to-free-on-error-path, which become compile errors…

Looking forward to the blog post. Do you plan to run both the Zig and Rust binaries side-by-side across a wide range of real applications (potentially shadowing in production) to weed out bugs?

[deleted]

Re: Rewrite Bun in Rust has been merged

#597
post #512

This kind of frivolous nonsense disqualifies bun from ever being a serious option to me. I'm not building any kind of software used in a professional setting on 1M lines of unreviewed code.

Odd take. Bun was not option for me because or Zig. There was no security. Issue tracker has 3000 issues about segfaults. Now I might actually reconsider.

> There was no security

>1M lines of un-reviewed code are secure?

Re: Rewrite Bun in Rust has been merged

#598
post #124

Earlier quoted context omitted.

This is bad for anyone building on Zig.

Cue the clueless CEOs of zig shops (I don't know many, but still): "Rust is faster and safer! Port it! If you don't do it, I'll do it myself, because AI can do everything a programmer can, including the stuff you don't want to do. Ship it!"

What serious zig shops exist are generally run by actual engineers. Check out tigerbeetle if you want a good example.

Re: Rewrite Bun in Rust has been merged

#599

Earlier quoted context omitted.

This is a huge problem regarding the specifics of ai. Tech is becoming very adversarial as a worker, since marketing and technical information are blurring lines more and more.

Influencers are getting paid to promote ai for 10s of thousands of USD. This is one the reasons social media has been swamped with it lately.

Yes, some of the latest campaigns:

https://www.wired.com/story/super-pac-backed-by-openai-and-p...

Anthropic's own talking point guide:

https://news.ycombinator.com/item?id=47945021

There were earlier initiatives from the industry. This is just what is in the open and does not even include automated LLM "influencers".

Re: Rewrite Bun in Rust has been merged

#600
post #564

I'm curious where this leaves Zig. Bun was the most prominent and biggest project using it. What's left?

Zig is still a moving target with big fundamental changes being made to the language from version to version - nowhere near v1. When rust was at this stage of its development you wouldn’t have been able to name many projects either.
Post reply on HN