GitHub - spectrelang/spectre: Spectre programming language

1 min read Original article ↗

License Status Stars

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:

Installation

Prerequisite: cmake

Run the following in the terminal:

curl https://spectrelang.org/get.sh | sh

Then run to confirm installation:

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})
    }
}

License

GPL-3.0-only - (C) Navid M - 2026