logoalt Hacker News

Rewrite Bun in Rust has been merged

127 pointsby Chaosestoday at 8:15 AM103 commentsview on HN

Comments

Jarredtoday at 10:41 AM

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 or automatic cleanup.

show 4 replies
xiphias2today at 9:16 AM

I'm actually excited for somebody trying experimenting with automated translation, but I'm afraid this will be lots of backwards compatibility issues.

I started looking at the commits, and it's basically solving the ,,tests not pass'' problem by changing the tests themselves. The real work of making it working on programs that are already deployed will be just starting now.

The only silver lining I see is that the server side JS community for some reason is already used to breakages all the time.

show 7 replies
tkeltoday at 8:50 AM

Turns out "its just an experiment, you all are overreacting" was just a lie to damp criticism.

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

show 7 replies
sensanatytoday at 10:31 AM

Love seeing the tests themselves getting modified, with random `sleep(1)` thrown around in a few of them. This bodes well, I pray some idiot at some large AI co actually ends up using this garbage in prod

frangonftoday at 10:14 AM

So the geniuses in the datacenter prefer to rewrite the full codebase in another language instead of maintaining and improving its own fork or contributing to make the current language better.

Impressive to rewrite 1MLOC in a week yes, but this is more of a job of a million monkey programmers crammed in a datacenter than a bunch geniuses. And I would know, since I'm a monkey programmer who is in danger now... Or maybe the Zig team is in a greater danger, since their brains hold the genius juice the clankers are missing and they should have it by 2027...

show 1 reply
eqvinoxtoday at 9:55 AM

If this goes wrong even in the slightest, the ridicule about a drug dealer getting high on their own supply will be neverending and grim.

show 1 reply
perching_aixtoday at 9:56 AM

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 throwing some über hardcore lint pass onto it? It really seems like more an exercise in risk assessment than code review.

show 1 reply
simonkleetoday at 10:43 AM

Say what you want, but for people building products on Bun, this is bad news for the foreseeable future.

show 1 reply
TeriyakiBombtoday at 10:04 AM

I hope the Deno lot take the opportunity to capitalise on this

9999goldtoday at 10:49 AM

Wondering what they will do when rust rejects a pr from them.

nDRDYtoday at 9:55 AM

Why didn't they ask Claude to remove all of the `unsafe` at the same time??

janice1999today at 10:48 AM

Has he estimated the token cost for this (if he had to pay that is)? I'm curious how much this would cost a paying customer.

feverzsjtoday at 10:10 AM

How they gonna do refactoring, bugfix or other maintenance on generated code? Ask LLM?

show 1 reply
Havoctoday at 11:31 AM

How does the no async work? Would have thought Bun would need that

ninjahawk1today at 9:47 AM

“+1,000,000” changes in a single commit is insane.

show 3 replies
HEX4AGONtoday at 10:44 AM

I'm curious how much dollar in LLMs this rewrite cost

bharxhavtoday at 10:22 AM

This canary will never leave the mine. (unless Anthropic opens their wallet again)

mapcarstoday at 10:01 AM

>No async rust.

I wonder why does that deserve an explicit statement? Is there anything wrong with async rust?

show 1 reply
q3ktoday at 10:10 AM

  $ grep --exclude-dir=.git -r 'unsafe {' | wc -l
  10465
Nice.
show 2 replies
ptrl600today at 10:30 AM

Hey, it forgot to change the README!

PudgePackettoday at 8:41 AM

+1,009,257 -4,024

wild

show 1 reply
lucasloisptoday at 9:48 AM

The follow-up PR removing the zig source files being auto-tagged by bun's own CI as "ai slop" is so funny

https://github.com/oven-sh/bun/pull/30680

show 1 reply
wateralientoday at 10:17 AM

Deno's approach from the beginning seems to have proven out.

sutibtoday at 10:00 AM

"And Icarus laughed as he fell, for he knew to fall means to once have soared"

classicpostertoday at 10:29 AM

It's interesting that the developer who spearheaded the hype of Zig abandoned the engineering without addressing the segfault. They could have also taken the approach of gradually porting from Zig to Rust via FFI. Yes, this is a slop show by the AI lab.

minikomitoday at 10:12 AM

Now translate it into zig!

aiscomingtoday at 10:00 AM

vibe coders keep saying that now you can have 100x productivity, that you can write a million lines of code in a week and do what would take a team of 10 experienced developers a year.

where are all these million lines vibe coded projects? I don't see them. its all hype

show 2 replies
jwpapitoday at 9:49 AM

This will go down in history as the biggest mistake of software engineering of all time.

Bun is the runtime of Claude Code, which is the core product of a trillion dollar company, which now sits on a vibe-coded app, where not a single person in the world has a proper mental model of.

show 8 replies
ares623today at 10:23 AM

Anyone using Bun in production excited for this release? (other than Anthropic of course)

maipentoday at 10:31 AM

HN overreacting again.

I trust Jarred to make the right decisions regarding bun, which seems to be his passion. Bun has always been amazing since i first tried it, it had some bugs along the way, which didn’t last long.

Anything bad that comes from this, will simply be fixed.

I hope more software does this and gets rid of their segmentation fault producing code, written in c++ and other unsafe languages

I can think of a few.

dmitrijbelikovtoday at 10:07 AM

Rust, Zig and TS went into a bun... /s