The Visual Result Language
A modern, compiled language designed to bridge the gap between logic and light.
Xanadu elevates your development experience with intrinsic visual output.
New to Xanadu? Check out the comprehensive documentation:
- Introduction - Philosophy and overview.
- Getting Started - Installation and your first program.
- Basic Syntax - Variables, types, and expressions.
- Control Flow - If, Match, and Loops.
- Functions & Pipelines - Logic and data flow.
- Data Structures - Lists, Maps, and Structs.
- Visual Output - Understanding the
show()function. - CLI Reference - Compiler and VM usage.
Most languages treat output as text dumped into a console. Xanadu treats output as a first-class citizen.
In Xanadu, data structures render themselves. Errors are visual diagnostics. The language runtime creates a bridge between your logic and the display, whether that's a terminal, a window, or a web browser.
Built-in show() isn't just print(). It renders interactive tables, trees, and formatted data structures.
let users = [
{ name: "Alice", role: "Admin" },
{ name: "Bob", role: "User" }
]
show(users) // Renders a visual table, not JSON text
Xanadu offers flexibility for every stage of development:
- Interpreter: Tree-walk execution for instant feedback and REPL usage.
- Bytecode VM: High-performance stack-based virtual machine for production.
Inspired by Rust, Python, and Elixir.
- Pipelines:
data |> map(fn) |> filter(fn) - Pattern Matching:
match value { ... } - String Interpolation:
"Hello {name}" - Strong Typing: Inference with compile-time checking.
Build the compiler from source:
git clone https://github.com/armanrasta/Xanadu.git
cd Xanadu
cargo build --releaseAdd the binary to your path:
export PATH=$PATH:$(pwd)/target/release1. Interactive REPL The fastest way to test visual results.
Xanaduc2. Running a Script (Interpreter) Good for development and debugging.
Xanaduc run examples/hello.xa3. Compiling to Bytecode (VM) For high performance. Compiles to memory and executes instantly.
Xanaduc compile examples/hello.xa4. Building for Distribution
Creates a standalone .xac binary file.
Xanaduc build examples/hello.xa
Xanaduc run examples/hello.xacXanadu is built on a modular Rust stack:
| Component | Responsibility |
|---|---|
| Lexer/Parser | Converts source to AST with detailed error spans. |
| Compiler | Lowers AST to optimized Bytecode Chunks. |
| Xanadu VM | Stack-based virtual machine with global/local scopes and call frames. |
| Bridge API | Protocol connecting the core VM to visual renderers. |
| Terminal Renderer | Handles box-drawing and ANSI coloring for CLI output. |
- v0.1: Foundation - Lexer, Parser, VM, REPL, Basic Types.
- v0.2: Core - Structs, Enums, Visual Tables, Loops (In Progress).
- v0.3: Types - Strong Type Checker, Generics, Result Types.
- v0.4: Visual - Desktop window rendering (wgpu).
- v1.0: Stable - Standard Library and Package Manager.