Live data from Hacker News

Claude Code uses Bun written in Rust now

simonwillison.net

151–160 of 920 posts

Re: Claude Code uses Bun written in Rust now

#151

It's a transpile. And not even a good one. The generated code is far from idiomatic rust. Some may consider it an abomination.

grep -nr 'unsafe' . Is all you need to know to consider how much of an abomination it is

The original code was one giant unsafe block with almost no tangible way to find or debug all the subtle memory bugs and leaks they had.

Now it's smaller, faster and has fewer bugs. Also its every potential memory issue is neatly annotated by an unsafe block so you can go and refactor them out one by one with confidence.

All this seems like a pretty huge improvement to me. Why is this an abomination in your eyes?

Re: Claude Code uses Bun written in Rust now

#152
post #7

Earlier quoted context omitted.

Yeah same, according to one of the Zig team members, the original source code wasn't all that anyway. But this is HN, a subsection of which places a high importance on what language something is written in, moreso than what it does (feels like).

An interesting tidbit is that large parts of the original Bun source code was a line-by-line port of esbuild from Go to Zig (mentioned here: https://bun.com/blog/bun-in-rust ), tbh this lowered my respect for the project a bit (a line-by-line port simply isn't as interesting as original work), and it might also explain the subpar Zig code quality (a line-by-line port from Go to Zig simply won't result in idiomatic Zi…

I read your link, written by Bun's author and totally get his thinking.

In the current world of cyber weaknesses everywhere, infrastructure must be solid and rust is a better choice than zig for something like bun.

In other words, bun is not a demo of zig programming that happens to do useful things. Bun does useful things, and must do them securely. That is its number one priority, language is secondary, inasmuch as it helps doing useful things securely.

Re: Claude Code uses Bun written in Rust now

#153
post #40
post #5

Earlier quoted context omitted.

Why does changing to Rust kill the project? I don't understand the point here.

Rust as a language is irrelevant to this discussion, the problem is that bun was vibe coded by a single dude without any open source community involvement. “bun the open source project” is basically dead at that point: don't expect any of the zig enthusiasts who had their code being forcibly rewritten in a language they don't like to follow Jared. “bun the JavaScript runtime ” is not dead though.

Is the idea that a code base reset makes something stop being open source? Or that the number of people doing the reset matters?

I don't see why either of those would be true. The project isn't dead just because it's in a different language now, and for liveness purposes it doesn't matter how it got to that different language.

Re: Claude Code uses Bun written in Rust now

#155
post #93
post #40

Earlier quoted context omitted.

Rust as a language is irrelevant to this discussion, the problem is that bun was vibe coded by a single dude without any open source community involvement. “bun the open source project” is basically dead at that point: don't expect any of the zig enthusiasts who had their code being forcibly rewritten in a language they don't like to follow Jared. “bun the JavaScript runtime ” is not dead though.

I agree, it's unfortunate the headlines seem to have become 'rewritten in Rust' (not a bad thing) and not 'vibecoded in a week without review' (a bad thing).

Surely a lot of review has happened in the last two months?

Re: Claude Code uses Bun written in Rust now

#156

Earlier quoted context omitted.

> For weeks, it was uproar over the blanket AI move to Rust and now it’s this reason. That’s why I said the goalposts are being moved. I'm just one person though, and have no problem with a move to language X, using tool Y, who cares? For "goalpost are being moved" to be valid here, you have to be able to point to someone saying one thing at one point, then same person putting a different target later. You're folding…

https://news.ycombinator.com/item?id=48843352 https://news.ycombinator.com/item?id=48837877

Your point being? None of my comments in either of those state that I'm upset about it moving from Zig to Rust?

Re: Claude Code uses Bun written in Rust now

#157

It's a transpile. And not even a good one. The generated code is far from idiomatic rust. Some may consider it an abomination.

Seems to be working just fine though? And like, this is just the beginning of the port. They did a mechanical port basically line by line, next step is to make it idiomatic rust. I thought by now people would’ve learned to stop betting against this rewrite.

> Seems to be working just fine though?

As with all transpile ports, the true test will be how well it can be extended and maintained over time. Historically working with the output of a transpile is not pleasant and requires heavy rework to get it to the point where you can be comfortable enough to extend it.

The existing community is now either going to need to learn Rust or new Rust developers are going to have to join the project and they may not invested enough to refactor the transpiled output when they could work on something else like Boa.

Re: Claude Code uses Bun written in Rust now

#158
post #141

All the emotion of speculations aside, how it runs? It boots faster yeah, but what about RAM and CPU usage? Weird dead loop or dead locks? If it run as good as before or even better, then that's kinda impressive. I'm a developer so I really don't like it when AI might took my job, but if everyone on this planet could create a software for themselves exactly as how they wanted with just a few simple demands, that will…

> I'm a developer

Then you must know that the hardest part of software development is getting clear requirements...

> everyone on this planet could create a software for themselves exactly as how they wanted

Even with perfect AGI this will never happen because people will never be able to express clear requirements

Re: Claude Code uses Bun written in Rust now

#159
post #74
post #9

Honestly, I initially thought rewriting an entire codebase with AI would be a huge mistake. After reading this, I'm starting to think I was wrong. If projects like Bun can be substantially rewritten and shipped to millions of users, it suggests we're entering a very different phase of software development. Today's AI-generated rewrites may not produce code that humans would consider high quality or maintainable. But…

> But I'm beginning to wonder whether that will even matter in a few months. At that point, even Bun itself doesn't matter. All intermediate tools don't matter if LLMs can reliably write something large. The problem is that LLM is not quite there yet. The rewrite was only possible because they mostly stick to 1-to-1 translation resulting in non-idiomatic Rust code. So, what from there? I don't think they can really b…

Isn't it just: "while true {refactorIdiomatically(); fixErrors()}"

Re: Claude Code uses Bun written in Rust now

#160
post #5

Earlier quoted context omitted.

Why does changing to Rust kill the project? I don't understand the point here.

My personal feelings about the matter is that having an LLM rewrite the entire thing as an experiment and then just going with it a few weeks later kills any incentive for a community to build up around it. It's a clear signal that every basic aspect of the runtime can change on a whim. I don't care about meh Zig being rewritten to bad Rust if it does the same thing, but taking what is presented as" look at this funn…

> taking that into production with barely any announcement is what kills off the interest to me.

Did Bun v1.4.0 release weeks ago and I missed it? I would call a formal release the point that it goes "into production", and I think dogfooding it via Claude Code is yet another form of testing Bun-in-Rust before the latter goes to casual users.

Post reply on HN