4 ms·
> - I don't think Claude Code is using the Rust version yet in their official build No, I'm pretty sure it is, actually, since June 17: https://code.claude.co
by Wowfunhappy 3mo ago
> - I don't think Claude Code is using the Rust version yet in their official build
No, I'm pretty sure it is, actually, since June 17:
https://code.claude.com/docs/en/changelog#2-1-181 https://code.claude.com/docs/en/changelog#2-1-181
>> Upgraded the bundled Bun runtime to 1.4
Now, Bun 1.4 doesn't seem to officially exist on https://bun.com/blog https://bun.com/blog or https://github.com/oven-sh/bun/releases https://github.com/oven-sh/bun/releases, so I can't be 100% sure this is the Rust version. However, I have to do some patching of the Claude Code binary to get it to run on my OS, and version 2.1.181 coincided with some changes that make suspect it's using Rust now.
- andai 3mo agohttps://news.ycombinator.com/item?id=48609168 https://news.ycombinator.com/item?id=48609168 https://grigio.org/bun-1-4-the-controversial-ai-driven-rewrite-from-zig-to-rust/ https://grigio.org/bun-1-4-the-controversial-ai-driven-rewri... > 13,044 unsafe blocks in the resulting Rust code (hand-written Rust projects of similar size average ~73) Grok is this true? I've heard the meme that AI written rust code is absurdly full and safe blocks but... that's pretty funny. Hang on. A claim like that can be verified with a single grep! Give me a minute... $ rg -U "unsafe\s+\{" . | wc -l 10551 Hey, that's progress!
- gpm 3mo ago> I've heard the meme that AI written rust code is absurdly full and safe blocks but... that's pretty funny. If I understand what happened here correctly this isn't really a case of any such meme, but the result of the porters (heh) telling the LLM to directly convert zig code using unsafe to match the previous code "exactly". I.e. more like using the LLM as a fancy version of c2rust [1] (which would result in just as much unsafe) than a result of LLMs reaching for escape hatches too liberally. [1] https://github.com/immunant/c2rust https://github.com/immunant/c2rust
- LtdJorge 3mo agoCounting instances of "unsafe {" is pretty useless. Unsafe is needed in "safe" code. What it allows is to create a boundary where the caller is the one that uphelds the contract. If the unsafe is in an internal library, it’s much more difficult to misuse.
- raincole 3mo agoIt's unironically a good practice when you port from an unsafe language (C/Zig) to Rust. Porting isn't refactoring. One should keep the logic mapping one-to-one as much as possible. The high number of unsafe blocks is a good sign.
- baq 3mo agoThis is ironically a skill issue in prompting, especially if they had Fable access - or, more likely, they just really, truly don’t care.
- Wowfunhappy 3mo ago...but isn't Zig code entirely unsafe? I've never understood why people make fun of Rust code that has lots of unsafe blocks. Obviously, the goal is to reduce those blocks, but consider also the number of safe blocks!