Skip to content

Explicit host services ​

The ordinary standard modules now wrap files, paths, process arguments/environment, text/time and recursive JSON. See that page for the current public Sprig contract and docs/tooling/showcases.md for applications.

The following legacy frontend methods remain compatible.

sprig.runtime.host.HostFiles is a small Java platform boundary for a future Sprig-written frontend. It contains no compiler language semantics. Methods:

Java signaturePurposeSprig boundary
readUtf8(String) throws IOException -> StringUTF-8 source inputReference result is treated nullable; check before use.
writeUtf8(String, String) throws IOException -> voidUTF-8 outputUnit; catch/declare IOException.
fileExists(String) -> booleanRegular-file testBool.
canonicalPath(String) throws IOException -> StringResolve a real pathReference result is treated nullable.
listFiles(String) throws IOException -> java.util.List<String>Sorted path snapshotOpaque Java list; no implied Sprig List[String] adapter.

These methods are queried with sprig api sprig.runtime.host.HostFiles --json. They are not auto-imported or intrinsic. Source paths supplied by the caller are explicit. This frontend boundary is limited to IO/path services; the stage-1 lexer, layout, parser, AST, symbols, diagnostics and pretty printer belong in Sprig. The listFiles generic boundary requires an explicit copy adapter before it can become a typed Sprig collection. No new grammar was added for this API.

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