Skip to content

armanrasta/xanadu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xanadu

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.

📚 Documentation

New to Xanadu? Check out the comprehensive documentation:

  1. Introduction - Philosophy and overview.
  2. Getting Started - Installation and your first program.
  3. Basic Syntax - Variables, types, and expressions.
  4. Control Flow - If, Match, and Loops.
  5. Functions & Pipelines - Logic and data flow.
  6. Data Structures - Lists, Maps, and Structs.
  7. Visual Output - Understanding the show() function.
  8. CLI Reference - Compiler and VM usage.

🦅 Why Xanadu?

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.

⚡ Key Features

👁️ Visual Result First

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

⚙️ Dual Execution Architecture

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.

🦀 Clean, Modern Syntax

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.

🚀 Quick Start

Installation

Build the compiler from source:

git clone https://github.com/armanrasta/Xanadu.git
cd Xanadu
cargo build --release

Add the binary to your path:

export PATH=$PATH:$(pwd)/target/release

Usage

1. Interactive REPL The fastest way to test visual results.

Xanaduc

2. Running a Script (Interpreter) Good for development and debugging.

Xanaduc run examples/hello.xa

3. Compiling to Bytecode (VM) For high performance. Compiles to memory and executes instantly.

Xanaduc compile examples/hello.xa

4. Building for Distribution Creates a standalone .xac binary file.

Xanaduc build examples/hello.xa
Xanaduc run examples/hello.xac

🏗️ Technical Architecture

Xanadu 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.

🗺️ Roadmap

  • 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.
Designed with the spirit of the Homa. High flying, visual, and auspicious.

About

A modern, compiled programming language where everything you compute, you see. Visual output by default.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages