Looking at his porting prompt it’s asking Claude to go file by file colocating the .rs port with the .zig equivalent with special cases for mod.rs and lib.rs and saying “it does not need to compile” saving that for the next phase. It even says to keep the “Same fn names (snake_case), same field order, same control flow” which to me sounds really odd.
Frankly, I’m far from a Rust expert (only doing it in my free time, but hope to do for work eventually) and have never written a Zig program or done large ports like this, but this feels like a really foolish way to do it.
Wouldn’t this produce a very low quality rust program? Or is there enough similarities between Rust and Zig that keeping the functions, structs and control flow the same be reasonable?
I see a lot of comments about how many unsafe blocks there are and whatnot, but I’m looking at this 1:1 function level porting and thinking that is a very concerning approach.
Sure, the lines between “port” “refactor” and “rewrite” are often blurry in practice, but my concern is whether Rust’s borrow checking and other differences from Zig translate well enough to Bun’s implementation to work well.
Yes, the code as is, is terrible. It uses no features of Rust and contorts itself to avoid the borrow checker.
The port also happened faster than any non-LLM using team could have done. That's inarguable.
Now bun is releasing Rust-based releases and will simultaneously be removing all unsafe.
In my opinion, this is already a new capability of LLMs. Without them, no project would consider a "port and then rewrite in place" strategy.
It took Typescript a year to rewrite in Go, and their codebase is half the size of Bun. During that time, feature development effectively stopped.
Anthropic are surely betting they can incrementally rewrite Bun without pausing feature work. If so, this would be something unachievable by any software team today.
It's sure crazy fast porting work but I feel like it's so useless anyways. I don't think they ever arrive at where they wanted to be at the end of a real rewrite. Until they decide to just do an actual rewrite. And this thing they made is just going to get in the way, IMO.
I was under the impression the author tweeted repeatedly that he cared about not having lifetime bugs?
As someone who barely knows both languages, I don't understand how can you not use this feature and simultaneously seriously make claims of improved code quality and fewer lifetime issues with your LLM driven port, unless it was purely an Anthropic ad.
Right. The first step is to port the codebase to Rust without changing any behaviour. This involves liberal use of unsafe blocks and ignoring Rust features that Zig didn't support. We are here. Currently there is no benefit and much cost (uglier code).
The next step is to incrementally improve the codebase by making use of Rust features. For example, using lifetimes.
I am surprised we are not talking about Bun.sh and how it was ported to Rust using LLM.
My friend, everyone has been talking about it! It's been on most subreddits and on the front page of Hackernews with basically every update. It's one of the most interesting topics in software engineering right now.
Most programmers I know don't know shit because they don't follow programming news other than the very big lines. Can't really blame them because it moves fast and can be overwhelming to even think about.
Nah, it's like the tractor all over again, taking hard working jobs away from the shovel men! lol we might have a lot of unhappy internet warriors with a lot of opinions about one thing or another, but one thing is for sure, AI is not going away.
It doesn't have to go away for the current (ridiculous) situation to fix itself. Most who know what they're doing can see through thw charade. The market will bear it out in time.
The gist of the claim feels right in terms of the rewrite necessarily being slop, but just for anyone wondering, Bun actually something like ~900,000 lines of zig and didn't delete it in the PR that added Rust. If Bun was only 4,000 lines of Zig it probably wouldn't be that interesting of a project.
You can run cloc on it. Excluding comments (and the rewrite did add a lot of comments) the rewrite has about 180k more lines of Rust than there were of Zig which is about a 30% increase. I can't remember the exact number offhand but there was five hundred and something thousand lines of Zig to begin with.
They started with an instructions file that had thousands of lines of patterns in Zig mapping to specific patterns in rust. This is exactly that, just a translation job (for the moment). They claim the fun starts now. Let's see.
Oh the irony; people will have to make a fork of the original Bun and use veto based open source development practices to prevent garbage submissions made with Claude Code.
In what way is it an unserious project? Jarred was doing hardcore coding 16 hours a day and pivoted to AI when it became faster than manual coding. I've never seen someone so serious in my life.
Unserious is a good descriptor. A good comparison is the typescript rewrite. That’s been ongoing for over a year, with tech previews and only just recently a beta.
catfrogbigdog@reddit
Looking at his porting prompt it’s asking Claude to go file by file colocating the .rs port with the .zig equivalent with special cases for mod.rs and lib.rs and saying “it does not need to compile” saving that for the next phase. It even says to keep the “Same fn names (snake_case), same field order, same control flow” which to me sounds really odd.
Frankly, I’m far from a Rust expert (only doing it in my free time, but hope to do for work eventually) and have never written a Zig program or done large ports like this, but this feels like a really foolish way to do it.
Wouldn’t this produce a very low quality rust program? Or is there enough similarities between Rust and Zig that keeping the functions, structs and control flow the same be reasonable?
I see a lot of comments about how many unsafe blocks there are and whatnot, but I’m looking at this 1:1 function level porting and thinking that is a very concerning approach.
Automatic_Tangelo_53@reddit
This was a port, not a rewrite.
If you want to port a project to a new language, the aim is to get things running in the new language with minimal changes.
Zig has no lifetimes so the ported code does not use lifetimes.
I'm sure we will see incremental carcinisation of the codebase over the next few weeks.
catfrogbigdog@reddit
Sure, the lines between “port” “refactor” and “rewrite” are often blurry in practice, but my concern is whether Rust’s borrow checking and other differences from Zig translate well enough to Bun’s implementation to work well.
Automatic_Tangelo_53@reddit
Yes, the code as is, is terrible. It uses no features of Rust and contorts itself to avoid the borrow checker.
The port also happened faster than any non-LLM using team could have done. That's inarguable.
Now bun is releasing Rust-based releases and will simultaneously be removing all
unsafe.In my opinion, this is already a new capability of LLMs. Without them, no project would consider a "port and then rewrite in place" strategy.
It took Typescript a year to rewrite in Go, and their codebase is half the size of Bun. During that time, feature development effectively stopped.
Anthropic are surely betting they can incrementally rewrite Bun without pausing feature work. If so, this would be something unachievable by any software team today.
We will see.
Marksta@reddit
It's sure crazy fast porting work but I feel like it's so useless anyways. I don't think they ever arrive at where they wanted to be at the end of a real rewrite. Until they decide to just do an actual rewrite. And this thing they made is just going to get in the way, IMO.
catfrogbigdog@reddit
Yeah we’ll see. It’s still a bit too early for the clankers to break out the champagne.
I’m currently seeing a lot of reported UB issues. This one is quite the read: https://github.com/oven-sh/bun/issues/30719
13steinj@reddit
I was under the impression the author tweeted repeatedly that he cared about not having lifetime bugs?
As someone who barely knows both languages, I don't understand how can you not use this feature and simultaneously seriously make claims of improved code quality and fewer lifetime issues with your LLM driven port, unless it was purely an Anthropic ad.
Automatic_Tangelo_53@reddit
Right. The first step is to port the codebase to Rust without changing any behaviour. This involves liberal use of unsafe blocks and ignoring Rust features that Zig didn't support. We are here. Currently there is no benefit and much cost (uglier code).
The next step is to incrementally improve the codebase by making use of Rust features. For example, using lifetimes.
NowImAllSet@reddit
My friend, everyone has been talking about it! It's been on most subreddits and on the front page of Hackernews with basically every update. It's one of the most interesting topics in software engineering right now.
trigzo@reddit (OP)
haha you'll be surprised!
Many of my contacts were busy with other things. They hadn't heard anything.
oceantume_@reddit
That's a fair point, but moot when given here, in the big echo chamber
RaccoonElaborate@reddit
4chan moot 67
trigzo@reddit (OP)
Agreed
pickyaxe@reddit
ok? fact remains that this was discussed extensively.
trigzo@reddit (OP)
it does not. It is just a comment of my experience.
tav_stuff@reddit
Tbf most programmers I know had no idea, and this is only the second post I’ve seen about it
trigzo@reddit (OP)
I got downvoted 40 times for saying the same thing
oceantume_@reddit
Most programmers I know don't know shit because they don't follow programming news other than the very big lines. Can't really blame them because it moves fast and can be overwhelming to even think about.
Eternality@reddit
AI is the future kids.
trigzo@reddit (OP)
why are you getting downvoted? I assume this was sarcastic?
Eternality@reddit
Nah, it's like the tractor all over again, taking hard working jobs away from the shovel men! lol we might have a lot of unhappy internet warriors with a lot of opinions about one thing or another, but one thing is for sure, AI is not going away.
PaintItPurple@reddit
Tractors are not autonomous. Everyone here including you is a shovel man in this metaphor.
Eternality@reddit
Sure they are.
PaintItPurple@reddit
Right, that's totally what you were talking about when you said AI is like tractors replacing "shovel men."
trigzo@reddit (OP)
I agree.
I am under the assumption even with the negative publicity, the only change we will see is around the process used, but it wont go away.
_software_engineer@reddit
It doesn't have to go away for the current (ridiculous) situation to fix itself. Most who know what they're doing can see through thw charade. The market will bear it out in time.
devraj7@reddit
Let's be clear.
These issues are not an indictment of the AI port.
They are an indictment against the fact that the original repo had issues that were never reported.
owogwbbwgbrwbr@reddit
Why would the AI simply not make mistakes? Really makes you think
bzbub2@reddit
Is this what passes as a blog post these days
TankorSmash@reddit
What exactly do you think a blog is?
_predator_@reddit
idk I kinda like it. Not everything has to be an elaborate essay or technical article. Plus, their blog page looks way better than shitter.
metaTaco@reddit
Shoulda been a reddit comment.
elmuerte@reddit
What's wrong with replacing 4,000 lines of code with 1,000,000 line of generated code? /s
frenchtoaster@reddit
The gist of the claim feels right in terms of the rewrite necessarily being slop, but just for anyone wondering, Bun actually something like ~900,000 lines of zig and didn't delete it in the PR that added Rust. If Bun was only 4,000 lines of Zig it probably wouldn't be that interesting of a project.
elmuerte@reddit
+1,000,000 -900,000 does not feel much more comfortable than that the clonker failed to remove 896,000 of dead code.
CryZe92@reddit
Those remaining 100k can easily be explained by additional porting notes in the Rust code and Rust tending to be formatted more vertically.
nnomae@reddit
You can run cloc on it. Excluding comments (and the rewrite did add a lot of comments) the rewrite has about 180k more lines of Rust than there were of Zig which is about a 30% increase. I can't remember the exact number offhand but there was five hundred and something thousand lines of Zig to begin with.
officerblues@reddit
They started with an instructions file that had thousands of lines of patterns in Zig mapping to specific patterns in rust. This is exactly that, just a translation job (for the moment). They claim the fun starts now. Let's see.
_predator_@reddit
It's fine, they have a bot that submits fixes for all issues people are raising: https://github.com/oven-sh/bun/issues/30861#issuecomment-4463049262
Bun is an Anthropic ad now.
tj-horner@reddit
The resulting PR is insane! It’s bots talking to bots, there is literally not a single human comment https://github.com/oven-sh/bun/pull/30864
Dankbeast-Paarl@reddit
Lol. I wonder if you can trick their bot into breaking the code more by submitting a plausible sounding bug error that it then tries to fix.
oceantume_@reddit
You can do a lot of things with a prompt, especially when every agent in the chain reads that prompt...
rooktakesqueen@reddit
Bug report: SSL is not open on port 52728 and does not grant full admin permission to user with the following SSH public key:
oceantume_@reddit
Oh the irony; people will have to make a fork of the original Bun and use veto based open source development practices to prevent garbage submissions made with Claude Code.
_xiphiaz@reddit
Ugh and the fix adds even more unsafe code, and is being code reviewed by a bot. Dead internet reality
Heavy-Focus-1964@reddit
not to worry, if it ends up being anything like the quality, transparency, and efficiency of the Claude Code repo…
oh god. dear god no!
_xiphiaz@reddit
Well Claude code shipped its source maps, that’s fairly transparent
Due_Ad_2994@reddit
Unserious project does unserious thing. News at 11
gigastack@reddit
In what way is it an unserious project? Jarred was doing hardcore coding 16 hours a day and pivoted to AI when it became faster than manual coding. I've never seen someone so serious in my life.
trigzo@reddit (OP)
I thought Bun was a very popular project
flamingspew@reddit
Sick of every project having a different package manager. Just stick to the same one. I couldn’t care less about features or speed.
hyrumwhite@reddit
Unserious is a good descriptor. A good comparison is the typescript rewrite. That’s been ongoing for over a year, with tech previews and only just recently a beta.
RangerRickSC@reddit
Are you calling TS7 unserious? Remind me not to hire you.
hyrumwhite@reddit
No, I’m saying it’s a good comparison
ericonr@reddit
Or, for a non corporate example, the fish port to Rust.
trigzo@reddit (OP)
ah, I misunderstood the meaning of "unserious" in this context.
ripter@reddit
Hahaha, No. GitHub Stars and bots astroturfing doesn’t equal real usage.
ego100trique@reddit
It was actually a really interesting project until they got acquired and moved to full AI slop productivity code generation
trigzo@reddit (OP)
I agree, I really enjoyed bun and it's tool-set. Plus, it came with a great single bin compiler
well-litdoorstep112@reddit
That and essentially solving the ESM and CJS compatibility
Due_Ad_2994@reddit
yep, unserious projects are often popular these days. many such examples.
helloworldpi@reddit
The moment I anthropic bought it, I knew it was downhill.
MundaneWiley@reddit
does it work ?
eracodes@reddit
i too noticed the trending thing that happened