ScarScript Documentation
Complete reference and guide for the ScarScript programming language — from your first hello world to building native binaries.
Getting Started
Install the compiler, write your first program, and build a native binary.
Syntax Overview
Variables, operators, control flow, loops, and string interpolation.
Type System
int, dec, str, bool, tuples — inference, annotations, and static rules.
Functions
Declarations, optional return types, multiple returns, closures, recursion.
Standard Library
math, file, sys, time modules plus built-in print and log functions.
CLI Reference
scar run, scar build, scar version — every command explained.
What is ScarScript?
ScarScript is a statically-typed, compiled language that transpiles to Go and produces native binaries. It combines Express.js-style syntax with compile-time safety.
func fib(n: int) int {
if n < 2 { return n }
return fib(n - 1) + fib(n - 2)
}
for i in 0..10 {
print("fib({i}) = {fib(i)}")
}
New to ScarScript? Start with the Getting Started guide — you'll be running programs in under a minute.