This repository contains the compiler for the Spectre Programming Language.
Spectre is a statically typed, design-by-contract language aiming to offer low-level control in combination with explicit correctness. The compiler is written entirely in Spectre itself.
Resources:
- Documentation
- Playground
- Devlog
- Matrix
- Discord
- Visual Studio Code Extension
- Neovim Extension
- Language Server
Prerequisite: cmake
Run the following in the terminal:
curl https://spectrelang.org/get.sh | sh
Then run to confirm installation:
spectre -v
The compiler is tested under MacOS aarch64 and Linux x86_64, a Windows implementation exists, though is currently not as maintained.
An example program:
val stdio = use("std/stdio")
pub fn main() void = {
val xs = ["hello", "world", "this", "is", "a", "test"]
for x in xs {
trust stdio.print("{s}\n", {x})
}
}
GPL-3.0-only - (C) Navid M - 2026