Welcome to Scrii
Welcome to Scrii
Scrii is a small, dynamically typed scripting language with an embeddable C++23
core. It reads like C, skips the semicolons, runs anywhere you can compile
C++23 — and doubles as executable configuration: a Scrii file is just data
with a for loop.
print("Hello, Scrii!")
var total = 0
for (n : [1, 2, 3, 4, 5]) {
total += n
}
print("sum:", total) # sum: 15
var loud = fn(s) { return std.string.upper(s) + "!" }
print(loud("it works")) # IT WORKS!
# Fibers are built in: spawn work, await the result.
var f = std.async.spawn(fn() { return 40 + 2 })
print("async:", std.async.await(f)) # async: 42
Why Scrii
- Reads like C, without the ceremony —
var/const,if/elif/else,
for/foreach/switch, first-classfnvalues. No semicolons, no
significant whitespace. - Dynamic typing that stays out of the way —
int,long,float,
double,string,char,boolean,nil, heterogeneousarray,
key-valueobject. Values carry their type at runtime. - Pipes —
value:name(args)rewrites toname(value, args), so
" hi ":trim():upper()reads left to right. - Fibers and async —
std.async.spawn/await/sleep/racerun
concurrent work without callbacks or threads of your own. - Embeddable by design — a small C++ core with a stable host API for
running scripts, exchanging values, and bridging host functions. Ships as
a static library plus a REPL. - Native plugins — drop-in C++ shared libraries that register functions
and modules straight into the scripting namespace. - Small core, fast startup — a lightweight tree-walking interpreter that
gets from source to running quickly. - Big standard library — strings, math, sorting, hashing, crypto, JSON,
images, compression, file/path/env/time I/O, full networking
(TCP/UDP/HTTP/WebSocket), D-Bus, and audio control (PipeWire, PulseAudio). - Tooling — an interactive REPL, a source formatter (
scrii_fmt), a
language server (scrii_ls), and tree-sitter editor highlighting.
Try it in a minute
git clone https://codefloe.com/okina/scrii.git
cd scrii
cmake -S . -B build && cmake --build build -j
./build/interpreter/scrii_repl examples/01_hello_world/hello.scr
No arguments starts the interactive REPL (:help for commands, :quit to
leave). See Getting started for requirements, optional
native backends, and build options.
Documentation overview
- Getting started — build, run scripts, write a first program.
- CLI Reference —
scrii_replflags and REPL commands. - Examples — a topic-by-topic tour of runnable scripts.
- Language — Syntax, Types, Descriptors, Operators, Control Flow, Functions, Builtins, Errors.
- Standard library — everything under the global
stdobject (overview). - Tooling — the formatter (
scrii_fmt), language server (scrii_ls), and tree-sitter highlighting. - Native plugins and Embedding for C++.
Scrii is under heavy development. Expect the language and library surfaces to
grow and occasionally change.