About Rust Online
Rust Online is a browser-based Rust editor with a real compiler behind it. This page explains how it works, starting with the question people ask first.
Is Rust compiled or interpreted?
Rust is compiled ahead of time. Unlike interpreted languages such as Python or JavaScript, Rust source code is translated directly into native machine code by its compiler, rustc, before execution ever begins. Nothing reads your source line by line at runtime.
What happens when you press build
1. Parsing into an AST
rustc reads your source text and builds an Abstract Syntax Tree: a structured representation of every item, expression and type annotation you wrote. Syntax errors are caught here, before anything else runs.
2. Lowering to an intermediate representation
The AST is lowered through HIR and then MIR, Rust's mid-level IR. This is where the interesting work happens: type checking, trait resolution, and the borrow checker proving that every reference outlives the data it points at.
3. LLVM generates machine code
MIR becomes LLVM IR, and the LLVM backend optimises it into native machine code for a specific platform. Iterator chains collapse into tight loops, generics are monomorphised into concrete functions, and abstractions that looked expensive in the source cost nothing at runtime.
4. A standalone executable
The result is a binary that runs on its own. No interpreter, no virtual machine, no runtime to install on the target machine. That is why Rust turns up in operating systems, browsers, embedded devices and command-line tools.
Why this matters to you as you learn
Because compilation happens up front, whole categories of bug are caught before your program ever runs: memory safety violations, data races between threads, and type mismatches. In an interpreted language most of those become runtime crashes discovered by your users. In Rust they are compiler messages discovered by you, in seconds, with a suggested fix attached.
Experimental tools such as miri interpret Rust's intermediate representation to detect undefined behaviour during testing. They are diagnostic instruments used alongside a build. There is no standard Rust interpreter, and a REPL-style “just run this line” model does not exist the way it does in Python.
What Rust Online actually does
Rust Online is a browser-based Rust editor with a real compiler behind it. You write on the left, and the Result panel on the right shows what your program actually did: real stdout, real diagnostics, real error codes. Nothing to install, no project to set up, no terminal.
- Two layers of feedback. The instant layer runs in your browser: the same grammar the compiler uses parses your code as you type, so structural mistakes are underlined with zero network latency. The truthful layer runs on a real toolchain a moment after you stop typing, or immediately on Ctrl/Cmd + Enter.
- Errors explained in plain English. Each diagnostic is highlighted inline at the exact line and column, paired with what the message means and a minimal code change that fixes it. The raw rustc output is one toggle away, so you learn to read the real thing rather than a substitute for it.
- An AI companion that only talks Rust. Ask why the borrow checker is unhappy and get an answer about your code, streamed as it is written, right next to the editor.
- 5 guided lessons and 42 runnable examples. Every lesson has checkpoints that verify your program before you move on, and every example opens straight into the editor so you can change it and recompile.
- Built for everyone. 16 themes plus a high-contrast mode, full keyboard navigation, screen-reader announcements for every compile, reduced-motion support, and a mobile layout you can install as an app.
So how is Rust running in a browser tab?
Your browser cannot compile Rust. There is no interpreter to ship to it, and a full rustc plus LLVM toolchain is far too large to download into a page. The compile happens on a server running a genuine rustc build, and the output travels back to your tab.
We never simulate compiler output. If a message appears on the right, rustc produced it. The fastest way to get good at Rust is to build a working relationship with the real compiler, and you cannot do that against a fake one.
Why this is the easiest way to start
Rust is hard to start mostly because the feedback loop is slow. Traditionally you install a toolchain, create a project, run a build, read a wall of text, and repeat. Here that loop takes a second or two, the message is explained in plain English, the exact character it refers to is highlighted, and a one-line fix is suggested underneath.
That works for someone who has never written systems code. You are never more than one keystroke from an answer, and every answer comes from the same compiler professional Rust developers use every day.
Start with the guided examples or open the editor and just start typing.
Who builds this
Built and maintained by Tony Cletus.