logoalt Hacker News

vrighter • yesterday at 11:58 AM • 9 replies • view on HN

[flagged]


Replies

roblabla • yesterday at 12:14 PM

There never was formal verification of the entire rust compiler, or even its complete borrow checker/type system. There has been verifications on _subsets_ of them.

Also, a lot of those soundness issues aren't related to new features _at all_, but usually due to poor assumptions made in optimizations.

The soundness bugs _are_ taken seriously though, and are slowly being patched out. A lot of the links in OP are now closed because Rust either changed how it generates code to avoid the issues, or fixed LLVM.

➕ show 2 replies
thfuran • yesterday at 12:06 PM

No mainstream compiler is formally proven. If you want a verified compiler, you pretty much have to choose between using a subset of standardml or a subset of C and the one proven compiler for each.

➕ show 2 replies
jeremyjh • yesterday at 12:15 PM

There is a massive possibility space between “yolo” and formal proof. Rust has substantial evidence of correctness. For example, unit tests and types.

➕ show 2 replies
itishappy • yesterday at 3:16 PM

Formal verification of the type system does seem a worthwhile goal, and to my understanding it's something the community has been making progress towards, but I also understand it's still relatively uncommon for most languages.

Is this more an abstract concern over the state of the industry, or is there a specific language you had in mind that you'd prefer Rust was modeled after?

➕ show 1 reply
mirashii • yesterday at 3:47 PM

Important to note that this is is not a bug in the type system itself, it's a bug in the borrow checker not enforcing invariants that the type system says that it should, and formal verification of the type system would not have helped here.

UncleMeat • yesterday at 12:28 PM

The Java type system is also unsound. That’s life. It is hard to do this fully correctly. In practice this never comes up.

➕ show 1 reply
steelframe • yesterday at 5:00 PM

The font color is so close to the background now that I can't even read your edit. Sorry, bud.

cowlevel • yesterday at 12:49 PM

As you can see, this is a true statement, but HN really really really hates it for some reason.

csande17 • yesterday at 12:11 PM

Yes. When people describe Rust as "a memory-safe programming language" they are describing an aspirational vision, and not a programming language that has actually been designed with sufficient rigor to guarantee memory safety. Any failure of rustc to actually guarantee this is just a bug in rustc itself, a failure to properly implement the Rust spec, because the closest thing Rust has to a spec is literally just the vague ideal that the compiler should guarantee safety somehow.

Rust cannot fail, it can only be failed.

➕ show 4 replies