Scarp v0.0.5-alpha.3 — published compiler and new CLI
Published November 2, 2026 at 19:41 IST. Official prerelease and exact source commit 7715c28df09c7703b39e14fddb963275b25df476.
New Scarp-first commands
The published alpha.3 release adds exec, verify, inspect tokens, inspect ast, inspect modules, guide, version, and offline diagnose --json. Older run, check, tokens, and modules commands remain available for existing scripts and extensions.
Important distinction: scarp verify statically checks syntax, names and module types without running ordinary program statements, whereas historical scarp check executes selected runtime paths silently. inspect ast is parser-only, not a type checker or a stable machine-readable AST schema. Module JSON inspection is separately versioned. None of these commands compiles .srp to a native executable, provides a package manager, or forwards arbitrary application arguments.
Examples using the alpha.3 executable (run from the directory containing the named examples):
scarp version
scarp diagnose --json
scarp exec text_construction.srp
scarp verify text_construction.srp
scarp inspect tokens text_construction.srp
scarp inspect ast text_construction.srp
scarp inspect modules --json collection_module.srp
scarp explain E0015
diagnose --json is an offline capability and environment report, not a health diagnosis or an installation step. Successful inspect ast emits a human-readable development debug representation; do not parse it as a stable protocol.
Four complete release-backed Scarp programs
The following full .srp sources, imported modules and expected stdout are mirrored from the published tag's examples. English and Hindi fences are checked against exact upstream Git blobs. A separate CI job builds the precise alpha.3 compiler and verifies verify and exec with byte-identical output.
1. Unicode text construction
Entry source: text_construction.srp
bind greeting: string = text_concat("Hello, ", "🌍");
bind planet = text_slice(greeting, 7, 1);
print(greeting);
print(text_repeat(planet, 3));
print(text_len(greeting), text_bytes(greeting));
Published expected stdout:
Hello, 🌍
🌍🌍🌍
8 11
text_concat joins strings, text_slice counts Unicode scalar values, and text_repeat repeats without implicit byte indexing. The globe emoji is one scalar but four UTF-8 bytes. Text allocation is bounded; string concatenation with + is not the same feature.
2. Finite-float refinement with contracts
Entry source: float_refinement.srp
// Newton refinement uses float values and an integer iteration count.
pure funcra root(value: float, steps: integer = 6) -> float
needs value > 0.0;
needs steps >= 0;
ensures result > 0.0;
{
var estimate = 1.0;
repeat steps as iteration {
estimate = (estimate + value / estimate) / 2.0;
}
return estimate;
}
bind sqrt2 = root(2.0);
print("sqrt2 checked", sqrt2 > 1.414 and sqrt2 < 1.415);
print("sqrt9", root(9.0));
Published expected stdout:
sqrt2 checked true
sqrt9 3.0
The iterative example approximates square roots using a typed pure funcra, preconditions, a postcondition and bounded repeat. It does not introduce an arbitrary-precision mathematics library.
3. Typed integer collection across modules
Imported source: modules/integer_series.srp
pub bind low_bits = 0b1111;
pub pure funcra sequence(count: integer, start: integer = 0) -> integers
needs count >= 0;
ensures ints_len(result) == count;
{
return ints_range(start, count, 1);
}
pub pure funcra spread(values: integers) -> float
needs ints_len(values) > 0;
{
return stddev(ints_to_vector(values));
}
Entry source: collection_module.srp
import "modules/integer_series.srp" as series;
bind values = series.sequence(2, start: -1);
print(values, series.spread(values), series.low_bits & 0x3);
Published expected stdout:
[integer: -1, 0] 0.5 3
The imported module exposes integers results, a typed default argument, ints_range, stddev and a bitwise mask. All source files must be kept under their shown relative paths; private module declarations remain inaccessible.
4. Explicit coefficient fitting
Entry source: coefficient_fit.srp
// Fit y = coefficient * x using an explicitly written squared-error gradient.
pure funcra loss(inputs: vector, targets: vector, coefficient: float) -> float
needs len(inputs) > 0;
needs len(inputs) == len(targets);
{
return mse(scale(inputs, coefficient), targets);
}
bind inputs = [1.0, 2.0, 3.0];
bind targets = [2.0, 4.0, 6.0];
var coefficient = 0.0;
repeat 40 as iteration {
bind residuals = add(scale(inputs, coefficient), scale(targets, -1.0));
bind gradient = 2.0 * dot(inputs, residuals) / 3.0;
coefficient -= 0.05 * gradient;
}
print(coefficient > 1.999999999 and coefficient < 2.000000001);
print(loss(coefficient: coefficient, targets: targets, inputs: inputs) < 1e-18);
Published expected stdout:
true
true
The numerical example implements its own finite-step squared-error gradient updates. This is authored application logic, not built-in automatic differentiation or a general AI training framework.
Structured compiler diagnostic (schema version 1)
The tagged sample intentionally fails due to an explicit type mismatch (E0015). The source is:
// This sample intentionally reports E0015.
bind count: integer = "two";
The published JSON diagnostic snapshot is:
{"schema_version":1,"severity":"error","code":"E0015","message":"expected integer, found string","span_encoding":"utf-8-bytes","column_encoding":"unicode-scalar","position_base":1,"primary":{"path":"type_error.srp","span":[66,71],"start":{"line":2,"column":23},"end":{"line":2,"column":28}},"related":[{"message":"the binding's type is declared here","location":{"path":"type_error.srp","span":[56,63],"start":{"line":2,"column":13},"end":{"line":2,"column":20}}}],"help":"keep primitive types consistent; numeric operands must share a numeric kind, logic requires booleans"}
--diagnostic-format=json selects machine-readable failure diagnostics, not a successful AST serialization. Source spans are half-open UTF-8 byte ranges; line/column coordinates count Unicode scalar characters. CI verifies the E0015 failure and schema fields against this published snapshot, with no program stdout.
Install and test correctly
Use the v0.0.5-alpha.3 assets, selecting the matching Windows x64, Linux x64, or macOS ARM64 archive. Compare the published SHA-256 checksum, then run scarp version or scarp --version before using alpha.3 syntax.
The upgrade-readiness test still proves only that 11 alpha.1 fixtures ran unchanged on alpha.2, not that all existing projects are compatible with alpha.3. No stable-language guarantee is made.