AI-optimized systems programming language with token-efficient syntax.
Vais is designed to minimize token usage while maximizing code expressiveness, making it ideal for AI-assisted development and LLM code generation.
- Single-letter keywords -
F(function),S(struct),E(enum/else),I(if),L(loop),M(match) - Self-recursion operator
@- Call the current function recursively - Expression-oriented - Everything is an expression
- LLVM backend - Native performance
- Type inference - Minimal type annotations
# Fibonacci with self-recursion
F fib(n:i64)->i64 = n<2 ? n : @(n-1) + @(n-2)
# Struct definition
S Point { x:f64, y:f64 }
# Sum with loop
F sum(arr:[i64])->i64 {
s := 0
L x:arr { s += x }
s
}
| Keyword | Meaning | Example |
|---|---|---|
F |
Function | F add(a:i64,b:i64)->i64=a+b |
S |
Struct | S Point{x:f64,y:f64} |
E |
Enum/Else | E Option<T>{Some(T),None} |
I |
If | I x>0{1}E{-1} |
L |
Loop | L i:0..10{print(i)} |
M |
Match | M opt{Some(v)=>v,None=>0} |
@ |
Self-call | @(n-1) (recursive call) |
:= |
Infer & assign | x := 42 |
crates/
├── vais-ast/ # Abstract Syntax Tree
├── vais-lexer/ # Tokenizer (logos-based)
├── vais-parser/ # Recursive descent parser
├── vais-types/ # Type checker
├── vais-codegen/ # LLVM IR generator
├── vais-lsp/ # Language Server Protocol
└── vaisc/ # CLI compiler & REPL
std/ # Standard library (47 modules)
vscode-vais/ # VSCode extension
docs/ # Documentation
examples/ # Example programs (105+ files)
cargo build --release
cargo testThis project uses cargo-tarpaulin to measure test coverage. Coverage reports are generated automatically in the CI pipeline.
To generate coverage reports locally:
# Install cargo-tarpaulin (one-time setup)
cargo install cargo-tarpaulin
# Generate coverage reports (HTML and Lcov)
cargo tarpaulin --config tarpaulin.toml
# Or use the convenience alias
cargo coverage
# Generate HTML report only
cargo coverage-html
# Generate Lcov format for CI integration
cargo coverage-lcovCoverage reports are saved to target/coverage/:
index.html- Interactive HTML coverage reportlcov.info- Lcov format for codecov integration
Coverage is measured automatically on every push and pull request to main and develop branches. Reports are:
- Uploaded as GitHub Actions artifacts
- Sent to Codecov for tracking trends
- Available for 30 days in the CI artifacts
# Compile a Vais file
./target/release/vaisc build hello.vais -o hello
# Run directly
./target/release/vaisc run hello.vais
# Start REPL
./target/release/vaisc repl
# Format code
./target/release/vaisc fmt src/
# Check for errors
./target/release/vaisc check hello.vais- Lexer (logos-based tokenizer)
- Parser (recursive descent)
- Type checker (generics, traits, type inference)
- Code generator (LLVM IR)
- Standard library (24 modules: Vec, HashMap, String, File, Net, etc.)
- LSP support (diagnostics, completion, hover, go-to-definition, references, rename)
- REPL (interactive environment)
- VSCode extension (syntax highlighting, LSP integration)
- Optimizer (constant folding, DCE, CSE, loop unrolling, LICM)
- Formatter (
vaisc fmt) - Debugger (DWARF metadata, lldb/gdb support)
Vais is designed for both compilation speed and runtime performance.
| Phase | Time (avg) | Throughput |
|---|---|---|
| Lexer | ~0.5ms/1K LOC | ~2M tokens/sec |
| Parser | ~1.2ms/1K LOC | ~800K AST nodes/sec |
| Type Checker | ~2.5ms/1K LOC | ~400K types/sec |
| Code Generator | ~3.0ms/1K LOC | ~300K IR lines/sec |
| Full Pipeline | ~7.5ms/1K LOC | ~130 files/sec |
Fibonacci(35) benchmark:
| Language | Time | Relative |
|---|---|---|
| Vais (optimized) | 48ms | 1.0x |
| Rust (release) | 45ms | 0.94x |
| C (gcc -O3) | 44ms | 0.92x |
| Python | 3200ms | 67x |
# Compile-time benchmarks
cargo bench -p vais-benches --bench compile_bench
# Runtime comparison benchmarks
cargo bench -p vais-benches --bench runtime_benchThe comprehensive documentation is available as an interactive mdBook site:
# Build and view the documentation
cd docs-site
./serve.shVisit the online documentation or browse the individual files:
- LANGUAGE_SPEC.md - Complete language specification
- STDLIB.md - Standard library reference
- TUTORIAL.md - Getting started tutorial
- Architecture.md - Compiler architecture and design
- INSTALLATION.md - Installation guide
- COVERAGE.md - Test coverage measurement guide
- MEMORY_SAFETY.md - Memory safety testing and guarantees
- ROADMAP.md - Project roadmap and progress
Vais ensures memory safety through Rust's ownership system and comprehensive testing:
# Run memory safety tests (without AddressSanitizer)
cargo test -p vaisc --test memory_safety_tests
# Run with AddressSanitizer (requires Rust nightly)
./scripts/asan-test.sh
# Run all sanitizers (ASan, UBSan, etc.)
./scripts/run-sanitizers.sh allSee MEMORY_SAFETY.md for detailed information on memory safety guarantees and testing.
brew tap vaislang/tap
brew install vaisDownload from Releases (Linux, macOS Intel/ARM, Windows):
# macOS ARM
curl -LO https://github.com/vaislang/vais/releases/download/v1.0.0/vais-v1.0.0-aarch64-apple-darwin.tar.gz
tar -xzf vais-v1.0.0-aarch64-apple-darwin.tar.gz
./vais/vaisc --versiongit clone https://github.com/vaislang/vais.git
cd vais && cargo build --releasedocker run ghcr.io/vaislang/vais:latest --help| Resource | URL |
|---|---|
| Repository | https://github.com/vaislang/vais |
| Documentation | https://vaislang.github.io/vais/ |
| Playground | https://vais.dev/playground/ |
| Website | https://vais.dev/ |
| Docker Hub | vaislang/vais |
| Homebrew Tap | vaislang/tap |
- GitHub Discussions - Questions, ideas, show & tell
- Contributing Guide - How to contribute
- CHANGELOG - Release history
The prototype implementation is available on the proto branch.
MIT License