Repository navigation
Sprig v0.4.0-alpha.1
Pre-releaseSprig v0.4.0-alpha.1 — formatter, re-exports, match expressions and a correctness pass
Compiler 0.4.0-alpha.1, JDK 17+, Apache-2.0. Experimental Alpha for
trying small tools and contributing, not production migration. Publication runs
through the exact-tag release workflow; the executed evidence is recorded in the
release validation record.
Highlights since v0.3.0-alpha.1
- Canonical formatter —
sprig fmtpreserves comments and trivia, formats a
file or a project, supports--check, and replaces files atomically. The
grammar now retains comments for the formatter while semantic layout stays
strict. - Explicit module re-exports —
export alias.Symbolforwards original
declarations through module facades without wrapper code; collisions, cycles
and package boundaries are diagnosed, andsprig apireports the originating
module. - Expression
match—matchcan be used as an expression with strict
contextual result types, shared exhaustive/binder rules, side-effect-safe
scrutinee evaluation, and checked effects. - Adversarial correctness pass — ten confirmed defects fixed with
independent regressions: inferred global binding soundness, generated Java
type-name collisions, default field effect propagation,finallycompletion
analysis, bare-CR layout positions, JVM source-vs-bridge method resolution,
unnamed-package imports rejected beforejavac, managed-installer ZIP
hardening (links, traversal, duplicate entries), indexed-assignment key/index
type checking (writes now enforce the same compatibility the read path
already enforced), and null-safe nullable scalar equality (Int32?/Float32?
no longer use Java object identity and null operands no longer throw). - Evaluation and mutation contracts — binary operands evaluate left to
right, each exactly once, soinno longer inherits Java's
container.contains(element)argument order; compound assignment through a
map index requires an existing key and raises a catchableErrorwhen the
key is missing instead of a Java unboxing failure. - Managed SDK install and upgrade — versioned user-scoped installs under
~/.sprigwith checksum + smoke verification, atomiccurrentswitch and
sprig upgrade/upgrade --checkon Linux/macOS; source checkouts and
unmanaged ZIPs are refused with actionable diagnostics. - Unicode code-point strings —
length, indexing,charAt,codeAt,
substring,indexOfand iteration count Unicode code points; there is no
Chartype, and the JVM boundary remains a single UTF-16 unit. sprig apifor Sprig and Java — compiler-resolved module/project metadata
with--member, plus existing Java class inspection; neither executes
application code.capabilitiesgained feature guidance andexplainricher
repair metadata.- Libraries and applications —
sprig-cli,sprig-sqlite(including
migrations) andsprig-web, with the mini-web, ledger, sqlite-migrations,
json-select and agent-tool examples, all exercised by the release gates. - Agent-facing diagnostics — every stable
SPR-*code has a concise
meaning plus structuredsprig explain --jsonguidance (causes, safe fixes,
related codes, help topic), and capability claims point to executable
regression evidence enforced by a consistency gate. Repair metadata remains
guidance only:machineApplicablestaysfalse, with no automatic semantic
rewrites. - Repository hygiene — milestone plans and blind-trial evidence are archived,
audit regressions are permanent undertests/adversarial/regressions/, and
docs/README.mddefines the documentation trust order.
Try it
Extract sprig-v0.4.0-alpha.1-jdk.zip after checking its .sha256, add bin
to PATH, and install JDK17+ (the SDK does not bundle Java):
sprig version
sprig init my-tool
cd my-tool
sprig resolve
sprig run
sprig fmt --check
On Windows use bin\sprig.cmd; on Unix bin/sprig. See the
formatter, re-exports,
match expressions and
known limitations contracts.
Compatibility and limits
No existing syntax, numeric, nullability, generic or effect contract was
redesigned. Lock schema 3 and the project model are unchanged. Publishing and
registry/authentication, LSP/IDE, generic inference/variance, interfaces and
self-hosting remain absent; Windows stays an experimental, non-blocking preview.
Types do not prove numerical stability, and Java generic/array/varargs interop
remains limited. sprig api and sprig check never execute application code.