logoalt Hacker News

petcattoday at 6:43 PM4 repliesview on HN

Cool you can just search specifically for potentially unsafe code in Rust. How do you search for unsafe code in Zig? Or do you just have to assume it's everywhere?


Replies

dnauticstoday at 8:11 PM

In principle static analysis is possible. (Note: WIP)

https://github.com/ityonemo/clr

sobelliantoday at 7:55 PM

If half of your code is unsafe then unless you exercise tremendous discipline (Claude basically doesn't) you will just end up with a big ball of unsafe, peppered with hallucinations in whatever random documentary comments Claude decided to make. I doubt they enforced the confinement of unsafe to a specific architectural layer or anything like that.

Barrin92today at 7:24 PM

if half of your files in a million line codebase are unsafe that doesn't tell you much any more. Presumably the point of a Rust rewrite is that you actually make use of Rust's safety features in a coherent way.

But given the whole "let AI rewrite this for me" stunt nature of this project that was not going to happen because that would require well, actual thinking and a re-design. So now you have Zig disguised as Rust and a line-by-line port because the semantics of idiomatic Rust don't map on the semantics of Zig.

show 3 replies
VWWHFSfQtoday at 6:49 PM

[dead]