Install the compiler
Ostrin is the published experimental developer release. The installers download its matching archive, verify its SHA-256 checksum and check ostrinc --version. Read the release notes and platform limits ↗ before installing.
# Linux x86_64 or macOS ARM64
curl --fail --location https://raw.githubusercontent.com/sircalch/Ostrin/main/scripts/install.sh \
--output /tmp/ostrinc-install.sh
sh /tmp/ostrinc-install.sh --version 0.2.0
# Windows PowerShell
$installer = Join-Path $env:TEMP 'ostrinc-install.ps1'
Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/sircalch/Ostrin/main/scripts/install.ps1 -OutFile $installer
powershell -ExecutionPolicy Bypass -File $installer -Version 0.2.0 -AddToPath
ostrinc --version
ostrinc --run examples/hello.ostrin
To build from source instead: cargo build --release --manifest-path compiler/Cargo.toml. Package-manager channels (Homebrew, winget, Scoop, Chocolatey, AUR) are not available yet.
Create a project with dependencies
--new creates a manifest and a main.ostrin with a test. Dependencies are local paths or Git repositories; builds write a deterministic ostrin.lock.
ostrinc --new my_project
ostrinc --run --project my_project
ostrinc --locked --run --project my_project # require the existing lockfile
ostrinc --fetch --run --project my_project # explicitly fetch Git dependencies
[package]
name = "my_project"
version = "0.1.0"
entry = "main.ostrin"
[dependencies]
plot = { path = "../plot" }
There is no public package registry yet. See the package design ↗.
Model absolute temperature
A unit suffix such as 310 K denotes a linear temperature interval. Create an absolute reading explicitly with temperature_point(value, scale); supported scales are "K", "degC" and "degF". Point comparisons account for offsets, shifting a point by an interval keeps a point, and subtracting two points returns a Kelvin interval.
fn main() -> Void {
room = temperature_point(20.0, "degC")
warmer = room + 10.0 K
difference = warmer - room
print(temperature_point_to(warmer, "degF"))
print(difference)
assert(temperature_point_to(warmer, "degF") == temperature_point(86.0, "degF"))
}
Adding two absolute points is a type error. Scalar points work in the interpreter, native backend and WASI. The development compiler also has a structural Measurement<TemperaturePoint> profile with empty sources for storage and tested ownership paths. Absolute-point uncertainty propagation, covariance and point arrays remain unsupported; published v0.2.0 binaries do not include this profile. See the unit and type design ↗.
Inspect scientific effects and provenance
The experimental --effect-report command inventories known effect sites. --provenance-report adds a stable source hash, compiler target, effect inventory and explicit replay limits for a concrete entry file.
ostrinc --effect-report examples/measurement_scalar.ostrin
ostrinc --effect-report --json examples/measurement_scalar.ostrin
ostrinc --require-closed-effects examples/measurement_scalar.ostrin
ostrinc --provenance-report --json examples/measurement_scalar.ostrin
These reports are evidence for future checking; they are conservative and do not prove that a program is pure or reproducible. See the public provenance artifact ↗ and the reproduction guide ↗.
Test and format
Functions named test_* are tests. assert_eq reports both values when it fails.
ostrinc --test examples/testing.ostrin
ostrinc --test --project my_project
ostrinc --fmt --check main.ostrin
Compile to native code
The native backend transpiles to C and compiles it with gcc, clang or cc (or OSTRIN_CC). The interpreter is the semantic reference, and a differential test compares every example against it.
ostrinc --compile examples/collections.ostrin
ostrinc --compile --leak-check examples/ownership_primitives.ostrin
ostrinc --compile --native-threads examples/native_threads.ostrin
ostrinc --emit-c examples/lab_pipeline.ostrin
Constructs outside the migrated HIR/IR families use a verified fallback; a few are rejected with a clear error instead of compiling with different semantics.
Build WebAssembly (WASI)
Programs compile to wasm32-wasip1 with the WASI SDK's clang; cancellation uses WebAssembly exception handling, so the host must support it. The compiler itself also runs as WASI — that is what powers the playground and the Lab.
export OSTRIN_WASI_CC=/path/to/wasi-sdk/bin/clang
ostrinc --compile --target wasm32-wasi examples/hello.ostrin
cargo build --manifest-path compiler/Cargo.toml --target wasm32-wasip1 --release
Use Visual Studio Code
The extension in vscode-ostrin/ uses ostrinc --lsp for diagnostics, hover, completion, definitions, references, rename and semantic tokens, and ostrinc --dap for breakpoints, stepping and variables. It is distributed as a local VSIX, not through the Marketplace.
cd vscode-ostrin
npx --yes @vscode/vsce package
code --install-extension ./ostrin-language-support-0.4.0.vsix
Extension README ↗
How this site proves its results
The Scientific Lab, the Cookbook and the compiler pipeline come from website/lab-data.js, generated by scripts/lab-data.mjs from programs in examples/ and run with ostrinc.wasm. CI regenerates it and fails when a source, a recorded output or a static page output drifts. Version, counts and release status come from scripts/site-facts.mjs.
node scripts/lab-data.mjs # check recorded outputs
node scripts/website-metadata.mjs # check version, counts and release facts
node scripts/website-check.mjs # links, evidence, claims