# Function request:interpreter

**URL:** <https://internals.rust-lang.org/t/function-request-interpreter/19962>\
**Category:** language design\
**Created:** [December 2, 2023, 5:48am UTC](https://internals.rust-lang.org/t/function-request-interpreter/19962 "2023-12-02T05:48:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hengshizhi](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/hengshizhi/32/11564_2.png) [@hengshizhi](https://internals.rust-lang.org/u/hengshizhi)\
**Post date:** [December 2, 2023, 5:48am UTC](https://internals.rust-lang.org/t/function-request-interpreter/19962/1 "2023-12-02T05:48:18Z")

</div>

Compilation is too slow. Can we create an interpreter for testing, while the compiler is used for production (a small brain hole)

---

<div class="post-metadata">

**Author:** ![kpreid](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/kpreid/32/8484_2.png) [@kpreid](https://internals.rust-lang.org/u/kpreid)\
**Post date:** [December 2, 2023, 5:56am UTC](https://internals.rust-lang.org/t/function-request-interpreter/19962/2 "2023-12-02T05:56:10Z")

</div>

An interpreter already exists: [GitHub - rust-lang/miri: An interpreter for Rust's mid-level intermediate representation](https://github.com/rust-lang/miri)

You can use it to run tests with the command `cargo miri test` (after installing it through rustup). However, you may find that it is _also_ slow, depending on what your tests do.

---

<div class="post-metadata">

**Author:** ![Yoric](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/yoric/32/1316_2.png) [@Yoric](https://internals.rust-lang.org/u/Yoric)\
**Post date:** [December 3, 2023, 10:21am UTC](https://internals.rust-lang.org/t/function-request-interpreter/19962/3 "2023-12-03T10:21:09Z")

</div>

Also, there are several ongoing works to make Rust compilation much faster:

- [By using an alternate compiler](https://github.com/rust-lang/rustc_codegen_cranelift)
- [By pre-compiling procedural macros to Wasm](https://morioh.com/a/633f9be03f83/watt-a-lightning-fast-webassembly-compiler-for-rust)
- [By using a faster linker](https://github.com/rui314/mold/)
- And of course [by making the compiler itself faster](https://nnethercote.github.io/2023/08/25/how-to-speed-up-the-rust-compiler-in-august-2023.html).

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 2, 2024, 10:21am UTC](https://internals.rust-lang.org/t/function-request-interpreter/19962/4 "2024-03-02T10:21:48Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
