| ▲ | reliabilityguy 3 hours ago |
| Many 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. |
|
| ▲ | witx a minute ago | parent | next [-] |
| Yes this is a typical case of showing results fast. I wonder what the cost for the remaining 10℅ of debugging and fixing all the bloat will be. Not so cheap I am guessing |
|
| ▲ | furyofantares 3 hours ago | parent | prev | next [-] |
| They also would have produced a team of engineers that knows the Rust codebase. |
| |
| ▲ | busterarm 2 hours ago | parent [-] | | This is assuming your engineers don't leave for higher-paying roles elsewhere. The market might be cold generally but for engineers working at these frontier AI companies it's red-hot. And most executives are figuring this into their calculus right now because they were burned badly during COVID. Meta, Google, etc were loose with hiring and engineers flocked from their lower-paying companies in droves. The brain drain was real. One public company I was at lost nearly 2/3rds of their engineers and mostly to Meta (granted, they had other problems but it was mostly about money -- the offers were excessive). Then market conditions forced them to freeze hiring and they've had a slow exodus of senior talent since as the firefighting has become constant. AI adoption has only accelerated problems for them. We've taken this "only two years and then leave" philosophy to an extreme and now companies are totally justified in not investing in their engineers anymore. | | |
| ▲ | ambicapter an hour ago | parent [-] | | The job-hopping followed from companies not investing in their engineers, not the other way around. It was billed as the only way to get a promotion (which usually would come every 1-2 years). | | |
| ▲ | busterarm an hour ago | parent [-] | | I've been in this industry for a few decades at this point and I was around when this meme was started. It was purely about maxing your compensation because changing jobs nets you more than promotions & raises. I've never met an engineer in my life who truly earned a promotion every year and very few every two. Very few companies have org charts that even support that or have that many levels. This logic/advice only really applies at a few companies and people have adopted it no matter where they work. There's not enough growth/hiring at 95% of companies to even come close. The Peter Principle is also a real thing. Everyone's competence has a ceiling. There's even an implicit understanding of this that people at smaller companies have inflated titles and you typically rank them down 1-2 levels when hiring/acquiring at larger companies. Now I do agree that companies haven't been investing in their engineers, but that doesn't also mean this isn't a vicious cycle. Employers and employees are in a mexican standoff and things are only going to get worse until one side comes to its senses. Employers have all the leverage for it to not be them. For the vast majority of companies the average tenure of an engineer sits between 18 and 30 months. They're also mostly hiring young engineers in their 20s. As an employer what is your upside to making such investments before they're at least mid-career? A lot of people seem to want the world and offer nothing in return for it. |
|
|
|
|
| ▲ | Tinkeringz 3 hours ago | parent | prev | next [-] |
| I 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 3 hours ago | parent | next [-] | | I think they missed a $ sign, i.e. they meant $100k of tokens | |
| ▲ | rezonant 3 hours ago | parent | prev | next [-] | | This is where we've come to where people proudly proclaim using an AI to do what is a single line of CSS. | | |
| ▲ | d0mine 2 hours ago | parent [-] | | "centering div" is a classic problem (/trauma/meme) that sounds trivial but had no universal solution (until 2017?). |
| |
| ▲ | reactordev 3 hours ago | parent | prev | next [-] | | 100k tokens is your pre-prompt and your CLAUDE.md as well as a few files from your root. | |
| ▲ | moralestapia 3 hours ago | parent | prev [-] | | What a great joke. I will have to steal it for an upcoming AI tools meeting I have at work. Also, pretty clever as centering a div w/ CSS has been notoriously difficult to achieve. |
|
|
| ▲ | rcxdude an hour ago | parent | prev | next [-] |
| Would they have, in a year? The general plan of attack would likely still be the same: rewrite it in rust while keeping the structure as similar as possible, no matter how unidiomatic, then adjusting the design to make it more idiomatic to rust. Doing both at once is much harder. |
|
| ▲ | tcfhgj 2 hours ago | parent | prev | next [-] |
| I doubt file by file rewriting takes as much work as rewriting and refactoring the code - especially at this scale. |
|
| ▲ | irishcoffee 3 hours ago | parent | prev [-] |
| > produced idiomatic rust I keep seeing this. What is "un-idiomatic" rust? |
| |
| ▲ | TazeTSchnitzel 3 hours ago | parent | next [-] | | Rust contains the ability to do everything that C can, if you use `unsafe`. And a file-by-file rewrite in Rust from another language usually involves keeping the ABI and API between files very C-like (and unsafe). In practice this means that the result of a first pass this way has all the memory safety of C code, but with worse readability because Rust makes unsafe things less ergonomic. To actually get the safety benefits of Rust in a real way you have to rework those files to not treat eachother as C code. This is the interesting and the difficult part of a rewrite in Rust, and one that an unsupervised LLM rewrite is probably not even going to attempt. I don't think this latter stage has actually happened with Bun's codebase. The result of the Rust rewrite in Bun's case is actually less safe than the Zig it is replacing, especially because (I am told) a lot of the new Rust code is unsound (introducing UB). | | |
| ▲ | skeledrew an hour ago | parent [-] | | > one that an unsupervised LLM rewrite is probably not even going to attempt. Why not? A complete test suite exists, so it just boils down to "reimplement this code to reduce the number of 'unsafe' references, while keeping the tests passing" (the last part isn't even needed since Claude loves to run tests and linters anyway). |
| |
| ▲ | vessenes 3 hours ago | parent | prev [-] | | Presumably lots of stuff wrapped in 'unsafe'. I'm not a rust guy or a rust fan, and the last time I wrote something with Rust was like 7 years ago, but to my memory, because of how Rust manages mutability there are many access patterns that are Rust-specific; idiomatic Rust is going to use this patterns but they would be unlikely to show up in a language with a different type system / borrow checker / etc. etc. | | |
| ▲ | irishcoffee 3 hours ago | parent [-] | | So "unidiomatic" rust means, 'don't use these parts of the language even though they're first-class citizens?' How odd. Lot of mental gymnastics going on there. | | |
| ▲ | flohofwoe 2 hours ago | parent | next [-] | | The Bun author himself writes that the port is not idiomatic Rust: Do the rewrite that looks like we transpiled our Zig code to Rust. We can gradually refactor it to reduce unsafe usage and look more like idiomatic Rust after Bun v1.4 ships.
(from: https://bun.com/blog/bun-in-rust)The original version of Bun was already a line-by-line (manual) port of esbuild from Go to Zig (also mentioned in this post), so the Zig code already wasn't "Zig-idiomatic" and apparently riddled with problems. That doesn't inspire much confidence in the LLM-translated Rust version tbh. | | |
| ▲ | skeledrew an hour ago | parent [-] | | > That doesn't inspire much confidence in the LLM-translated Rust version tbh. And yet Claude Code, which is the primary consumer, continues to chug away without any issue (that I, as a fairly heavy user, have encountered). |
| |
| ▲ | williamdclt an hour ago | parent | prev | next [-] | | > "unidiomatic" rust means, 'don't use these parts of the language even though they're first-class citizens?' that is indeed a roughly accurate definition of what "unidiomatic" means | |
| ▲ | tribaal 3 hours ago | parent | prev | next [-] | | It's mostly the same in any general purpose programming language though, parts of the language features are meant (or became seens as) tools to be used in very narrow cases, which people less familiar with the language tend to "overuse". Eg. goto/jump, bare "except" statements in python, etc... In Rust, unsafe has its uses and is a first class language feature, but it certainly isn't idiomatic to use it to mimic access patterns from other languages (unless absolutely necessary). | |
| ▲ | ModernMech 2 hours ago | parent | prev | next [-] | | It means "don't misuse parts of the language in ways that circumvent best practices" one of which is "keep unsafe regions as small and few as possible" not "never use unsafe" | |
| ▲ | vessenes 2 hours ago | parent | prev [-] | | Meh. The (a major?) goal of Rust is this sort of type safety flowing down to memory bugs. Not every possible access pattern was known at the beginning, and generally they developed a philosophy of keeping the "unsafe" memory access patterns extremely bounded and heavily inspected. I think that's a fair and admirable goal. |
|
|
|