10 ms·
How is the Bun rewrite in Rust going?
- brap 3mo agoIf you’ve ever worked at a tech company you already know the answer without reading any further
- tomlockwood 3mo agoAuthor here: An apology on the graphs, they just count rust files touched in commits, not total commits. So if there were two commits and one touched 3 .rs files and another touched 2, it'd be counted as 5 for the purposes of the graphs. I may fix this later but, yeah.
- alienbaby 3mo agowhat kind of difference from the actual numbers does it result in?
- tomlockwood 3mo agoNot sure! I cludged together a counter using git log. I could go back and redo it but I think the number would serve my point either way.
- hahahaa 3mo agoHope you find that job :) nice work experience, looks very ethical focused.
- abalashov 3mo agoI did suspect that the triumphalist pronouncements, and even the seemingly honest and forthright deep dive, were a little premature. This is a key problem with LLM exuberance: it's very tempting to trade on decades of experience in software using LLMs, because one is tired of typing and manual figuring-out, it seems to work if you're competent, and the payoff is essentially immediate. The real bill comes in the mail much later.
- yuye 3mo ago>because one is tired of typing I consider typing to be secondary to software engineering, but I do concede that for those cases that typing really is the bottleneck, LLMs can certainly be of value. Those cases are rare, though.
- abalashov 3mo agoOh, I 100% agree. I'm imagining the case where someone asks an LLM to do trivial things just for the novelty, or because they are fatigued of thinking + typing, but conceptualise the thing they are putting off as primarily a problem of typign and not thinking (I often do that).
- krupan 3mo agoThis is so real now that we have LLMs. The stuff I'm working on doesn't seem to exist in LLM training sets, but I still get tempted to try when I get tired of doing the tedious parts.
- reliabilityguy 3mo agoMany repeat the point of “$165k is cheaper than team of multiple engineers working on the rewrite for a year”, which I think is flawed — the team of engineers would have produced idiomatic rust, and it would take probably 100k+ of tokens more to make the bun in rust idiomatic rust.
- Tinkeringz 3mo agoI feel your estimate of tokens is a few orders of magnitude off, it’s on the low side. I use more (albeit cached) when centering a div.
- Hasnep 3mo agoI think they missed a $ sign, i.e. they meant $100k of tokens
- reactordev 3mo ago100k tokens is your pre-prompt and your CLAUDE.md as well as a few files from your root.
- rezonant 3mo agoThis is where we've come to where people proudly proclaim using an AI to do what is a single line of CSS.
- d0mine 3mo ago"centering div" is a classic problem (/trauma/meme) that sounds trivial but had no universal solution (until 2017?).
- rezonant 3mo agoAnd has a dead simple one today. Also worth noting simple horizontal centering of divs was never a problem, margin: auto was defined in CSS Level 1 in 1996 [1]. It was vertical centering that took a very long time to crack, which really became trivial with Flexbox which was first drafted in 2009[2] but became available unprefixed in browsers between 2012 and 2014 [3] about 13 years ago. [1] https://www.w3.org/TR/REC-CSS1-961217 https://www.w3.org/TR/REC-CSS1-961217 [2] https://www.w3.org/TR/2009/WD-css3-flexbox-20090723/ https://www.w3.org/TR/2009/WD-css3-flexbox-20090723/ [3] https://caniuse.com/flexbox https://caniuse.com/flexbox Subnote: I'm not counting the display: table hacks.
- muglug 3mo agoThis post doesn’t make sense. It was rewritten in Rust. The rewrite itself is complete (no more Zig). Various people have claimed that Bun in Zig had a lot of tech debt. If they’re to be believed, it seems natural to assume the rewrite does, too. Perhaps all this activity is paying down some of that debt.
- abalashov 3mo ago> Perhaps all this activity is paying down some of that debt. Perhaps. But were that the case, one would think they'd be quite eager to say so.
- muglug 3mo agoMaybe they will! Are you expecting them to live-tweet their work or something?
- tough 3mo agojared was OK making this rewrite as an experiment branch in the public why shouldnt upcoming work be as public as the rewrite itself was?
- skeledrew 3mo agoYou may continue to hold your breath. You may die as a result. The maintainers continue to do what they want regardless.
- tough 3mo agoI do not really care, just pointing where people's assumptions might be coming from. The beauty of FOSS tho is Jarred owes the community nothing, and anyone can fork bun previous to migration and keep maintaining it on zig if they so wish. long live open source
- abalashov 3mo ago
- deleted 3mo ago[deleted]
- vortegne 3mo agoI didn't follow the thing too closely when it happened. Sure, I was aware of the big picture. But wow, I didn't expect that after all this noise there still hasn't been a release? That's just crazy to me. I shouldn't be surprised though, of course. Giving any credit or slack to a high-valuation LLM company is a silly endeavor.
- deleted 3mo ago[deleted]
- jeltz 3mo agoIt was expected. These LLM rewrites seem to work amazingly at first and then you realize there is a ton of work remaining.
- yearesadpeople 3mo ago> _"...Canny..."_ What a time to be alive
- rob74 3mo agoYeah, I noticed that too and kept wondering who this Canny was that the author wants to be? Felt a bit un-Canny...
- tomlockwood 3mo agoMore proof that it was written by a human!!!
- whobre 3mo agoStill have no idea what that means…
- arcwhite 3mo agohttps://www.merriam-webster.com/dictionary/canny https://www.merriam-webster.com/dictionary/canny It means shrewd. E.g. we should keep our wits about us when someone is making big hyperbolic claims about LLM that they directly benefit from, because maybe they have a motive to mislead either themselves, or us
- nchmy 3mo agoCame to point this out as well. Very bizarre that it was capitalized. Italics or bold might even have been acceptable...
- SquareWheel 3mo agoI'm not sure how much insight we can glean from looking at the number of commits and release cadence here. In the aftermath of such a major refactor/rewrite, I would expect it to take some time to get back up to their usual development speed. Jared and the other developers are new to the Rust codebase, even if the structure is largely familiar. They're also likely focusing on other priorities right now such as tracking down instances of 'unsafe', rather than making user-facing changes (which might encourage a release). Bugfixes could encourage rapid new releases, but perhaps the rewrite simply hasn't been very buggy? As far as I know, those on the canary channel haven't reported any major issues, or even really noticed the change. So perhaps there's little reason for new releases right now, as the team slowly churns through the backlog. > P.S. Anthropic’s C compiler and Cursor’s FastRender web browser haven’t had any commits for months. I always assumed those were just experiments in capability, and weren't meant to be ongoing projects. I would hope that nobody is using them directly today.
- usef- 3mo agoThey also have made a release, in a sense, since they moved all Claude code users to it a month ago. (And apparently no one noticed). I think they're taking things "gradually" as they are under a lot of scrutiny and no rush for full release.
- flohofwoe 3mo agoClaude Code most likely only uses a tiny fraction of Bun/Node features, so Claude Code switching to the Rust rewrite doesn't mean all that much.
- klausa 3mo agoLook, I understand being skeptical of the whole process; the discourse about this has been extremely tiring. But at some point if “moving one of the biggest actively maintained and used codebases to it without anyone noticing” is dismissed as “it doesn’t mean all that much”, then we’ve lost the plot a little bit somewhere.
- deleted 3mo ago[deleted]
- deleted 3mo ago[deleted]
- losvedir 3mo agoI'm not sure Anthropic even cares about "releasing" the next version. The rust one has been in use in Claude Code for more than a month now, used by millions of people, and that's as far as they probably really worry about it. They bought Bun for Claude Code and I doubt the open source project matters to them otherwise.
- usef- 3mo agoI very much doubt they would want to abandon the wider community. They do benefit from others using it. To the contrary, I think any problem with this release would be jumped on harshly so they're being more careful than usual. There's not a rush for the community to move to 1.4 and any issues could poison the community trust.
- rienbdj 3mo agoAnyone know why? Can’t CC run on any JS runtime?
- jFriedensreich 3mo agobecause their js code is so bad and slow that they need the bun performance hacks and optimisations.
- jdiff 3mo agoDo these hacks make bun less secure than other runtimes? I find it a little hard to believe you can get much more robust and performant than V8 or SpiderMonkey without cutting some corners that notably went uncut by either for all these years.
- amazingamazing 3mo agoWhy did they buy an open source project anyway? If is not “officially” supported why not fork and use? Claude code is probably the most used anyway
- deleted 3mo ago[deleted]
- jeltz 3mo agoThey bought the maintainers, not the code.
- amazingamazing 3mo agoWhy though? Isn't AI supposed to take care of such things?
- atonse 3mo agoBecause even when the AI is really good at writing code, you still have to know what to ask it, how to direct it, have product taste, etc. Otherwise all of us would just be able to build bun via a prompt.
- quikoa 3mo agoTo me it just looks like a marketing stunt.
- deleted 3mo ago[deleted]
- benjiro29 3mo agoI really do not understand how software developer think anymore. Using a LLM to translate a project in a short time, is by itself incredible. Just like one-shot whatever office clone. But what makes software is not the fast creation of a "product" but that actual development of its features. Figuring out how everything needs to work together, fixing the bugs, and the o so boring UI work. I have used LLMs to create stuff like word clones just for fun. It was a disaster. Sure, it had the basic functionality. But the moment you started with page structure (harder then one non-stop scrolling page), tables, images, rotating, and so many details that make up just the basics of word. Not even the extended functionality. You see every LLM just fall on its face. Sure, i can clone sqlite from c to rust. Hell, i may even get it to do all the tests 100%. But there is a 99% chance that the clone will be slower, as it lacks the years of optimizations from the original language. There will be new bugs because of the language changeover. There is a need for future support and fixes. People threat software like its something it is not. But unlike the past where your clients question your sanity for charging 100k for a piece of software. Not understanding its not just about writing the code. Now those expectation are even more pushed forwards, because of articles like this. I constantly see software being published on reddit that does X, Y, Z only for the authors to abandon it as fast as they vibe coded it. Because fixing bugs is NOT sexy. Even with a LLM at your fingertips. Dealing with nagging users, is not sexy. Dealing with security issues, is NOT sexy. Dealing with data structure / databases, especially as your system changes ... you get the point. Not understanding to the core the software you wrote, is going to exploded in your face. This is why these stupid "we rewrote X into Z with a LLM in Y days" mean nothing. Its one thing to get a head start using this trick, its another to actually learn the code of your rewrite. And dedicated the time into maintaining the port, growing it, fixing it. This is where a lot of software fails. But now this crap is out there, instead of the maintained version of Zig, now we have a unmaintained Rust version that clouded the airwaves because if people now search for it, those articles "X in Z days" will pop up. What have we become ...
- furyofantares 3mo ago> I have used LLMs to create stuff like word clones just for fun. It was a disaster. Sure, it had the basic functionality. But the moment you started with page structure (harder then one non-stop scrolling page), tables, images, rotating, and so many details that make up just the basics of word. Not even the extended functionality. You see every LLM just fall on its face. What do you think of https://scramblequest.app https://scramblequest.app and https://wordpeek.app https://wordpeek.app ? I have never looked at any of the code for them edit: Yeesh, misread your comment as "word games" not "word clones" and was very confused about the claim. Probably should have noted my confusion and re-read.
- xiphias2 3mo agoEverybody who has rewritten software understands the current phase: it mostly works, but there are always things to fix to make sure that there are no regressions, and the pressure is huge for any release. I still believe it was the good decision, but I also know that I wouldn't be the first person to run the release in prod. I think Jarred should start making release candidates instead of releases to take some of the pressure off.
- IshKebab 3mo agoThis doesn't answer the question posed in the title unfortunately. I am none the wiser about how it's going. The author just speculates that the rewrite isn't actually complete.
- tomlockwood 3mo ago> I am none the wiser about how it's going. You and me both friend!
- internet2000 3mo agoI don't get it. Because they haven't cut a new arbitrary version number, we're denying it got done (in their perspective) and being used in a massive product already? If you're being pedantic, no it's not "done," but nothing ever is.
- skydhash 3mo ago> and being used in a massive product already? One single product, AFAIK, and one ladden with bugs and issue too.
- joks 3mo agoIt's not "done" if it's not stable and released. It's being canary tested by Claude Code users essentially but it's still being heavily worked on with tons of $ being poured into it and there's still no sign of them considering it stable and ready to go. That's the point of the article.
- pu_pe 3mo agoI am fascinated by the discourse around this Bun rewrite. I read a lot of drama and personal accusations, there are pieces like this one trying to extract clues, and it seems everyone has a deeper ideological concern behind whatever they are trying to say. For this article, it seems to be skepticism towards AI and how successful it can be at replacing programmers. Other takes, like the one from the Zig maintainer, were also along those lines but more about the open source ethics and the future of that in a LLM world. I am mostly bullish on AI capabilities, so from my perspective I don't see why we should be skeptical that frontier LLMs guided by experienced devs can translate whole libraries like that. Good follow-up questions would be how expensive it currently is to do so, and whether we will see people branching into all-in on AI versus no-AI camps as happened in this case.
- vdfs 3mo ago> experienced devs No one on their team had Rust experience
- dogleash 3mo agoYou see this response because the port of Bun from Zig to Rust does not have anything to teach us about Zig, Rust or porting between languages with LLMs. There are so many non-quantifiable properties to evaluate of the 'before' and 'after' codebases. Choices and preferences to be had about languages, language porting in general, and LLM coding. After all that, pretend we could have a clear convincing distillation of the port and want to go apply the lessons learned. If someone doesn't get LLM porting results as good as Bun did, or it cost them substantially more in tokens, then they're "holding it wrong." If someone is underwhelmed by Bun's results, then it was just a proof of concept and the models have gotten so much better in the last 6 months anyway you can't compare.
- GhastBartender 3mo ago> so from my perspective I don't see why we should be skeptical that frontier LLMs guided by experienced devs can translate whole libraries like that There's a laundry list of reasons to be skeptical about LLM results in general. The biggest one is that LLMs are excellent at creating output that looks right but is nevertheless still wrong. In this particular case, there's also a specific reason: This is obviously a marketing stunt regardless of whether the claimed results hold up. Anthropic has a long history of just lying and making shit up, so any results are subject to extra scrutiny.
- z0ltan 3mo ago[dead]
- CrzyLngPwd 3mo agoJust a couple more 100hr weeks of debugging, and the last 80% will be done :-)
- germandiago 3mo agoFor me this is how all workflows with AI end up lookingif you really want robust products. Do whatever with AI, go fast (from the point of view of perception, initially) BUT it is not going to work without extra work. and ho, the bloat, do not forget the bloat, which is technical debt towards the future. I am not anti-ai per-se, but I consider the software I write as a prouct to add features to and maintain over time. So in this case I think it is not wise to say that bc you got something impressive fast you are done. Now you have bugs, architecture, bloat removal, and others... Letting an AI manage all the workflow is a recipe for disaster in anything that is not strictly short-term. For this reason, I hardly code one-off scripts myself anymore and I hardly use AI for big things besides discussions with the prompt, reviews and snippets. For adding tests it can also be useful. For full, long-term products, they try to sell agents, and tokens and the like. I think they do not work well enough what I tried. It always ends up as a bloated unmantainable mess. Unless something that is totally autonomous (by this I mean 100% autonomous) and automated ever exists, I see writing software that can be maintained by humans still critical. As long as this exists, the productivity upper bound will be that of humans reviewing and driving the workflow, even if with AI support.
- mawadev 3mo agoI'm gonna say it bluntly: I don't care about bun, never cared about bun and think nodejs is sufficient. The drama surrounding zig and rust still leaves me with a bad taste because I also don't like how nonsensical topics like that influence what we do and what we (have to) care about on a day to day basis. That is just my opinion!
- podgorniy 3mo agoMechanisms of beliefs, sense of identity and pride are behind of majority of projects including opensource. These are the same mechanisms which produce what you call "drama". We can't have commited and involved people working on opensource stuff and simultaneously avoid drama when their sence of identity/beliefs/pride is devalued.
- ifwinterco 3mo agoSomething about bun always rubbed me up the wrong way (I even hate the name), but I couldn't really explain why. Thankfully now I have some good material to post-rationalise my intuitive dislike
- luciana1u 3mo ago[flagged]
- tomlockwood 3mo agoThat's absolutely correct!
- Iridescent_ 3mo ago"Nobody knows" is not a neutral sign however, Anthropic should be able to provide that visibility
- nickcw 3mo agoMaybe it would have made more sense for Anthropic to rewrite Claude Code in rust, and cut out the middle man (bun)?
- leobuskin 3mo agoNope, they want shared artifact(s) between web and desktop (not sure what do they have in mobile apps) clients (Chat/Cowork/Code/CC-cli), so TS is the way to go. It’s a reasonable choice made by engineers.
- JackSlateur 3mo agoPretty sure rust can run on browsers;
- throwaway613746 3mo ago[dead]
- pmxi 3mo agoThe agent loop doesn’t run in the browser.
- il-b 3mo agoMaybe their “TUI-over-React” team doesn’t want to get fired because of AI, either?
- podgorniy 3mo ago> I hadn’t seen the numbers for the CI/CD costs of Buildkite, and as you might have noticed from above, some PRs were written by Anthropic employees. The leaked code of the claude had switch flag where claude pretends to be employee. You can't trust/expect that those PR's were authored by people.
- germandiago 3mo ago> some PRs were written by Anthropic employees Oh, that company that I heard did not use humans aymore to write software and bragged about it? I heard, correct me if I am wrong. Something does not match here...
- Xenoamorphous 3mo ago> we’re approaching $800k in money spent on this rewrite. That’s peanuts, if not the shells of the peanuts, for a project and company of this magnitude
- _pdp_ 3mo agoHow does that help 99.9% of all other companies though?
- Xenoamorphous 3mo agoSome thoughts: - just because it doesn’t help 99.9% of the companies today it doesn’t mean it won’t help them tomorrow - 0.01% of the companies employ a much bigger percentage of people - 99.9% of companies won’t need to do a project of this magnitude
- nevertoolate 3mo agoSo you think if a company can't spend 1 million USD on a rewrite which has almost zero impact on performance, possibly net negative on maintainability it also can't have 500k LOC codebase either? Oh come on...
- jraph 3mo agoThis rewrite is showcased by Anthropic to sell AI rewrites to other companies. If it turns out the rewrite cost stupid amounts of money and leads to a bad outcome, it's just a misleading ad. We developers now need to explain that to illuminated management and colleagues.
- tomlockwood 3mo agoOhhhhh for a world where that's peanuts for an open source project.
- khanhnguyen8386 3mo ago[dead]
- qarl2 3mo ago[flagged]
- insanitybit 3mo agoIt's pretty off topic/ irrelevant and it's self promotion.
- qarl2 3mo agoAn example of an LLM porting code is off topic to a project where the issue is entirely about an LLM porting code? Can you explain that more?
- insanitybit 3mo agoNo, I don't think it warrants explanation. If you think it's on topic, I'd suggest adding more context and relating it to the parent post rather than just linking to your own project.
- qarl2 3mo agoAh - my bad. I thought it was obvious that a toy project facing the same issues would be a good playground for experimentation on the topics being argued. Going forward, I will strive to not make leaps that my audience can't follow.
- Jarred 3mo agoBun’s Rust rewrite shipped in Claude Code over a month ago and barely anyone noticed. Claude Code is widely used. The Rust rewrite is going well overall. In the Bun v1.4 video, I promised a certain number of newly passing Node.js tests were added to force us to improve compatibility, and that number is not true yet. The release is delayed until it is true. The PRs to make it true are up but not merged yet. Most likely next Tuesday we’ll do the release of 1.4.
- up2isomorphism 3mo agoIf actually anyone noticed, then it is a pretty bad move. Also “going well overall “ does not answer the author’s observations either.
- lantry 3mo agoAny comment on the costs estimated in the article? especially the buildkite costs?
- Jarred 3mo agoCI has always been expensive for Bun including before the acquisition. We build for [macOS, Linux, FreeBSD, Android, Windows] x [ARM64, x64] and then run tests on multiple Linux distros with multiple shards, multiple macOS versions and Windows for each architecture. We recently started cross-compiling all the builds on Linux arm64 and that made it a little faster (I wrote a CLI tool to download the correct macOS headers for cross-compilation). We also have a daily cron job that asks claude to make the slowest tests faster while adding more assertions.
- JustSkyfall 3mo agoHow come Bun uses Buildkite instead of self-hosting the CI infra?
- simonw 3mo agoPresumably because they "build for [macOS, Linux, FreeBSD, Android, Windows] x [ARM64, x64]" and self hosting all of that would be time-consuming and expensive.
- simonw 3mo agoThis article could increase its credibility by being updated to acknowledge that Bun-on-Rust has been live in Claude Code itself since June 17th, and available as a canary release since it landed on main. Rewrites of this scale certainly justify long canary release periods!
- tomlockwood 3mo agoI mention Anthropic dogfooding this in the article.
- simonw 3mo agoIn this sentence, sure: > Anthropic is dogfooding this, the machine is still ticking along, and Anthropic employees are directly involved. The problem is that your article's central claim is that there hasn't been a Bun release since the Rust rewrite - which can be read as implying that the rewrite hasn't been used in production. But it's been used in production on millions of machines running Claude Code for over a month! I think failing to acknowledge that hurts the credibility of the article. It's been a heated discussion point in this thread already.
- tomlockwood 3mo agoI link to Jarred's writeup on bun.com, where you'll note he mentions that its being used on Prisma and Claude Code. I don't agree that using something in a very specific environment is the same as a wide release. I trust readers will either know the backstory or read the articles I link to. Such is life if they don't.
- simonw 3mo agoWhy are you resistant to adding a sentence to the article that notes that Claude Code uses the rewrite? Do you think it would weaken the article? When I said it would improve the credibility I did mean it. My instinct on reading the article this morning was "this person doesn't know that Claude Code runs on Bun, which weakens their credibility in presenting the argument they are making here."
- simonw 3mo agoOne metric I thought might be interesting with respect to the Rust rewrite is the number of "unsafe" occurrences in the code. I was optimistic those would be going down over time but it looks like they've stayed pretty constant: https://news.ycombinator.com/item?id=48966569#48967630 https://news.ycombinator.com/item?id=48966569#48967630
- pohl 3mo agoDoes that data exclude FFI wrappers, which necessarily must be unsafe? If not, don’t put much stock in it.
- simonw 3mo agoNo, it's a raw count. I get that there's a baseline of unsafe that's necessary, but I was under the impression that some of those unsafes were in places where they could be replaced by more idiomatic Rust at a later date.
- tomlockwood 3mo agoI don't think that's true. I think a fair chunk of them are places where Bun is handed a pointer by WebKit or something similar. I believe they write about this a little.
- insanitybit 3mo agoI think there's a reasonable expectation that unsafe could still be reduced by having shared, safer abstractions - that would lead to fewer `unsafe` results because the `unsafe` would be contained. I'm surprised that this isn't a higher priority target for them.
- Tehnix 3mo agoThe bun rewrite inspired me to be much more aggressive on porting code, rewriting code, or vendoring external dependencies to tailor them specifically to our needs in ways that doesn’t make sense to upstream. I feel like it made me generally more ambitious in what I’d throw at a coding model, but also made me focus a lot more on our testing harness and keeping a lot of it at the boundaries outside the language specific parts. Having been part of several huge rewrites before, some multi-year long, I definitely would consider bun’s rewrite an enormous success. To keep such a level of test and feature parity, and add improvements on top of it, is a massive engineering feat.
- bendmorris 3mo agoAs a comparison point, someone decided to try to fix the issues in the Zig original and is now claiming sub-second build times, plus fixed bugs, by modernizing the codebase and sticking with best practices - indicating that all of the issues that justified the rewrite were self-inflicted and addressable. https://ziggit.dev/t/buz-a-drop-in-replacement-for-bun-using-modern-zig-with-sub-1s-incremental-builds/16891 https://ziggit.dev/t/buz-a-drop-in-replacement-for-bun-using... I have no skin in this game, and the Zig version is also using LLMs if that helps take the culture war out of it. But, it has always been true in my experience that someone who really understands a problem space can outcompete someone who just throws resources (in hundreds of thousands of dollars of token spend) at it.
- jeremyjh 3mo ago> indicating that all of the issues that justified the rewrite were self-inflicted and addressable The main issue that justified the rewrite were memory bugs, especially related to interaction with GC managed Javascript objects. There is no fully general way to prevent those bugs in Zig, and I don't see any claims that they did so in Buz.
- bendmorris 3mo agoThey also complained about build times, and in fact the Rust rewrite started immediately after some other drama about Bun being unable to contribute back LLM-written changes to the Zig compiler to improve build times, and the Zig team rejecting them in principle. So while memory issues did become the focus later, I don't think it was the entire story. Migrating to Rust in a one-to-one translation with unsafe blocks does not make the code any more safe initially. It might provide tools to do a significant refactor that solves lifetime issues with Rust's help, but I haven't seen evidence that they've done that either. They're also embedding a large C++ codebase, JavaScriptCore, so there are always going to be unsafe areas and touchpoints where memory issues could live, and Rust won't magically solve them.
- qudat 3mo agoIt wasn’t just on principle that those changes were rejected, they also stated the bun changes were not actually that great or general enough to upstream.
- greenlimetea 3mo agoRust devs are so obsessed with writing things in Rust that Rust was re-written in Rust.
- jadar 3mo agoSelf-hosting a language used to be standard practice. These days that's become a bit more controversial, but I definitely wouldn't lump that in as a sign of obsession.
- pianopatrick 3mo agoAt what point should I trust projects like this? I've heard stories of LLMs changing tests to get all the tests to pass instead of actually fixing code. So I'm not sure I trust it just because tests pass. I also think that tests do not and cannot check everything. I also don't trust it just because it compiles in Rust. The Rust compiler does not check everything. So at what point do projects like this cross from "untrusted" to "trusted"?
- simonw 3mo ago> I've heard stories of LLMs changing tests to get all the tests to pass instead of actually fixing code. That's very easy to prevent. Don't let them edit the tests! Run the test suite against a reserved copy.
- pianopatrick 3mo agoThat makes sense to me as a tactic to prevent that problem. But the article talks about how so much code was written so fast. Seems to me that to create that much code that fast you have to have AI produce both the code and the tests. So I am not sure in this project if the AI can edit the tests or not. I assume that because this is Anthropic the AI is doing as much as possible, which would include editing tests.
- simonw 3mo agoBun had an enormous existing test suite written in TypeScript. Getting those tests to pass against the Rust version was the key thing that enabled the project. You can go and check if the AI edited the tests yourself: look at the git history of those files in the public Bun repository.
- skylurk 3mo agoBut Bun also implements the interpreter to those tests— doesn't that mean it has a lot of leeway to over-fit to them? It's not as clean as "don't change these files" in this case. In general I would agree though, and would take it one step further: the agent writing the source code should not even be able to see the tests, nor the agent writing the tests see the source code.
- knighthacker 3mo agoThere's probably a ton of intangible factors to this, but how do you measure the ROI on this?
- 7e 3mo agoThe Rust compiler suffers from a number of crash bugs and nondeterminism, and they won't accept AI diagnoses or fixes, so Rust has become an unreliable partner for software development. If you're going to do serious development with Rust, I suggest forking the compiler. Upstream your fixes to a fork which takes AI contributions, or fork your own. Or keep all of your improvements private, that works just fine.
- rao-v 3mo agoI don't quite understand the focus on the token cost of this rewrite. Obviously, we should examine if this rewrite is good, effective, good for the product etc., but the token cost seems ... not important? The marketing value of this to Anthropic (if Anthropic even cares, this might just be the Bun team selling past the close) is to show that such a rewrite is possible and delivers engineering value. If exactly this project is $800K today, it'll be $200K and then $80K soon, so it's not so important to the story that it's cheap, just that a big "cool" rewrite is possible, and delivers velocity to the buisness.
- lawn 3mo agoI'd say it's an important data point if you'd want to do something similar yourself.
- tomlockwood 3mo agoIt isn't clear to me that the price is worth it.
- orsenthil 3mo agoI think, we all are phrasing this wrong. Bun was <strike>rewritten</strike> retooled in Rust by AI with only ensuring integration tests and usage tests succeed. That's similar how to a C program was compiled to binary or Typescript was transpiled to Javascript and run. We didn't make a very big deal of it then, and I think, we should see this operation as a similar higher level source to source translation, which machines have been doing. Writing code is a different thing.
- rootnod3 3mo agoTranspiling and a LLM hallucinating some code that _somehow_ passes the tests is not really the same thing though.
- coderdatapoint 3mo agoI just got a github notification on an old Bun bug report when it was still coded in zig. The bun-bot had completely solved the bug in the new rust codebase, added comprehensive tests, did the write up, pushed the commit all without human interaction. The fix looked sound and changed minimal lines of code. This AI is the real deal. Programmers should be concerned.
- finngladstone 3mo agoJarvis, farm me some hn karma
- jadar 3mo agoThis doesn't answer the question it asks.
- smb06 3mo agoI do believe they were trying to use CodeRabbit to review their re-written code. https://www.coderabbit.ai/blog/ai-can-migrate-your-entire-codebase-reviewing-it-is-another-story https://www.coderabbit.ai/blog/ai-can-migrate-your-entire-co...
- syngrog66 3mo agoI've "seen enough" by now
- kazinator 3mo agoAny runtime written in a compiled language gets translated to completely different language in seconds every time it is built! That is what should already terrify you. :)
- Havoc 3mo agoI can see CI battling pretty hard with rusts slow compile times but not sure that is particularly conclusive of anything when it comes to the success of the rewrite
- tomlockwood 3mo agoJarred from Bun is in this comment section saying the rewrite isn't finished yet. I therefore don't consider it a failure or a success. I'll be keen to see how much the CI cost though since that's a part of the cost of the rewrite.