Skip to content

Sprig stage-0 — implemented feature status ​

This table reflects what the compiler in this directory actually does, as verified by scripts/test.sh. The release validation record is on GitHub. The historical design kit in docs/history/design-kit/ describes target semantics rather than current capabilities.

FeatureFront endStatic semanticsCodegen + runtimeTests
Expression matchone expression per branchstrict contextual/inferred results, shared exhaustive/binder rulesJava 17 switch/yield; no closures; scrutinee oncematch expression runtime/generic/null/effect tests
Explicit export alias.Symbolyesoriginal symbols, collisions, cycles and package boundariesno wrapper/copyreexport runtime/API/package suite
Canonical sprig fmttrivia-preserving lexerparse structure invariantatomic file replacement, check/JSON modesformatter fixtures + valid corpus
Foreign JVM conformance conform C to Jdeclaration form, one per relationexact JVM witness matching, v1 restrictions, foreign conformance conversionemitted implements; non-null entry guards (SPR-CONFORM-*)tests/conform runtime and negative suite
Functions, typed parameters/returns, recursionyesyesJava static methodsruntime 01/02, visitor
Indentation, blocks, if/elif/else, while, for, break/continueyesyesJava control flowruntime 03/13
let/var, local inference, assignment rulesyesyes (SPR-NAME-LET-ASSIGN)locals/static fieldsruntime 16
Classes: named auto-ctor, per-instance defaults, implicit fields/methodsyesyesfinal Java classesruntime 04/12
enum + exhaustive matchyesyesJava enum + if-chainruntime 06
variant + typed case binders + exhaustive matchyesyessealed interface + nested classesruntime 05/14, visitor
Missing/duplicate/wrong-type cases, enum binder rejection—yes (SPR-MATCH-*)—semantics 11 cases
Nullability T?, null checks, narrowingyesyes (SPR-TYPE-NULL/NULLABLE)boxed nullable localsruntime 07
List/MutableList/Map/MutableMap, snapshots, indexing, inyesyes, distinct mutabilityruntime wrappersruntime 09/16
String positions: length, indexing, charAt, codeAt, substring, indexOf, iterationyesUnicode code-point indices; one-code-point String elements; no Char typesprig.runtime.StringOps helpers and code-point iterationruntime 20 + String semantics suite
Immutable collection mutation rejected—yes (SPR-COLLECTION-IMMUTABLE)—semantics
User generics: generic K, V: blocks (one or more parameters) for class/variant/function, explicitly applied as Entry[String, Int], erased and boxed in generated Javayesyes (SPR-TYPE-GENERIC-*)raw Java classes + compiler-controlled boxing/unboxingruntime 19, visitor generic_stack, semantics 8 cases, syntax 08
Generic variant expanded payloads + exhaustive match on instantiationsyesyesraw nested case classesruntime 19
requires X: Equatable equality capabilityyesequality on the parameter allowed only with the clause; value equality in codegenboxed Objects-style equalityvisitor generic_stack, runtime 19
requires X: Comparableparsedrejected as not implemented (SPR-GENERIC-CONSTRAINT)—semantics
Project model: sprig.toml discovery, defaults, init, project --json, deps --json, explicit-file priority, run --binyesvalidated (SPR-PROJECT-*)default entry compiled with the normal pipelineproject model suite
Local and Git Sprig dependencies: recursive resolution, @alias/module.spr imports, exports enforcement, cycle detection, sprig.lock, stale/missing lock refusalyesyes (SPR-DEP-*, SPR-PROJECT-*)dependency source modules compile through the normal pipelinedependency resolver suite
Offline mode for local/Git dependencies (--offline, warm cache required)yesSPR-DEP-OFFLINE when the cache is incomplete~/.sprig/git verified detached checkoutsdependency resolver
Maven/JVM dependency resolutionexact direct release coordinatesApache Resolver effective POM + transitive mediation, schema-5 hashes/graph/locators and compiler identityshared locked check/build/run/api/doctor classpathMaven fixtures + real commons-text showcase
Source callable types fn(A) -> R, nullable (fn(A) -> R)?, invariant, arities 0–3yessignatures/fields/locals/collections/generics, no callable effectsexisting Fn0..Fn3 representationtests/callables
JVM callable ABI with concrete sprig.runtime.Fn0..Fn3 signaturesyesboxed invariant parameters/results, non-null argumentsdirect calls, nullable returned callable and runtime contract guardstests/callables
Lambdas fn(...) => expr, arities 0–3, map/filter/forEachyesyesFn0..Fn3 anonymous classesruntime 10, 18
throw/throws/try/catch/finally (typed errors)yesyes (SPR-FLOW-THROWS)Java exceptionsruntime 08, interop 15
Flow: definite return, unreachable code—yes (SPR-FLOW-*)—semantics
Modules: file imports, alias access, init once, cycle detectionyesyesstatic $init() per moduleruntime 12, semantics
JDK interop: imports, ctors, static/instance methods/fields, overloadsyesreflection-based; reference results nullable and require narrowingdirect Java callsruntime 15, correctness regressions
Checked Int/Int32, explicit integer quotient, numeric literal rangesyesSPR-NUM-* checksNumericOps checked JVM operationsnumeric acceptance suite
IEEE Float/Float32, explicit exact/lossy conversionyesmixed-type and narrowing checksJava double/floatnumeric acceptance suite
BigInt and Decimalyesdistinct native typesBigInteger/BigDecimal wrappersnumeric acceptance suite
Java checked exceptions + typed catch + error.messageyesyesJava try/catchruntime 15
sprig check/run/build/explain/codes/help/capabilities/api/doctor, --json, --syntax-only———scripts/test.sh, agent tooling suite
Explicit local --classpath on check/build/run/api—shared class loader + javac/JVM pathlocked JVM JARs precede explicit entries; compiler libraries isolatedagent tooling suite
Bounded JVM interop: opaque arrays, concrete generics, explicit collection adaptersexplicit Type[Arg] application; @std/jvm.spr; sprig.runtime.jvm.HostBytesstructured interopLevel/interopReasonCodes; wildcards, inference, recursive bounds and varargs rejected before javacarrays keep exact JVM classes; snapshots/copies are independent; no implicit conversionJVM interop suite
javac error → Sprig span translation——line mapby design
Checked effects from omitted class defaults—checked at each constructor call; explicit field values skip unused defaultsdefaults still evaluate per instance, in declaration ordercorrectness regressions
Unit value positions and unsupported type argumentsrejected before codegenSPR-TYPE-UNIT / SPR-TYPE-MISMATCHno invalid Java emittedcorrectness regressions
Match on statically inferred variant caseyessingleton exhaustiveness; impossible other branches rejectedconcrete case instanceof dispatchcorrectness regressions
JSON CLI results—includes command/status and structured diagnosticsrun output carried as programOutputcorrectness regressions
sprig test project runnerordinary .spr files under tests/compile-fail .expect.toml matches stable error codes using normal project/dependency checkingisolated child JVM per runtime test, 30-second timeout, per-test temp directory, deterministic JSON rows and @std/test.spr process helpertest runner integration suite + five-case dogfood project
Managed Linux/macOS SDK install and upgraderelease ZIP + checksum workflowmanaged-install metadata and layout validationstaged installation and atomic current pointer switch; older versions retainedinstaller, upgrade and installed-SDK dogfood suites
SQLite migrations (@sqlite/migrations.spr)Sprig package modulevalidated NNN_description.sql names, sorted ledger and idempotent applytrusted multi-statement SQL and ledger row share a SQLite batch transactionmigration apply/restart/failure-retry suite
CLI parsing (@cli/cli.spr)Sprig package moduletyped option specs, duplicate/unknown/missing checksdeterministic usage, flags/values/aliases/positionalsCLI library and installed json-select dogfood
Sprig module API (sprig api module.spr|@pkg/module.spr)resolved checked ASTdeclaration/field/method/throws/generic metadata; --member Type.membercompiler-owned JSON; never executes codeSprig API suite
Java-to-Sprig wrapper generator (sprig wrap)shared JvmMetadata.Support classification; canonical formatting; generated source is checked before writingplain editable .spr, deterministic, --force overwrite, structured skip reportno runtime reflection or generator dependency; Optional/adapters/throws mappings; unsupported members keep their reason codeswrap suite
Project API inventory (sprig api .)project + lockfile validationsource modules plus each dependency's exported modulesno application execution; stale/unexported targets refusedSprig API suite and installed SDK dogfood
Structured diagnostic metadataoptional relatedHelp and repair fieldsmachineApplicable false unless semantics-preserving and unambiguousstable fields unchangedagent tooling suite
Capability feature guidancefeatureGuidance per unsupported featurealternatives and help topic reflect current compiler onlyadditive to features booleansagent tooling and Sprig API suites
Operational explainwhyMatters, confusedWith, causes/fixes/examples, repair, relatedHelpconservative, compactsame data in text and --jsonagent tooling suite
Sprig-written agent toolsexamples/agent_tools (api-report, diag-summary, api-diff)plain Sprig JSON/file/CLI policyconsume saved compiler JSONagent tools suite
Agent task packdeterministic fixtures and runner under tests/agent_evalacceptance is mechanical; no model run claimedinitial states fail, known solutions passtask-pack gate

Not implemented (honest status): generic type inference, variance, Comparable and user-defined capabilities, inheritance or interfaces, nested/positional patterns, %=, tuples/destructuring, varargs and source array syntax/annotations in interop, wildcard typing or Java generic inference, LSP, publishing/registry, incremental checking, self-hosting. See KNOWN_LIMITATIONS.md for boundaries.

Sprig is licensed under Apache-2.0 · v0.5.0-beta.1 published as a prerelease