Skip to main content

Public WIT contract

The public Fiji contract is the WIT package fiji:jvm@0.1.0, shipped at components/wit/fiji-jvm.wit.

This is the stability surface for 0.4.x: anything documented here is stable for the release line. Everything else — substrate WIT, composition pins, internal type names — is implementation detail.

What's in the contract

The public WIT exposes the operations a host needs to drive a JVM instance:

Operation categoryWhat it does
Class loadingHand .class bytes to the runtime; receive a typed handle.
Method invocationCall static methods, instance methods, and constructors with typed value arguments.
Field accessGet and set fields on resolved classes and instances.
Array opsCreate arrays, read and write elements, query length.
Value marshallingExchange primitives, strings, arrays, and object references across the boundary as typed value records.
Object resourcesThe facade exposes java-object as a WIT resource — Drop releases the underlying handle automatically.
ExceptionsJava exceptions cross the boundary as typed variants with cause chains.

Binding against the contract

Consumers bind against the public WIT by importing it as a component dependency. From Rust:

# In your crate's Cargo.toml
[dependencies]
wit-bindgen = "0.x"
wit_bindgen::generate!({
path: "/path/to/fiji-jvm.wit",
world: "jvm",
});

From Node via jco, the typed surface is exposed as a generated JavaScript module. See Same artifact, several runtimes for the workflow.

What the public WIT does not expose

The following intentionally do not appear in the public WIT:

  • Any substrate-* type names — those are internal.
  • Any composition pins, SHA pins, or build-time identities.
  • Any host-import WIT vocabulary (wasi:filesystem, wasi:io, etc.) used internally by the runtime.
  • Stage 3 / facade / shim distinctions — those are contributor vocabulary.

If you find yourself reaching for something not in the public WIT, treat that as a signal to either (a) ask for the capability to be promoted into the public WIT in a future release, or (b) compose Fiji with another component that exposes the capability through a component-model interface.

Versioning

  • fiji:jvm@0.1.0 is the only public package for the 0.4.x line.
  • The contract is frozen against this package across the 0.4.x series — new 0.4.x releases are bug fixes and forward-compatible extensions, not breaking changes.
  • 0.5.x will expand the contract for the first-class-component Java story; see Roadmap.

Reading the WIT directly

The authoritative source is the in-repo file. To extract it from an installed release:

fiji wit

Or read it directly from the release tarball at components/wit/fiji-jvm.wit.