An interpreter for Rust's mid-level intermediate representation (by rust-lang)


Basic miri repo stats
about 19 hours ago

rust-lang/miri is an open source project licensed under GNU General Public License v3.0 or later which is an OSI approved license.

Miri Alternatives

Similar projects and alternatives to miri

  • GitHub repo rust

    Empowering everyone to build reliable and efficient software.

  • GitHub repo mrustc

    Alternative rust compiler (re-implementation)

  • GitHub repo unsafe-code-guidelines

    Home for the Unsafe Code Guidelines working group.

  • GitHub repo linux

    Linux kernel source tree

  • GitHub repo MeiliSearch

    Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine

  • GitHub repo tikv

    Distributed transactional key-value database, originally created to complement TiDB

  • GitHub repo hyper

    An HTTP library for Rust (by hyperium)

  • GitHub repo ruffle

    A Flash Player emulator written in Rust

  • GitHub repo py-spy

    Sampling profiler for Python programs

  • GitHub repo Cargo

    The Rust package manager

  • GitHub repo rust-analyzer

    A Rust compiler front-end for IDEs

  • GitHub repo Clippy

    A bunch of lints to catch common mistakes and improve your Rust code

  • GitHub repo bottlerocket

    An operating system designed for hosting containers

  • GitHub repo wasmtime

    Standalone JIT-style runtime for WebAssembly, using Cranelift

  • GitHub repo warp

    A super-easy, composable, web server framework for warp speeds.

  • GitHub repo gitui

    Blazing 💥 fast terminal-ui for git written in rust 🦀

  • GitHub repo rust

    Rust language bindings for TensorFlow (by tensorflow)

  • GitHub repo rust-blog

    Educational blog posts for Rust beginners

  • GitHub repo Parity

    The fast, light, and robust client for the Ethereum mainnet.

  • GitHub repo CIDLib

    The CIDLib general purpose C++ development environment

NOTE: The number of mentions on this list indicates mentions on common posts. Hence, a higher number means a better miri alternative or higher similarity.


Posts where miri has been mentioned. We have used some of these posts to build our list of alternatives and similar projects - the last one was on 2021-04-16.
  • Best place to start?
    reddit.com/r/rust | 2021-04-16
    Running your code under Miri. (It's not infallible, but it can point out a lot of mistakes in unsafe code that can only be detected while the code is running.)
  • Philosophies of Rust and Haskell
    reddit.com/r/rust | 2021-04-06
    I don't think this is true. Rust very much takes the "if it compiles, it works" approach. Compile time errors are philosophically considered vastly superior to runtime errors. I think everyone in the Rust community would prefer if your Tokio example resulted in a compile error. The amazing work done on miri is one example of trying to statically detect runtime issues. I would say the core philosophy of Rust on this topic is: "if it compiles, it runs on all (tier 1) platforms".
  • Miri can now run doctests :)
    reddit.com/r/rust | 2021-04-06
    Thanks to @teryror, support for running doctests has recently landed in Miri. So finally cargo miri test is executing all the same tests that cargo test runs. This has been a long-standing open issue and I am stoked that it is now finally resolved. :)
  • Deferred Reference: compile-time checked reference sharing between threads, with a little bit of unsafe
    reddit.com/r/rust | 2021-04-04
    With deferred-reference this is not undefined behavior, even though deferred1 and deferred2 both point into buffer! (If you want to check this for yourself, I encourage you to install Miri and run the above example with the command which checks for this type of undefined behavior: $ MIRIFLAGS="-Zmiri-track-raw-pointers" cargo miri test, please see the readme on crates.io for installation instructions). If you try the above example with two regular mutable references &mut [usize; N] both pointing into buffer at the same time, then this is definitely undefined behavior, but then why is it not undefined behavior when using a Deferred? The trick is that Deferred does not hold an actual reference, it holds a raw pointer tied to the lifetime of &buffer. In fact, the first actual reference into the contents of the UnsafeCell only gets created on the last line of the example. There is another trick at play here: Deferred implements the Index and IndexMut traits in such a way that it only creates a reference to the subslice, instead of to the entire slice. This allows multiple threads (or even the same thread, as shown in the above example) to safely index into the same array or slice as long as the accesses are disjoint in index. Note: arrays are currently fully supported on stable Rust thanks to min_const_generics, but for slices you still need nightly Rust at the moment.
  • Is going from &T to &mut U safe or undefined behavior if T does not wrap U?
    reddit.com/r/rust | 2021-03-12
    In the playground example link that I posted above, it is possible to ask Miri the same question. In the top right corner, click the "Tools" button and then select the "Miri" menu item. Miri does not think this is undefined behavior, however, on its website Miri also notes that detecting this kind of undefined behavior is experimental, so I'm not sure if I can rely on this in full. A second reason I am skeptical and confused, is because Vec::as_mut_ptr() requires a mutable borrow of `&mut self` to even obtain a mutable pointer `*mut T` (is this then chosen too strict?), while NonNull::as_ptr(self) consumes `self` to obtain a `*mut T`, but NonNull also implements the Copy trait, so this can be called as often as needed, even while the NonNull is immutably borrowed. Hence, NonNull seems to be more relaxed about handing out `*mut T` than Vec.
  • MIRI running in WASM
    reddit.com/r/rust | 2021-03-10
  • Rust and C++ comparisons
    reddit.com/r/rust | 2021-02-28
    Bear in mind that Rust isn't just about performance. You also get a very powerful type system and, thanks to how Rust's APIs have been designed to take advantage of it, that means that your safe code gets an equivalent to Go's data race detector that runs at compile time ("I refuse to compile this. It has a data race.") rather than at runtime. (If you do have to resort to using unsafe, Miri gained data race detection a little while ago.)
  • Is this function that uses unsafe okay?
    reddit.com/r/rust | 2021-02-17
    You could check your function for UB via miri:https://github.com/rust-lang/miri
  • news.ycombinator.com | 2021-01-27
    > But it comes with costs. Someone has to learn Rust and then convert all of these programs.

    Someone has to learn compiler engineering and then design and implement a 'safe' ABI. Unlike learning Rust, this is probably worthy of a research paper.

    > Rust programs are only memory safe if the unsafe keyword is not used anywhere in the program

    If you use unsafe, then you take some of the responsibility for maintaining memory safety. However, you can audit the unsafe parts of the code, and it will compose with the compiler-provided guarantees for the rest of the code. Besides, one can easily avoid unsafe code for safety-critical tools like these.

    > Much more interesting (to my mind, anyway) is something like Miri. The rust interpreter, which uses fat-pointers to make things (more? completely? someone more informed can correct me..) memory-safe by inserting some relatively lightweight run-time checks.

    Miri does not support most interaction with the outside world [1]. It is focused more on detecting UB in unsafe code when it is exercised by tests, than on having your code running in production through Miri. Moreover, I wouldn't call a thousand-fold slowdown [2] "relatively lightweight".

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

  • Why go with Rust over CPP or Go?
    reddit.com/r/rust | 2021-01-19
    ...and unsafe Rust recently gained basic data race detection for its runtime analyzer, named Miri.
  • Open Source Security, Inc Announces Funding of GCC Front-End for Rust
    reddit.com/r/rust | 2021-01-12
    It seems that the entire idea of requiring humans to interpret specifications is unworkable and leads to both poor specification and bugs. A far better idea is to construct executable models so you can compare your behavior to the behavior of the model. This is underway for large chunks of Rust via miri, and formal specification with proof of correctness for other chunks via RustBelt.
    reddit.com/r/rust | 2021-01-12
    Points 1 and 2 would be far better served by a formal model, such as an extension of RustBelt or miri. Point 3 does not require a separate implementation, just manpower; in fact, two competing implementations would be detrimental.
  • What’s everyone working on this week (2/2021)?
    reddit.com/r/rust | 2021-01-11
    My current main project is a library of allocation-free data structures, which uses a lot of unsafe code. I like having a lot of doc-tests serving double duty as documentation and unit tests, but I wanted to get my Miri coverage up; copying all the examples into #[test] functions seemed too tedious, so I decided to help fix this year-old issue in Miri, though my prototype still needs a bit more work. This also required fixing a minor bug in rustdoc, which is now my first accepted PR to the main rust repo!
  • Rusticles #10 - Wed Sep 09 2020
    dev.to | 2020-09-09
    rust-lang/miri (Rust): An interpreter for Rust's mid-level intermediate representation