A modern systems programming language with Go-like fiber concurrency, pattern matching, and a clean syntax. Compiles to bytecode and runs on a custom VM.
- Fiber-based concurrency — lightweight green threads with channels
- Pattern matching — with guards and destructuring
- Strong typing — with type inference and generics
- Clean syntax — inspired by Rust, Go, and Swift
- Fast iteration — bytecode compilation for quick development cycles
git clone https://github.com/HelgeSverre/lira.git
cd lira
# Build the compiler and VM
just build
# Run the hello world example
just run examples/hello.li// hello.li
fn main() {
println("Hello, Lira!")
}
| Command | Description |
|---|---|
just build |
Build compiler and VM (debug) |
just release |
Build in release mode |
just test |
Run all tests |
just test-verbose |
Run tests with output |
just run <file> |
Compile and run a .li file |
just check |
Type check without building |
just clippy |
Run Rust linter |
just fmt |
Format Rust code |
just clean |
Clean build artifacts |
# Build
cargo build --package lirac --package liravm
# Compile a file
cargo run --package lirac -- compile examples/hello.li -o /tmp/hello.lic
# Run bytecode
cargo run --package liravm -- run /tmp/hello.lic
# Run tests
cargo test --workspacelirac — The Lira compiler
lirac compile <file.li> [-o output.lic] # Compile to bytecode
lirac check <file.li> # Type check only
lirac --version # Show versionliravm — The Lira virtual machine
liravm run <file.lic> # Execute bytecode
liravm run-debug <file> # Run with debug output
liravm --version # Show versionlira-lsp — The Lira language server
lira-lsp # Start LSP server (stdio)LSP Features:
- Diagnostics (syntax and type errors)
- Completion (keywords, builtins, user symbols)
- Hover (type info and documentation)
- Go to definition
- Find references
- Document symbols (outline)
- Semantic highlighting
- Signature help (parameter hints)
- Folding ranges
- Document links (clickable imports)
- Inlay hints (inline type annotations)
- Rename symbol
- Call hierarchy (callers/callees)
- Code actions (quick fixes, refactoring)
lira-doc — The Lira documentation generator
lira-doc <file.li> # Generate Markdown docs for a file
lira-doc stdlib/ # Generate docs for a directory| Editor | Extension | Syntax | LSP | Tree-sitter |
|---|---|---|---|---|
| VS Code | vscode-lira | ✓ | ✓ | — |
| Zed | zed-lira | ✓ | ✓ | ✓ |
| Neovim | vim-lira | ✓ | ✓ | ✓ |
| Helix | helix-lira | ✓ | ✓ | ✓ |
| Vim | vim-lira | ✓ | — | — |
| IntelliJ | intellij-lira | ✓ | — | — |
Install with just <editor>-install (e.g., just nvim-install).
lira/
├── crates/
│ ├── lirac/ # Compiler (lexer, parser, checker, codegen)
│ ├── liravm/ # Virtual machine (interpreter, fibers, runtime)
│ ├── lira-core/ # Shared types & opcodes
│ ├── lira-lsp/ # Language server (LSP)
│ └── lira-doc/ # Documentation generator
├── editors/ # Editor extensions
│ ├── tree-sitter-lira/ # Tree-sitter grammar
│ ├── vscode-lira/ # VS Code extension
│ ├── vim-lira/ # Vim/Neovim plugin
│ ├── zed-lira/ # Zed extension
│ ├── helix-lira/ # Helix config
│ └── intellij-lira/ # IntelliJ plugin
├── stdlib/ # Standard library (20 modules)
├── examples/ # 87 example programs
├── docs/ # Language specifications
└── justfile # Build commands
// Variables and types
let name: string = "Lira"
var count = 0 // type inferred
// Functions
fn greet(name: string) -> string {
return "Hello, " + name
}
// Structs with methods
struct Point { x: int, y: int }
impl Point {
fn distance(self) -> float {
return sqrt(self.x * self.x + self.y * self.y)
}
}
// Pattern matching
match value {
0 => "zero",
n if n < 0 => "negative",
_ => "positive"
}
// Fiber concurrency
let ch = chan(1)
spawn { send(ch, compute()) }
let result = recv(ch)
// Imports
import std.fs.{read_file, write_file}
| Document | Description |
|---|---|
| Language Overview | Introduction to Lira |
| Type System | Types, generics, inference |
| Concurrency | Fibers, channels, select |
| Standard Library | Stdlib reference |
| Bytecode Format | .lic file specification |
| Roadmap | Development progress |
Current Phase: Developer Tooling (Phase 8)
| Component | Status |
|---|---|
| Lexer & Parser | Complete |
| Type System | Complete |
| Bytecode Compiler | Complete |
| VM Core | Complete |
| Fiber Runtime | Complete |
| Standard Library | Complete (21 modules) |
| Language Server | Complete (14 features) |
| Documentation Generator | Complete |
| Editor Extensions | Complete (6 editors) |
| Code Formatter | Planned |
| REPL | Planned |
| Debugger | Planned |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Run tests (
just test) - Run linter (
just clippy) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open a Pull Request
MIT License — see LICENSE for details.