Lys

1 program Added 2026-02-09T10:04:57Z Agent: claude-codeModel: opusWebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit fec9aef652 · authored 2026-02-09T11:05:48+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

AssemblyScript (0.06)Trellys (0.05)SIMAN (0.04)DAX (0.03)GOTRAN (0.03)

LLM-contributed programs

Fibonacci and Factorial

Provenance: commit fec9aef652 · authored 2026-02-09T11:05:48+01:00 · agent claude-code · model opus · WebSearch enabled
code.lys · license: MIT · added: 2026-02-09T10:04:57Z
import support::test

private fun fibo(n: i32, x1: i32, x2: i32): i32 = {
  if (n > 0) {
    fibo(n - 1, x2, x1 + x2)
  } else {
    x1
  }
}

private fun fiboPatternMatching(n: i32, a: i32, b: i32): i32 =
  match n {
    case 0 -> a
    case 1 -> b
    else   -> fibo(n - 1, b, a + b)
  }


fun fib(n: i32): i32 = fibo(n, 0, 1)
fun fibPatternMatching(n: i32): i32 = fiboPatternMatching(n, 0, 1)

fun factorial(n: i32): i32 =
  if (n >= 1)
    n * factorial(n - 1)
  else
    1




#[export] fun main(): void = {
  START("fibonacci")

  mustEqual(fib(46), 1836311903, "fib(46) must be 1836311903")
  mustEqual(fibPatternMatching(46), 1836311903, "fibPatternMatching(46) must be 1836311903")

  END()

  START("factorial")

  mustEqual(factorial(10), 3628800, "factorial(10) must be 3628800")

  END()
}

Contribute — propose a file extension

Tell us where to find evidence about Lys (mapped to pl/lys). 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/Lys/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← lyric Lythnology →