🦭 Walrus Programming Language
Welcome to Walrus
Walrus is a dynamically-typed, interpreted programming language that combines simplicity with power. It features both a tree-walking interpreter and a bytecode virtual machine for efficient execution, along with a mark-and-sweep garbage collector and comprehensive support for modern programming paradigms.Key features
Bytecode VM
High-performance stack-based virtual machine with 80+ opcodes, call frames, and tail call optimization
JIT compilation
Optional Cranelift-powered JIT compiler for hot loops with up to 68x speedup on intensive computations
First-class functions
Functions as values with nested function support, closures, and higher-order functions
Automatic memory management
Mark-and-sweep garbage collector with configurable thresholds and arena-based heap allocation
Rich data types
Integers, floats, strings, booleans, lists, tuples, dictionaries, and ranges with comprehensive operations
Standard library
File I/O, system operations, and comprehensive math utilities with import system
Language highlights
Clean, expressive syntax
Structs and methods
Format strings
Execution modes
Walrus provides multiple execution modes to suit different workflows:Script execution
Run Walrus programs directly from files
REPL
Interactive shell for rapid prototyping and testing
Bytecode mode
Explicit bytecode compilation and VM execution
Performance
With the optional JIT compiler enabled, Walrus can achieve dramatic speedups on computational workloads:| Benchmark | Interpreter | JIT | Speedup |
|---|---|---|---|
| 10K iterations × sum(0..1000) | 0.68s | 0.01s | ~68x |
JIT compilation requires building with the
--features jit flag and is most effective for hot integer range loops.Get started
Installation
Install Walrus and set up your development environment
Quickstart
Write your first Walrus program in minutes
Language reference
Explore Walrus syntax, data types, and language features
Standard library
Learn about built-in functions and standard library modules
Why Walrus?
Fast execution
Fast execution
Walrus uses a bytecode virtual machine with 80+ opcodes for efficient execution. The VM features proper call frames, tail call optimization, and optional JIT compilation for hot loops using Cranelift.
Clean syntax
Clean syntax
Walrus syntax is designed to be readable and expressive. Functions use the
: param syntax, structs provide static methods, and format strings support embedded expressions.Modern features
Modern features
First-class functions, closures, structs with methods, comprehensive data types, and a rich standard library make Walrus suitable for a wide range of applications.
Built in Rust
Built in Rust
Walrus is implemented in Rust, leveraging the language’s performance and safety guarantees. The codebase uses modern Rust practices including arena allocation and custom allocators.
Next steps
Ready to start coding in Walrus? Follow our quickstart guide to write your first program:Quickstart guide
Get up and running with Walrus in under 5 minutes