NimScript
1 program
Added 2026-03-05T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: nims
Provenance: commit 9cd33ae043 · authored 2026-03-05T12:16:14+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Prime Numbers
Provenance: commit 9cd33ae043 · authored 2026-03-05T12:16:14+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
# NimScript example: simple task runner and utilities
# NimScript is the scripting subset of the Nim programming language
proc isPrime(n: int): bool =
if n < 2: return false
if n == 2: return true
if n mod 2 == 0: return false
var i = 3
while i * i <= n:
if n mod i == 0: return false
i += 2
true
proc firstNPrimes(n: int): seq[int] =
result = @[]
var candidate = 2
while result.len < n:
if isPrime(candidate):
result.add(candidate)
inc candidate
let primes = firstNPrimes(10)
echo "First 10 primes: ", primes