Jacquard 0.1 Release: A Language for AI‑Written, Human‑Reviewed Code

TL;DR

Jacquard 0.1 is a research prototype language that exposes a program’s possible side‑effects, discrete probabilistic behavior, and content‑addressed identity directly in the language, allowing reviewers to reason about AI‑generated code without reading every line.


What Jacquard Is and Why It Matters

Jacquard is a FriendMachine research project that provides a complete toolchain – a surface syntax (.jac), an OCaml type‑and‑effect checker, a CPS interpreter, a C‑emitting AOT backend, a standard library, and a property‑based test framework called Warp. Its core claim is that when most code is produced by machine‑learning models, the language itself must answer "what can this program touch, and how certain are we?" instead of relying on external documentation or ad‑hoc testing.


Core Language Features (Answer‑First)

Effects are part of the type signature

A function signature such as (text) ->{net} text declares that the function may perform the net effect. The runtime rejects any ungranted effect unless the user supplies --allow net. This makes effect usage explicit, enforceable, and visible to reviewers.

"External/world effects are visible in function signatures Brilliant. I think Jai has something like that?" – andai (HN comment)

Worlds let the same program run against different environments

Handlers replace the implementation of external effects. By swapping a handler you can run the same code against a real network, a recorded trace, or a probabilistic model without changing the program source.

Discrete probabilistic programming as a library

sample and observe are ordinary effect operations. Handlers implement exact enumeration or likelihood‑weighting inference, making Bayesian reasoning a regular library call rather than a built‑in runtime feature.

Content‑addressed canonical identity

Jacquard hashes the canonical resolved structure of a definition, stripping comments, formatting, and simple renames. Two programs that differ only in whitespace or variable names have the same hash, enabling structure‑aware diffs and cache‑friendly testing.


Tooling Overview (Answer‑First)

jac command line

  • jac run FILE.jac – execute a program.
  • jac check FILE.jac – type‑and‑effect check.
  • jac fmt FILE.jac – auto‑format.
  • jac diff A.jac B.jac – structural diff based on canonical hashes.
  • jac infer enumerate MODEL.jac – exact probability enumeration.
  • jac test TESTS.jac – run Warp property tests, optionally with exhaustive search and caching.
  • jac build FILE.jqd -o PROG – compile to a native binary via the C backend.

Release binaries

A single install script detects OS/CPU, verifies SHA‑256, and installs jac and jacquard under ~/.local/bin. No OCaml or opam is required for end users.

Development workflow

The repository ships a reproducible release‑evidence script that builds, tests, formats, runs all demos, and records the exact output. The development gate is:

opam exec -- dune build @all
opam exec -- dune runtest
opam exec -- dune fmt
git diff --exit-code

Any formatting change must be committed, ensuring a clean worktree.


Notable Demos (Answer‑First)

  • Factorial with multi‑shot choice – shows handlers that resume a continuation twice, yielding 3 from a simple choose effect.
  • Program repair as Bayesian inference – a failing test becomes an observation; the system enumerates candidate patches and reports the most probable fix (- sub + add).
  • Release‑risk case study – runs a policy under concrete and probabilistic telemetry worlds, then proves safety with Warp across 18 worlds.
  • Agent‑dream world simulation – runs the same policy under scripted and probabilistic handlers, illustrating how world swapping replaces traditional mocking.

Community Reaction (Answer‑First)

  • Reviewers praised the effect‑annotated signatures as a step beyond the binary pure/impure distinction found in languages like Jai. (andai)
  • Some questioned whether the world model is just dependency injection, noting that effect permissions feel more like an OS sandbox than a language feature. (wren6991)
  • Others highlighted the learning curve for new languages: LLMs are trained on mainstream codebases, so a novel syntax may be harder for models to generate effectively. (Cyberdog)
  • Positive remarks about the content‑addressed hashing echo Unison’s approach, suggesting broader adoption could improve caching and reproducibility. (phildenhoff)

Limitations of the 0.1 Prototype (Answer‑First)

Jacquard 0.1 is a research prototype; the .jac surface is a thin projection onto a permanent 27‑form kernel. Missing features include:

  • Concurrency, membrane enforcement, continuous distributions, gradients, typed staging, package management, self‑hosting, and formal soundness proofs.
  • Fine‑grained world grants (currently coarse‑grained).
  • A VM/JIT backend; only a C AOT path is available. For the exact boundary see docs/release/0.1/LIMITS.md.

How to Get Started

  1. Install the binary
    curl -fsSL https://raw.githubusercontent.com/jbwinters/jacquard-lang/jacquard-core-0.1-rc3/scripts/install.sh | sh
    
  2. Run the factorial demo
    jac run ~/.local/share/jacquard/demos/basics/m1-fact.jac   # prints 120
    
  3. Explore the demos (all scripts work with the installed bundle)
    sh ~/.local/share/jacquard/demos/case-studies/release-risk/run.sh
    
  4. Read the human‑friendly introduction at https://research.friendmachine.co/jacquard/ for a step‑by‑step tutorial.

License and Legal Notes

Jacquard is released under the Apache License 2.0. The runtime includes an explicit runtime‑output exception that permits compiled programs to be relicensed arbitrarily, including proprietary licenses. Trademark rights are governed separately in TRADEMARKS.md.


Bottom Line

Jacquard 0.1 demonstrates that a language can make effects, uncertainty, and structural identity first‑class, providing reviewers with machine‑readable guarantees about AI‑generated code. While still a prototype, its toolchain, content‑addressed hashing, and Warp testing framework offer a concrete foundation for future research on safe, AI‑centric software development.

Sources

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Dispatch