Q
QuanLang
GitHub
🌐 Ready to run in browsers! Pre-built WebAssembly available

A lightweight
interpreted language

QuanLang is a simple interpreted programming language designed for learning language design, interpreters, and compilers. Built from scratch with Go.

Latest version: v1.3
v1.3-features.qlang
// New in v1.3: Null comparisons & Native APIs
data = fetch("https://api.example.com/users");
users = toJson(data);

if (users == null) {
  print("Failed to fetch data");
  return;
}

// Type casting with new functions
userCount = int("42");        // 42
price = float("19.99");       // 19.99
message = string(userCount);  // "42"
isActive = bool("true");      // true

// Null comparisons work naturally
if (null == null) {
  print("Null equality works!");
}

// WebAssembly support - runs in browser!
result = toMap(users[0]);
print("User data:", result);
🌐 Browser Ready

Run QuanLang Directly in Your Browser

With WebAssembly support, QuanLang now executes at near-native speed in any modern web browser. No installation required - just compile to WASM and run!

Pre-built WebAssembly

// Download qlang.wasm - ready to use!

Pre-built WebAssembly module ready for immediate browser use

Embed in Web Pages

<script src="quan-wasm.js"></script>

Integrate QuanLang programs directly into your web applications

Try Online Playground
🚀 Try It Now

Interactive Online Playground

Experience QuanLang instantly in your browser. Write code, see tokens, explore the AST, and execute programs - all without any installation.

QuanLang Online Playground showing code editor, tokens, and AST visualization

Live Code Editor

Write and edit QuanLang code with syntax highlighting

Token & AST Viewer

Visualize how your code is parsed and structured

Instant Execution

Run your programs immediately and see the results

🚀 Version 1.3 Released

What's New in v1.3

Enhanced null handling, native APIs for web requests and data manipulation, plus powerful type casting functions

Null Comparisons

Natural null equality checks with support for null == null and cross-type comparisons

if (null == null) { ... }

Native APIs

Built-in functions for web requests and data manipulation: fetch(), toJson(), toMap()

data = fetch("api.com");

Type Casting

Explicit type conversion functions: int(), float(), string(), bool() for precise data handling

num = int("42"); // 42
98.3%
Go
1.7%
JavaScript
1
Star
0
Forks

Built to Run Lightweight

A fast, efficient interpreted language designed for simplicity and performance

Custom Lexer & Parser

Built from scratch to demonstrate tokenization and parsing techniques

Tree-Walking Interpreter

Direct AST evaluation for educational clarity and simplicity

Core Language Features

Variables, functions, conditionals, arrays, floats, and type introspection

See It in Action

Simple syntax, powerful concepts

v1.3 features: Null comparisons, Native APIs & Type casting
// Null comparisons work naturally
if (null == null) {
  print("Null equality works!");
}

if (data == null) {
  print("No data available");
}

// Native APIs for web and data
response = fetch("https://api.github.com/users/octocat");
userData = toJson(response);
userMap = toMap(userData);

// Type casting functions
age = int("25");           // 25
price = float("19.99");    // 19.99
message = string(age);     // "25"
isValid = bool("true");    // true

print("User age:", age);
print("Price:", price);

Get Started

Up and running in under a minute

1

Try the online playground

Or clone locally:

git clone https://github.com/TheParadance/quan-lang.git
git checkout v1.3
2

Build the interpreter

cd quan-lang && go build -o quan main.go
3

Try the new features

echo 'x = int("42"); print(x == 42);' | ./quan

Documentation

Everything you need to know

Language Guide
Learn the syntax, semantics, and core concepts of QuanLang v1.2
API Reference
Detailed reference for null comparisons, native APIs (fetch, toJson, toMap), type casting functions, and all language constructs