Skip to content

About

Language-neutral host integrations and adapters for Jacquard

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Jacquard Host

Call checked Jacquard functions from Python, TypeScript, Go, Rust, Java, or .NET and implement their declared host operations with ordinary services. Jacquard owns the decision logic; the host owns persistence, I/O, and application lifetimes.

The SDK prepares and caches checked programs, converts native Python values, binds services to exact operation identities, and retains the raw evidence for every invocation. Python 3.11+, Node.js 22+, Go 1.24+, Rust 1.88+, Java 21+, or .NET 8+, with no third-party runtime dependencies. The TypeScript SDK, the Go SDK, the Rust SDK, the Java SDK, and the .NET SDK implement the pinned protocol independently. The TypeScript SDK supports async service methods, the Go SDK maps native Go types and context cancellation, the Rust SDK maps native Rust types through record! and variants! declarations, the Java SDK maps records, enums, and sealed interfaces through explicit codecs, and the .NET SDK maps records, enumerations, and type hierarchies through explicit codecs without reflection over members, with CancellationToken cancellation.

Experimental: the SDK targets Core's pinned jacquard-host-v0 protocol. Core is installed separately. Each invocation runs one fresh, serial worker; the host and operating system are trusted. See limits.

Get started

For Node.js, follow the TypeScript walkthrough; for Go, the Go walkthrough; for Rust, the Rust walkthrough; for Java, the Java walkthrough; for .NET, the .NET walkthrough. For Python:

From a clone of this repository:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install .

Follow setup to build the matching Core worker and configure JACQUARD_BIN and JACQUARD_PRELUDE, then run:

python examples/quickstart/run.py

The quickstart puts a shipping policy in Jacquard:

shipping-cost : (Int) ->{} Int
shipping-cost(total) = if lt(total, 50) then 5 else 0

Python prepares it and calls the checked function:

from jacquard_host import Runtime

program = Runtime().prepare("examples/quickstart/rules.jac")
shipping_cost = program.function("shipping-cost")

print(shipping_cost(35))  # 5
print(shipping_cost(75))  # 0

Use function.invoke(...) for an invocation object with .unwrap(), a readable .render(), raw protocol evidence in .raw, and explicit .save(path) inspection. Native calls and .unwrap() raise JacquardError subclasses on failure, retaining the result and code.

Examples

The runnable projects use synthetic inputs and require no external services:

Project What it demonstrates
Quickstart One checked policy, ordinary Python integers
Triage Dataclasses, enums, optional fields, independent batching
Planner A bounded optimal assignment under capacities and deadlines
Fulfillment Named services, SQLite transactions, idempotency, explicit outbox recovery

Run all four against the installed SDK and real Core:

python scripts/check_examples.py

The SDK guide covers data mappings, service binding, inspection, caching, and failure handling. Missing handlers and invalid inputs are rejected before a worker starts. Services are synchronous, and no outside action is retried automatically. Data mappings are explicit; generated bindings await Core's structured host interface exporter.

Compatibility and scope

Jacquard Core owns language semantics, checked effects, canonical identities, grants, and the host contract. This repository consumes that contract and owns the Python adapter, resource lifetimes, host services, and integration evidence.

The exact compatibility pin includes the experimental v0 carrier, vendored fixtures, evidence pack, and pending Core decisions. Adapters pin one Core release in core-pin.json; setup installs that release and verifies its checksum. Version strings alone do not establish compatibility.

The current boundary is for bounded first-party programs on a trusted host. Nested lists reach the frame-depth limit quickly; independent batching helps only when the application's semantics allow it. A synchronous Python callback can outlast the carrier deadline. Read limits and authority before integrating outside actions.

The low-level adapter guide documents exact protocol values, the named study persistence operation, and the serial loopback socket/HTTP integration. The study slice uses synthetic data. Public deployment and real participant collection require separate application work.

Development

See CONTRIBUTING.md for offline tests, installed-distribution checks, and live runs. CI tests Python 3.11–3.13, Node.js 22/24, Go 1.24 and stable, Rust 1.88 and stable, Java 21 and 25, and .NET 8 and 10. It separately installs the pinned Core release for every adapter's live suite and the public examples.

Evidence records the checks and platform claims; development experiments preserve the usability findings and local measurements behind the SDK. The roadmap, Core requirements, and changelog describe remaining work and changes.

Licensed under Apache 2.0. The vendored Core conformance artifacts retain their upstream attribution in NOTICE.

About

Language-neutral host integrations and adapters for Jacquard

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages