Scarp is an experimental interpreter. Start by choosing a matching release, rather than mixing commands from different prereleases. The latest reviewed published release is v0.0.6-alpha.3. The older v0.0.5-alpha.1 version remains the baseline for the homepage examples and some documentation.
01 · Get the interpreter
- Download the v0.0.6-alpha.3 archive for Windows x64, Linux x64 GNU or Apple Silicon macOS.
- Download its
.sha256file, compare the digest with the published checksum and extract the archive only after verification succeeds. - Open a terminal in the extracted folder and confirm the version:Run the local executable asTerminal
scarp version./scarpon Linux/macOS or.\\scarp.exeon Windows PowerShell if it is not in yourPATH. The commands below usescarpfor readability.
Keep the archive's bundled files together. The published package is an interpreter, not an installer or a native-code compiler. Building from source is also possible using the exact published Rust source.
02 · Write and run hello.srp
Save a UTF-8 text file named hello.srp in the current folder:
print("Hello from Scarp!");With v0.0.6-alpha.3, statically check the source and then execute it:
scarp verify hello.srp
scarp exec hello.srpExpected output when executed:
Hello from Scarp!verify checks source without executing normal runtime statements; exec runs the interpreter. A successful static check does not guarantee that runtime operations will succeed.
03 · Create an offline project
Starting with alpha.4, Scarp can create a small project with an explicit Scarp.project manifest. Choose a destination that does not already exist:
scarp create hello-world
scarp verify hello-world
scarp launch hello-worldProject verification is static; launch executes the declared entrypoint. No package registry, dependency resolution, installer, or native executable is produced. See the release-pinned project workflow.
04 · Explore alpha.6-only tools
v0.0.6-alpha.3 adds opt-in, read-only symbol and reference indexes. These commands type-check source without executing ordinary statements; they are not an integrated language server:
scarp inspect symbols --json hello.srp
scarp inspect references --json hello.srpThe same release adds rms(vector) for finite, nonempty numerical vectors. This example is separately tested in website CI against the published alpha.6 interpreter:
print(rms([2.0, -2.0]));2.0See the exact tested fixture scope and symbol-index reference. Do not run alpha.6-only examples with the older alpha.1 interpreter.
05 · Rank scores in alpha.6.3
The published v0.0.6-alpha.3 interpreter also supports pure topk, topk_values, softmax_temp and logsoftmax_temp numerical built-ins. Tie scores keep earlier input indices first; temperature must be a positive finite float. No random sampling or GPU runtime is included.
bind scores = [1.0, 5.0, 5.0, -2.0, 3.0];
print(topk(scores, 3));
print(topk_values(scores, 3));[integer: 1, 2, 4]
[5.0, 5.0, 3.0]This follows the exact alpha.6.3 release examples. Read the published-only fixture evidence before assuming code works on an older compiler.
Using the older website example baseline?
The featured homepage examples are pinned to v0.0.5-alpha.1. Under that older interpreter, use these historical commands instead:
scarp run hello.srp
scarp check hello.srpLegacy check can evaluate selected program paths while suppressing output. It is not equivalent to the later static-only verify. Consult the version-by-version migration guide.
Choose what to learn next
| Goal | Official resource |
|---|---|
| First Scarp program | First-program guide |
| Language syntax | Language overview |
| Typed functions | Function reference |
| Numerical foundations | Numerics guide |
| Multiple source files | Source modules |
| हिंदी में सीखें | हिंदी दस्तावेज़ |
The documentation website may use an older compiler baseline: read each guide's version notes before copying its commands into the latest prerelease.
