Wheeler

WIP-0008: Java-free runtime and native bootstrap

FieldValue
StatusDraft
OwnersWheeler runtime, compiler, platform, and release maintainers
Created2026-07-17
Updated2026-07-31
AreaRuntime, native code, bootstrap, distribution, Java retirement
Depends onWIP-0001, WIP-0007
SupersedesNone
Superseded byNone

Summary

Wheeler's production runtime and toolchain will not depend on Java. The current Java compiler, VM, runtime, and Gradle build stay under top-level bootstrap/ as stage-0 tools. They establish the initial rules and seed the self-hosted system. Once a Wheeler-written toolchain can rebuild and test itself from a pinned native recovery release, these Java paths are removed.

WIP-0009 provides the Wheeler package and build system that replaces Gradle.

Canonical .wbc remains the portable executable and semantic boundary. A native backend lowers verified .wbc into host IR and machine code for distribution and bootstrap use. Derived backend data cannot change ownership, effects, traps, inverse relations, or adjoints.

The Wheeler compiler, verifier, VM or execution runtime, disassembler, OpenQASM emitter, and build driver become Wheeler programs. A small platform ABI provides memory, process arguments, bounded file operations, and other granted host effects. It does not expose JVM objects or copy the Java class library.

A cold build starts from a reviewed earlier Wheeler native release and a content-addressed .wbc seed. Fixed-point reproduction is paired with diverse double compilation and full provenance. A malicious old compiler can reproduce its own output, so a matching fixed point is useful but not enough. After cutover, Java is no longer part of the trust chain.

Motivation

Self-hosting the compiler does not remove Java when every Wheeler artifact still needs a JVM. That would change the source language while leaving Java as the real platform, deployment cost, and trusted runtime.

Wheeler already defines machine state, verification, bounded effects, quantum IR, and hybrid persistence without Java. Keeping Java would let host collection order, object identity, exceptions, serialization, threads, and numeric conversions affect those contracts. It would also block small native deployments and tie long-term maintenance to an unrelated managed runtime.

The migration still needs an executable reference. Replacing Java in one unverified rewrite would remove the current oracle before the new runtime proves parity. This WIP uses a limited cross-runtime conformance period, then requires full deletion. It does not create two permanent implementations.

Goals

Non-goals

Terms and invariants

A portable artifact is verified .wbc. It is sufficient for interpretation, disassembly, replay identity, and native lowering.

A native image is a derived target-qualified executable. Its identity includes the .wbc hash, backend version, target triple, ABI version, options, and linked runtime identity.

The platform ABI is the only boundary between Wheeler runtime code and host services. It uses fixed-width values, bounded byte spans, stable status codes, and owned handles. Host language objects never cross it.

A recovery release contains reviewed native executables, their source and .wbc identities, the compiler bootstrap manifest, platform ABI identity, and reproduction instructions.

The following invariants hold:

  1. Verification occurs before interpretation or native lowering.
  2. Native lowering cannot grant capabilities absent from the host launch policy.
  3. Native and interpreted executions have the same specified transitions, traps, limits, and observable results.
  4. Native images are caches. Corrupt or stale images cannot redefine .wbc semantics.
  5. Canonical artifacts contain no host path, clock, process, address, or random state.
  6. A release bootstrap never invokes Java after cutover.

Architecture

Wheeler-owned components

The production source tree contains Wheeler implementations of:

These components share data schemas and conformance fixtures. They do not call hidden Java helpers.

Platform layer

The initial native ABI provides only:

Wall-clock time, environment variables, network sockets, random devices, dynamic libraries, and unrestricted paths are absent unless an application receives an explicit capability. ABI calls return typed status values. They do not throw host exceptions through Wheeler frames.

The ABI may have a small C-compatible shim per operating system. That shim contains no parser, verifier, VM transition, compiler, scheduler, replay, or quantum semantics.

Native lowering

The first native backend lowers verified .wbc through a documented target-neutral native IR and a selected machine-code toolchain. LLVM is a likely implementation component, not the language execution model. A backend WIP shall fix object identity, calling convention, stack maps, traps, and runtime linkage before native output becomes a release artifact.

Ahead-of-time lowering preserves explicit bounds checks, arithmetic traps, effect barriers, history operations, and source mappings. Optimizations must be validated against bytecode semantics and cannot erase observable traps or reorder effects.

An interpreter remains useful for conformance and unusual targets, but its production implementation is Wheeler code and ships as a native image. It is not the old Java VM.

Storage and memory

The Wheeler runtime owns typed stacks, frames, history, regions, and managed values. The platform layer supplies raw bounded memory only. The first native compiler may use compilation arenas and immutable shared values. Long-lived applications require a later specified collector or region ownership model.

Object layout is an ABI between generated native code and the Wheeler runtime, not a source-language promise. Persisted hybrid values continue to use versioned canonical schemas instead of dumping native memory.

Bootstrap chain

Before cutover:

Java stage 0
  -> Wheeler compiler.wbc
  -> self-host fixed point
  -> native Wheeler compiler/runtime
  -> native conformance comparison

After cutover:

prior native Wheeler recovery release
  -> current compiler.wbc and native tools
  -> current compiler rebuilds itself
  -> byte-identical .wbc fixed point
  -> reproducible native recovery release

The prior release is not copied into the source semantics. It is a seed with a declared content identity. A later diverse bootstrap may use independently built runtime or backend implementations to reduce trust in one lineage.

Reversibility and effects

Native execution must preserve WIP-0001 history and inverse rules exactly. A backend cannot replace checked arithmetic with wrapping arithmetic, elide a logged overwrite, or treat commit as an optimizer hint.

Platform calls are effects. File replacement, terminal output, memory mapping, and target submission are not physically reversed by native stack unwinding. Wheeler effect, transaction, replay, compensation, and commit rules remain authoritative.

Quantum adjoints and hybrid replay retain the meanings specified by WIP-0002 and WIP-0004. Native code does not gain access to provider qubit pointers only because an embedding application has them.

Native I/O fabric

The native runtime implements WIP-0032 behind one explicit application-supplied Io interface. Deterministic inline and bounded threaded backends come before platform-tuned completion, polling, direct-storage, RDMA, or target adapters. Native paths preserve operation ownership, cancellation uncertainty, buffer release, bounds, and receipt meaning exactly.

Java stage-0 file, network, and target helpers remain quarantined migration infrastructure. They do not define Wheeler's source API, canonical bytecode, or durability semantics.

Conformance and migration

Migration proceeds in replaceable slices:

  1. Freeze Java stage-0 semantics behind executable .wbc, VM, target, and persistence corpora.
  2. Specify the platform ABI and native-image identity.
  3. Add a native backend for the classical bootstrap profile.
  4. Compile and run Wheeler-written bytecode codec, verifier, and transition kernel natively.
  5. Port source compiler and tools under WIP-0007.
  6. Port quantum IR, ideal simulator, OpenQASM emission, and hybrid runtime.
  7. Run every corpus and example on Java interpretation, Wheeler interpretation, and native execution. Compare semantic traces and artifacts.
  8. Bootstrap from a prior native release in clean CI with no Java on PATH.
  9. Replace Gradle orchestration with the WIP-0009 wheeler package and build driver plus minimal platform packaging.
  10. Delete all production and test Java sources, Gradle files, Java CI setup, and JVM documentation in one cutover series.

A temporary differential harness is migration code. It is removed after native fixtures and trace readers become authoritative.

Safety, limits, and failures

Native code retains all declared bytecode, history, stack, heap, workflow, event, result, and compiler limits. Backend arithmetic used for offsets, layouts, relocation, allocation, and lengths is checked. The runtime rejects incompatible ABI, target, endianness, pointer width, feature, or artifact identities before execution.

Signals, access violations, and platform faults become bounded fatal runtime reports. They are not silently converted into source exceptions. A native crash never validates a partial artifact or event-log write.

Recovery releases are signed or content-addressed by release policy. Bootstrap scripts verify every seed before execution and record the exact host toolchain used for native reproduction.

Progress

Testing and acceptance

Alternatives

Keep a Java launcher for .wbc

Rejected. It keeps the JRE in every deployment and leaves Java in the trusted execution path.

Rewrite the runtime permanently in C or Rust

Rejected as the production semantic owner. A small host ABI shim is necessary, but Wheeler should be capable of expressing its compiler and runtime. A second full runtime would recreate parallel authorities.

Make native images canonical

Rejected. Machine code is target- and toolchain-specific and unsuitable as Wheeler's portable semantic, replay, and interchange identity.

Delete Java before differential conformance

Rejected. The current implementation is the executable migration oracle. It is temporary, but deleting it before stronger evidence would replace one dependency with unmeasured semantic drift.

Open questions

Integration with reversible concurrency

Native structured-task runtime

The production task transition kernel is Wheeler code. ABI shims may provide threads, parking, wakeup, and memory primitives. They contain no task selection, memory model, event order, rewind, or causal semantics.

The one-thread interpreter is the oracle. Parallel execution must emit the same EventIds, observations, traps, history use, and final state. Thread identity, core number, work-stealing order, futex identity, and completion arrival never enter portable state.

References