Sprig does not try to make coding agents smarter. It tries to give them less to guess.
Sprig is an experimental, statically typed JVM language for people building tools, automation and application code. Agent-friendly should also mean review-friendly: inspectable source, explicit signatures, compiler queries and structured diagnostics help people verify what changed.
The latest published SDK is v0.8.0-beta.1; it requires a separate JDK 21 or newer. Linux and macOS are release-supported. Windows is an experimental preview. Sprig uses a Java stage-0 compiler and is not self-hosted. Check the release status and installed sprig capabilities --json for the exact implemented feature set.
A closed variant, a match that must list every case, explicit function
signatures and a Java call whose result must be checked for null:
import java.time.LocalDate as LocalDate
variant Shape:
Circle(radius: Float)
Rect(width: Float, height: Float)
func area(shape: Shape) -> Float:
match shape:
case Shape.Circle as circle:
return 3.14159 * circle.radius * circle.radius
case Shape.Rect as rect:
return rect.width * rect.height
print(area(Shape.Circle(radius=1.0)))
print(area(Shape.Rect(width=2.0, height=3.5)))
# Java reference results are nullable until checked.
let date = LocalDate.parse("2026-10-05")
if date != null:
print(date.getDayOfWeek())
sprig run shapes.spr prints 3.14159, 7.0 and MONDAY. Without the null
check, sprig check unchecked.spr rejects the program:
import java.time.LocalDate as LocalDate
let date = LocalDate.parse("2026-10-05")
print(date.getDayOfWeek())
SPR-TYPE-NULLABLE [TYPE] unchecked.spr:4:12: Cannot access 'getDayOfWeek' on a value that may be null (receiver type LocalDate?)
hint: Bind the receiver to a let and check it with 'if value != null:' before using 'getDayOfWeek'.
1 error(s); run 'sprig explain <code>' for details on a diagnostic code.
- Install the SDK and the VS Code extension
- Beginner tutorial
- 中文教程
- Try the local Task Tracker
- Browse application examples and first-party libraries
- Gradle/JVM and Fabric integration with a runnable SDK starter
- Language, JVM and tooling references
Install the published SDK, then create a project:
sprig init hello
cd hello
sprig resolve
sprig runJDK 21+, Python 3.12+, Node.js 20+/npm and Git are needed for the full developer gate. The first build downloads pinned ANTLR and Maven Resolver tools.
git clone https://github.com/ColinHouse/Sprig.git
cd Sprig
python3 scripts/build.py
./scripts/verify.shSee contributor instructions and AI assistance disclosure. Contributions are welcome; the author remains responsible for reviewing generated changes, tests, licensing and correctness.