Prerequisites
To build Walrus from source, you’ll need:- Rust (latest stable version)
- Git
Clone the repository
Basic build
Build in debug mode
For development and debugging:The binary will be located at
target/debug/walrus.Release builds
For optimal performance, build with release optimizations:target/release/walrus.
Release profile configuration
Walrus includes debug symbols even in release builds for better profiling:Build features
JIT compilation support
Walrus includes an optional Just-In-Time (JIT) compiler powered by Cranelift that can dramatically speed up hot loops:cranelift-codegencranelift-frontendcranelift-jitcranelift-modulecranelift-nativetarget-lexicon
JIT profiling
Enable JIT profiling output for performance analysis:Memory profiling
Build with heap profiling support using dhat:Binaries
The Walrus workspace produces two binaries:Main interpreter
- Tree-walking interpreter (default)
- Bytecode VM with
-cflag - Disassembler with
-dflag - JIT compilation with
--jitflag (if built withjitfeature)
Language server
Custom allocator
Walrus uses mimalloc as a custom allocator for improved allocation performance. This is automatically included in all builds.Build dependencies
Key dependencies compiled during the build:- LALRPOP - Parser generator (build-time)
- SlotMap - Arena-based memory management
- rustc-hash - Fast hashing (FxHashMap/FxHashSet)
- strena - String interning
- tower-lsp - LSP server implementation
- tokio - Async runtime for LSP
Cargo.toml for the complete dependency list.