3 ms·
> which huuuuuge steps toward were taken last week I follow Rust pretty closely, but I can't wrap my finger on what you're referencing here. Got an RFC link? :
by jmcomets 9y ago
> which huuuuuge steps toward were taken last week
I follow Rust pretty closely, but I can't wrap my finger on what you're referencing here. Got an RFC link? :)
- steveklabnik 9y agoIt's not about an RFC; it's that at the impl period days at RustFest, Oli managed to get Miri integrated into the compiler and bootstrap for the first time. https://github.com/rust-lang/rust/pull/45002 https://github.com/rust-lang/rust/pull/45002 https://github.com/rust-lang/rfcs/blob/1f5d3a9512ba08390a2226aa71a5fe9e277954fb/text/0911-const-fn.md https://github.com/rust-lang/rfcs/blob/1f5d3a9512ba08390a222... is the relevant historic RFC; still not yet stable. This work is what will enable a follow-on RFC for "real" CTFE in Rust, which in my understanding has been waiting for this to shake out. https://github.com/rust-lang/rust/pull/25609 https://github.com/rust-lang/rust/pull/25609 landed right around 1.0, two years ago, but real CTFE required waiting on MIR, which took a while to land, and then building Miri in the first place.
- kibwen 9y agoContext: MIR is an intermediate representation used by the Rust compiler; it's the final stage of Rust code before being converted to LLVM IR. Miri is an interpreter for MIR; it bypasses LLVM entirely and allows for direct execution of a certain subset of Rust (specifically the subset of code that can be evaluated at compile-time). Together this greatly expands the scope of constant evaluation in Rust code, granting Rust new metaprogramming faculties without requiring any new DSL (e.g. no need for C++-like template metaprogramming); just use the `const` keyword to run code at compile-time.
- tmzt 9y agoHow well would MIRI work as a generic virtual machine for fairly simple stuff. Essentially I want to compile some type-safe code from a file and run it in a safe way inside of another Rust application. I'm looking at various lua bindings as well as https://crates.io/crates/wren https://crates.io/crates/wren for this purpose, but I'm wondering if something like miri would work better since another path for compiling this language when real-time code reloading or sandboxing is not required is to translate it to Rust code and compile it with rustc, likely with a compiler plugin.
- kibwen 9y agoThat's a good question that I don't have the answer to. I'm only passingly familiar with Miri, so I can't say for certain what its intended scope is. Historically it's been developed in this repo: https://github.com/solson/miri https://github.com/solson/miri , so you could try opening an issue there and asking, though it seems as though it might soon migrate to the official rustc repo (if it hasn't already). You could also try asking around in the Rust channels (try #rust-internals) on irc.mozilla.org to get in touch with the Miri developers directly.