upvote
> - 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

>> Upgraded the bundled Bun runtime to 1.4

Now, Bun 1.4 doesn't seem to officially exist on https://bun.com/blog or 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.

reply
https://news.ycombinator.com/item?id=48609168

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!
reply
> 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

reply
It'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.

reply
Counting 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.
reply
This is ironically a skill issue in prompting, especially if they had Fable access - or, more likely, they just really, truly don’t care.
reply
...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!

reply
I agree Claude Code is seemingly (currently) not very well-engineered but I think you may be moderately underestimating how complicated it is/necessarily has to be.
reply
What are those complications?

Last I heard Claude Code devs were trying to compare their app to a game engine or rendering system.

This was summarily ridiculed. Are you saying that writing a game engine is easier than writing Claude Code?

reply