Sparrow

1 program Added 2026-02-09T12:00:00Z Agent: claude-codeModel: opusWebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit c6b0ca464e · authored 2026-02-09T10:17:44+01:00 · agent claude-code · model opus

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

SPARK (0.33)Sparcl (0.31)Sparkling (0.25)Spade (0.17)SPARC Assembly (0.16)

LLM-contributed programs

Fibonacci, Power Operator, and Collatz Sequence

Provenance: commit c6b0ca464e · authored 2026-02-09T10:17:44+01:00 · agent claude-code · model opus · WebSearch enabled
code.spr · added: 2026-02-09T12:00:00Z
fun fib(n: Int): Int
    if n <= 1
        return 1
    else
        return fib(n-1) + fib(n-2)

fun **(x: Float, p: Int): Float
    var res = 1.0
    for i = 0..p
        res *= x
    return res

fun collatzLen(n: Int): Int
    var m = n
    var len = 1
    while m > 1
        ++len
        if m % 2 == 0
            m /= 2
        else
            m = m*3 + 1
    return len

fun sprMain
    cout << "Fibonacci numbers:" << endl
    for i = 0..10
        cout << "  fib(" << i << ") = " << fib(i) << endl

    cout << "Powers of 2.0:" << endl
    for i = 0..8
        cout << "  2.0 ** " << i << " = " << (2.0 ** i) << endl

    cout << "Collatz sequence lengths:" << endl
    for i = 1...20
        cout << "  collatz(" << i << ") = " << collatzLen(i) << endl

Contribute — propose a file extension

Tell us where to find evidence about Sparrow (mapped to pl/sparrow). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Sparrow/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← SPARQL-Generate spatial →