Zuv is a modern, high-performance, statically-typed compiled programming language built on top of LLVM. It is designed around a single revolutionary motive: strip away unnecessary syntax and ceremony so developers can express logic as quickly and naturally as sending a text message on social media.
Traditional programming languages force you to write excessive boilerplateβparentheses around function calls, noisy argument separators, verbose function headers, and cumbersome type ceremony.
In Zuv, we believe:
"Typing code should feel as fast, direct, and natural as chatting on a social media app."
- π¬ Zero Unnecessary Parentheses: Direct declarations (
add a, b { -> a + b }) and direct calls (factorial 5,handleBuild "main.zv", 1, 0). - β‘ Minimalist Keywords:
prnt,mut,retor->,obj,wh,fr,brk,cont,asc,awt,spn,jn,wrk. - π‘οΈ Memory Safety Without GC: Rust-grade static borrow checker (
&and&mut) preventing memory bugs with zero runtime latency. - π Blazing Fast Native Code: Compiled Ahead-of-Time (AOT) to optimized machine binaries via an in-process LLVM engine.
- π Pure Self-Hosting: The compiler in this repository is written completely in pure Zuv (
.zv).
// Traditional (C/JS style)
function calculateTotal(price, tax, discount) {
return (price + tax) - discount;
}
let total = calculateTotal(100, 15, 5);
// π₯ Zuv (Clean, Direct, Chat-like)
calculateTotal price, tax, discount {
-> price + tax - discount
}
total = calculateTotal 100, 15, 5
// Single-line import & fluent dot methods
imp str, arr, time, fs
main {
prnt "Welcome to Zuv!"
// Dynamic arrays without parenthesis noise
mut items = [10, 20]
items.psh 30
lg items.ln
// String manipulation
msg = "Hello World"
if msg.contains "World" {
lg msg.ln
}
}
wrk workerTask {
lg "Background thread running..."
}
main {
h = spn workerTask
jn h
prnt "Thread finished!"
}
| Command | Usage | Description | Implementation Status |
|---|---|---|---|
test |
zuv test |
Native AOT Test Runner: Automatically discovers all *.test.zv files in tests/, compiles each to a temporary executable, runs them, verifies exit codes, and prints a comprehensive timing report |
β Fully Implemented |
checkall |
zuv checkall |
Batch Test Syntax & Type Checker: Scans the tests/ directory and runs the fast lexer, parser, and borrow checker across all *.test.zv test files without invoking LLVM codegen or building executables |
β Fully Implemented |
check |
zuv check [file.zv] |
Single-File Static Validator: Performs instant syntax, AST construction, and compile-time borrow/mutability safety validation on a single target file without compiling to machine code | β Fully Implemented |
build |
zuv build [file.zv] [-o output.exe] |
AOT Compiler: Compiles Zuv source code directly to LLVM IR and generates a native executable binary with optional optimization flags (-O3) |
β Fully Implemented |
run |
zuv run [file.zv] |
Build & Run: Compiles the source file to a temporary binary and executes it immediately in a single step | β Fully Implemented |
fmt |
zuv fmt [file.zv] |
Code Formatter: Auto-formats .zv source files according to standardized Zuv indentation and chat-syntax style |
π‘ Stub |
init |
zuv init [project_name] |
Project Scaffolding: Generates a standard Zuv project workspace with zuv.yml configuration and src/main.zv |
π‘ Stub (in zuv.exe) |
lsp |
zuv lsp |
Language Server Daemon: JSON-RPC Language Server Protocol daemon providing real-time diagnostics, hover info, and autocompletion for IDEs | π‘ Stub (in zuv-tools) |
- Tokenizer / Lexer (
src/lexer.zv): β Fully Implemented β Line/column tracking, all keywords, strings, floats, operators. - Recursive Descent Parser (
src/parser.zv): β Fully Implemented β Full AST node hierarchy, Pratt expression precedence climber, imports, functions, structs, control flow. - Borrow & Safety Checker (
src/checker.zv): β Fully Implemented β Scoped symbol table, immutability enforcement, Rust-grade ownership movement and borrow exclusivity validation. - LLVM IR Codegen (
src/codegen.zv): β Fully Implemented β Unified 64-bit calling convention, dynamic array allocation, struct offset mapping, math/comparison ops, control branching. - Native AOT Test Runner (
src/cli.zv): β Fully Implemented β Dynamic directory scanning (sF), automated compilation, execution, timer diagnostics, negative test assertions. - Code Formatter (
handleFmtinsrc/cli.zv): π‘ Stub β Logs formatting confirmation; AST token-level formatter planned for next milestone. - Project Scaffolding (
init): π‘ Stub in self-hosting compiler (functional via C++ bootstrapzuv.exe). - Language Server (
lsp): π‘ Stub in self-hosting compiler (functional via TypeScript LSP insub_projects/zuv-tools).
zuv/
βββ zuv.yml # Zuv project configuration
βββ README.md # Main documentation
βββ CHANGELOG.md # Release history and updates
βββ CONTRIBUTING.md # Developer contribution guidelines
βββ CODE_OF_CONDUCT.md # Contributor Covenant v2.1
βββ LICENSE # MIT License
βββ tests/ # Automated Test Suite (27 test files)
βββ src/
βββ tokens.zv # Token definitions and keyword map
βββ lexer.zv # Pure Zuv source tokenizer & scanner
βββ parser.zv # Recursive descent AST parser
βββ checker.zv # Compile-time borrow checker & safety validator
βββ codegen.zv # LLVM IR emitter & in-process C-API bindings
βββ cli.zv # CLI driver and AOT test runner
βββ main.zv # Compiler entry point & command dispatcher
The standard installation location for the Zuv binary on Windows is:
C:\Users\<username>\zuv\bin\zuv.exe
(or %USERPROFILE%\zuv\bin\zuv.exe)
To run zuv from anywhere in your terminal or IDE, add the zuv\bin directory to your User PATH environment variable.
Run the following command in PowerShell:
# Create the directory if it doesn't exist
New-Item -ItemType Directory -Force -Path "$HOME\zuv\bin"
# Add to User PATH persistently
[Environment]::SetEnvironmentVariable(
"Path",
[Environment]::GetEnvironmentVariable("Path", "User") + ";$HOME\zuv\bin",
"User"
)- Press
Win + R, typesysdm.cpl, and hit Enter. - Go to the Advanced tab and click Environment Variables....
- Under User variables for , select
Pathand click Edit.... - Click New and add:
C:\Users\<username>\zuv\bin(replace<username>with your Windows user name). - Click OK to save and restart your terminal.
Open a new PowerShell or Command Prompt terminal and run:
zuv --helpCompile the pure Zuv compiler sources:
zuv build src/main.zvTo install the built compiler to your default binary folder:
Copy-Item output.exe "C:\Users\$env:USERNAME\zuv\bin\zuv.exe" -ForceExecute all 27 unit test suites natively using zuv:
zuv testVerify syntax and borrow safety across all test suites without emitting binaries:
zuv checkallzuv build tests/functions.test.zv
zuv run tests/functions.test.zvWe welcome contributions from developers worldwide! Please review our Contributing Guide and Code of Conduct before submitting pull requests.
- Fork the repo: https://github.com/zuv-lang/zuv
- Create your branch:
git checkout -b feature/my-new-feature - Commit your changes:
git commit -m "feat: describe your change" - Push to branch:
git push origin feature/my-new-feature - Open a Pull Request!
- π Changelog - Release notes and version history.
- π‘ Contributing Guide - How to get involved.
- π‘οΈ Code of Conduct - Our community standards.
- π§° Zuv Developer Tools & LSP - VS Code extension and language server.
This project is licensed under the terms of the MIT License.