What does HackerNews think of miri?

An interpreter for Rust's mid-level intermediate representation

Language: Rust

The results are a trade-off between sparse or having false positives.

Rust just takes the other side of the trade-off, and will reject valid programs. Hence why the unsafe keyword exists, and why tools like Miri (https://github.com/rust-lang/miri) exist specifically for rust.

Lured in by a typo that perhaps I could pedantically correct for internet points, got an excellent cryptography writeup instead, this is a good read.

Have to wonder how many bugs lay in static and dynamic analysers themselves, might be some low hanging yet wide-ranging fruit there.

Been playing around with Miri lately, it's a joy to use.

https://github.com/rust-lang/miri

It's not obvious (unless you follow the author on twitter[1]) but a large portion of this has been rewritten with new content. Among other things, it now includes a section on detecting undefined behavior in unsafe blocks using Miri[2], which is incredibly neat.

[1] https://twitter.com/Gankra_/status/1486928208528293888 [2] https://github.com/rust-lang/miri

TIL Rust is working on its own version of ASAN and UBSAN: https://github.com/rust-lang/miri How shocking.
The multiple implementation story of Rust isn't as great as some older languages, but it's getting there.

There are at least two e2e implementations of Rust:

- rustc, the reference implementation.

- mrustc, an alternative written in C++ [1].

There are also multiple implementations Rust's IR (MIR):

- rustc compiles MIR to LLVM.

- A backend that compiles MIR to Cranelift [2].

- Miri, a MIR interpreter used for dynamic analysis [3].

mrustc doesn't perform the borrow check, so it can't prevent you from triggering UB like rustc. But you can use rustc for the borrow check and mrustc for codegen.

[1]: https://github.com/thepowersgang/mrustc

[2]: https://github.com/bjorn3/rustc_codegen_cranelift

[3]: https://github.com/rust-lang/miri