What Is Compiler Explorer (rust.godbolt.org)?

Updated

Compiler Explorer at rust.godbolt.org is the Rust-focused entry point to Compiler Explorer (CE), an interactive online compiler that shows the assembly output of your code as you write it. You paste or type Rust source into the left pane, and the right pane shows the compiled result — typically assembly, but also LLVM IR, Rust MIR, Rust HIR, macro expansion, and other intermediate representations. It is useful when you want to see what the compiler actually does with your code without installing a local toolchain, and it works for C++, Go, and many other languages as well.

What you can do with it

  • See assembly as you type. The source editor and output pane update together, so you can change a line and immediately watch the generated code change.
  • Inspect intermediate stages. For Rust, the available output tools include Rust MIR, Rust HIR, and Rust Macro Expansion, plus LLVM IR and the opt pipeline. This lets you follow code from source through macro expansion and MIR down to LLVM IR and final assembly.
  • Run code. The Compiler Execution and Execute the code options let you compile and run a program, with arguments and stdin configurable.
  • Compare compilers and versions. You can add multiple compiler panes and diff their output, which is the main reason people use CE to reason about codegen differences.
  • Share results. Short Link, Full Link, and Embed in iframe let you send a reproducible example to someone else or drop it into a page.

Typical uses

  • Checking whether a construct compiles to the instructions you expect (for example, whether a loop is vectorized or a bounds check is eliminated).
  • Comparing optimization levels or compiler versions side by side.
  • Learning how Rust's macro expansion and MIR work by reading the actual output.
  • Sharing a minimal reproduction with a colleague or in a bug report.

Things to know before relying on it

  • The site states that without JavaScript the regular website is not functional; a noscript version is offered as a fallback.
  • The interface is dense. Panes, tools, and filters are added through "Add..." menus, and layout can be reset via Reset UI layout or Reset code and UI layout.
  • Output tools are conditional: the interface notes that "the current language or compiler does not support this tool" when a selected tool is unavailable for your compiler.
  • The page lists sponsorship and donation channels (Patreon, GitHub Sponsors, PayPal, a shop) but does not state pricing or login requirements, so treat account or cost details as unconfirmed unless you check the site directly.

When it is the right tool

Use Compiler Explorer when the question is "what does the compiler emit?" — codegen, optimization behavior, IR shape, or macro expansion. It is less suited to full project builds, dependency-heavy crates, or debugging runtime behavior, where a local toolchain and debugger are the better fit.