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.7: conditional values and Unicode scalar escapes

Scarp v0.0.6-alpha.7 adds interpreter conditional expressions and checked Unicode scalar escapes for strings.

v0.0.6-alpha.7 was published on 11 November 2026. This experimental interpreter release introduces two language features: value-returning conditionals and explicit Unicode scalar escapes. The older examples and their source pins stay available.

Use a conditional as an expression

An if/elif/else expression produces one value. Each condition must be boolean and each branch must yield one expression with the same exact type. A final else is required. Only the selected branch is evaluated, allowing conditional values without computing unused branches.

This form is for interpreter expressions. It is not accepted in module constants or the experimental C11 and ELF64 native backends. Existing statement-level conditionals remain distinct.

Encode Unicode scalars explicitly

Strings can now contain \u{HEX} escapes with one to six ASCII hexadecimal digits. The lexer decodes valid Unicode scalar values into UTF-8, rejecting malformed syntax, surrogate values and code points above U+10FFFF. The feature is a string escape, not a separate character type.

A tagged source example with exact stdout

The compiler repository includes the following example at the published source commit. The unselected branches intentionally contain invalid operations, demonstrating lazy branch evaluation.

conditional_unicode.srp · alpha.6.7
bind score = 73;
bind label = if score >= 90 {
    "\u{1F44B}"
} elif score >= 60 {
    "\u{0928}\u{092E}\u{0938}\u{094D}\u{0924}\u{0947} \u{1F44B}"
} else {
    text_repeat("unreached", -1)
};
print(label, if true { 7 } else { 1 / 0 });
Expected stdout
नमस्ते 👋 7

Review the exact tagged source and expected output. A matching website fixture runs only with the pinned published compiler and is checked for byte-for-byte output and static verification.

Compatibility limits and next steps

Exhaustive Rust embedders matching ExpressionKind must handle its new Conditional variant. There is still no general scarp compile command, complete native executable backend, integrated LSP, stable ABI or GPU model runtime. The earlier bounded input and tuple features remain experimental.

See the official release notes, source-pinned publication record, three platform downloads, and limited CI compatibility evidence.