The language today
From small expressions
to bigger ideas.
Available in v0.0.5-alpha.1. A working foundation, with room to evolve.
Clear foundations
Immutable bind and mutable var declarations, checked integers, finite floats, booleans, strings, and explicit output.
Language foundations ↗Functions with intent
Typed funcra functions with named and default arguments, recursion, purity checks, and executable contracts.
Function reference ↗A numerical starting point
Immutable vectors and two-axis tiles, stable reductions, softmax, matrix products, and explicit loss gradients.
Numerical reference ↗Programs that grow
Relative .srp source imports, explicit aliases, public functions and scalar constants, with cycle diagnostics.
Source modules ↗Read it. Run it. Explore it.
A few lines
of Scarp.
Use print for output, bind for an immutable value, and var when a value needs to change. Typed functions use funcra.
The basics example
// A small start. An open-ended journey.
bind language = "Scarp";
print("Hello from", language);
var total = 0;
repeat 5 as index { total += 2; }
print("Total:", total);Hello from Scarp
Total: 10Functions example
pure funcra square(value: integer) -> integer {
return value * value;
}
bind result = square(value: 7);
print(result);49Numerics example
bind weights = tile([1.0, 2.0, -1.0, 3.0], 2, 2);
bind input = [2.0, 1.0];
print(matvec(weights, input));
print(norm([3.0, 4.0]));[4.0, 1.0]
5.0More in the current interpreter
- Lexical scopes, shadowing, short-circuit booleans, and
if/elif/else. - Bounded
whileandrepeatloops, plusbreakandcontinue. - Independent execution budgets and automatic retirement of inaccessible scope values.
- Source diagnostics with error codes, locations, excerpts, and repair guidance.
run,check, andtokensCLI commands, plus explicit Rust embedding APIs.
New in the separately published alpha.6.3
The latest experimental prerelease adds deterministic numerical ranking with topk and topk_values, temperature-controlled softmax_temp and logsoftmax_temp, and test-backed internal scalar compiler verification. The featured examples above still use the older pinned website baseline; newer features are documented with their version-specific examples. They do not add a native compilation CLI or a training framework.
Know the boundaries
Scarp currently interprets programs. Native code generation, a package manager, general-purpose collections, user-defined types, a general tensor engine, GPU execution, and automatic differentiation are future milestones. Execution budgets do not measure total process memory or form a security sandbox.
Read the full development status →