Official website

Quick search

Search pages in English or हिंदी. Detailed language reference is in Scarp Docs.

Top 6 website pages

Language prerelease · Reviewed source

Scarp alpha.6.3: deterministic Top-K and temperature softmax

Published Scarp v0.0.6-alpha.3 adds typed Top-K score selection and stable temperature-aware probabilities, with internal scalar IR verification.

v0.0.6-alpha.3 was published on 7 November 2026. It adds four pure numerical built-ins for finite vectors, along with internal scalar compiler correctness work. Scarp remains an experimental interpreter-backed language; this is not a stable release.

Deterministic Top-K ranking

topk(scores, count) returns the original zero-based indices of the highest scores, greatest first, as an immutable integer collection. topk_values(scores, count) returns their original numerical values in the same order. Equal scores prefer the earlier input index, and asking for zero results is valid. Input scores must be finite; selection is subject to explicit work and allocation quotas.

topk_scores.srp · alpha.6.3
bind scores = [1.0, 5.0, 5.0, -2.0, 3.0];
print(topk(scores, 3));
print(topk_values(scores, 3));
Expected stdout
[integer: 1, 2, 4]
[5.0, 5.0, 3.0]

Top-K source contract · published example · exact expected stdout.

Temperature-controlled probabilities

softmax_temp(scores, temperature) computes a probability vector. logsoftmax_temp(scores, temperature) computes its log probabilities. Temperature must be a positive finite float. Stable maximum-shifting and compensated normalization reduce avoidable overflow; unrepresentable log probabilities are diagnosed rather than published as infinite values. These are deterministic transformations, not random sampling.

temperature_softmax.srp · alpha.6.3
print(softmax_temp([2.0, 2.0], 0.5));
print(logsoftmax_temp([5.0], 2.0));
Expected stdout
[0.5, 0.5]
[0.0]

Temperature softmax source contract · published example · exact expected stdout. These example files are separately tested against the pinned published compiler in the website's CI.

Compiler correctness, not general native compilation

The experimental scalar C11 backend now uses compiler-owned typed expression and statement IR internally, with validation of branches, storage initialization and type expectations. Test-only differential execution compares outcomes against the interpreter. This does not add a public scarp compile CLI or a general native compiler.

Compatibility and limits

These functions extend the existing numerical built-ins without new source syntax or CLI commands. Earlier read-only symbol inspection, vector rms and optional Rust embedding caches remain. Rust embedding consumers exhaustively matching the numeric built-in enum may need changes. Scarp still has no LSP, general tensor engine, GPU backend, model-training framework, top-p sampling, package registry or stable ABI.

Review the official published release, exact source commit, verified platform archives, tested fixture scope, or previous alpha.6.2 cache update.