How makepad/relax works
Relax is an experimental Rust live compiler and JIT for the edit-run loop. A user runs or tests a Cargo package; Relax parses and checks it, JIT-compiles functions on demand, and can patch edits into the running process. The process also answers inspection requests for profiling, debugging, hangs, and memory. The README documents these capabilities, while sampled source confirms portions of the compiler, inspection, and remote-command paths; unsampled subsystems are represented at their exact source paths without asserting internal call chains.
Main entry points: program.rs Program model · lib.rs Runner CLI · serve.rs Runtime service · client.rs Inspect client
Components 25
Run and compile
- Runner CLI
tools/run/runner/src/lib.rs - Compiler domain
libs/relax/compiler/src/domain.rs - JIT compilation
libs/relax/compiler/src/jit.rs - Program runtime
libs/relax/compiler/src/run.rs
Rust front end
- Program model
libs/relax/front/src/program.rs - Rust parser
libs/relax/front/src/parser.rs - Definition collection
libs/relax/front/src/def_collector.rs - Macro expansion
libs/relax/front/src/macros.rs - Language builtins
libs/relax/front/src/builtins.rs - Type checking
libs/relax/compiler/src/check.rs
Live process
- Runtime service
libs/relax/compiler/src/serve.rs - Live reload
libs/relax/compiler/src/reload.rs - Code ownership
libs/relax/compiler/src/owner.rs
Inspection
- Runtime instrumentation
libs/relax/compiler/src/inspect/instrument.rs - Thread inspection
libs/relax/compiler/src/inspect/threads.rs - Event timeline
libs/relax/compiler/src/inspect/timeline.rs - Heap inspection
libs/relax/compiler/src/inspect/heap.rs - Profile model
libs/prof_stream/src/model.rs - Inspect client
libs/relax/compiler/src/inspect/client.rs
Remote access
- Remote app commands
libs/remote/src/app.rs - Remote connection
libs/remote/src/conn.rs - Authenticated tunnel
libs/remote/src/server.rs
Other components
- Developer
- Running program
- Cargo package
Connections 26
- Developer → Runner CLI: runs or tests
- Cargo package → Runner CLI: provides package
- Runner CLI → Program model: loads source
- Program model → Rust parser: uses parsed files
libs/relax/front/src/program.rs - Program model → Definition collection: collects definitions
libs/relax/front/src/program.rs - Program model → Macro expansion: expands macros
libs/relax/front/src/program.rs - Program model → Language builtins: resolves builtins
libs/relax/front/src/program.rs - Runner CLI → Type checking: checks package
tools/run/runner/src/lib.rs - Runner CLI → Program runtime: starts runtime
- Program runtime → JIT compilation: compiles on demand
libs/relax/compiler/src/serve.rs - Runtime service → JIT compilation: dispatches compilation
libs/relax/compiler/src/serve.rs - Runtime service → Live reload: dispatches reload
libs/relax/compiler/src/serve.rs - Runtime service → Program runtime: dispatches execution
libs/relax/compiler/src/serve.rs - Developer → Live reload: edits source
- Live reload → Running program: patches running code
- Running program → Runtime service: answers inspection
- Inspect client → Runtime service: sends requests
- Inspect client → Remote app commands: routes remote commands
libs/relax/compiler/src/inspect/client.rs - Remote app commands → Remote connection: uses connection
libs/remote/src/app.rs - Remote connection → Authenticated tunnel: communicates over tunnel
- Runtime instrumentation → Running program: samples runtime
- Thread inspection → Running program: inspects threads
- Event timeline → Running program: reports events
- Heap inspection → Running program: tracks allocations
- Profile model → Inspect client: formats findings
- Developer → Inspect client: requests diagnostics