AREST Developer Docs

Self-contained reference for building on arest. FORML 2 readings compile to a database schema, constraint rules, state machines, and a REST API with HATEOAS, all from one β-reducer over Backus's FFP algebra.

View the Project on GitHub graphdl/arest

11 · Runtime Portability Contract

AREST runs on multiple targets without rewriting business logic. This document defines which primitives are available on each target, what Cargo features to enable, and what breaks when you leave the standard environment.

Primitive target map

Primitive Cloudflare Workers Local (CLI) x86_64 Kernel WASM (browser) FPGA
apply supported supported supported supported planned
fetch supported supported stub supported n/a
store supported supported stub stub n/a
def supported supported supported supported planned
compile supported supported stub stub n/a
freeze / thaw supported supported planned stub n/a
validate supported supported supported supported planned
derive supported supported supported supported planned
query supported supported stub stub n/a
snapshot / rollback supported supported planned stub n/a

Key: supported = fully implemented, stub = returns a deterministic no-op or error, planned = on the roadmap, n/a = architecturally excluded.

Note on compile. compile resolves through the chapter 15 seam: native override by default, portable canon reference beneath it, Python as an opt-in differential oracle (AREST_PYTHON_COMPILE) — never required.

Feature flags

Declare features in Cargo.toml. The recommended combinations are:

[features]
default  = ["wit", "debug-def", "std-deps"]

# Bare-metal targets (kernel module, FPGA soft-core)
no_std   = []

# Pull in the std-only dependency set
std-deps = ["serde", "regex", "crypto"]

# Target profiles
cloudflare  = ["wit", "std-deps"]
local       = ["wit", "std-deps", "debug-def"]
wasm-lower  = ["wit"]
parallel    = ["std-deps"]
Feature Enables Requires
wit WIT interface types and component model ABI std
debug-def Pretty-printed AST in error messages std
std-deps serde, regex, crypto crates std
no_std Disables the Rust standard library entirely
cloudflare Workers-specific I/O bindings std
local Filesystem and env-var I/O bindings std
wasm-lower Browser-safe WASM ABI without threads
parallel Rayon-backed parallel derivation passes std

Activate no_std by adding #![no_std] to the crate root and selecting the no_std feature. Do not combine no_std with std-deps, cloudflare, or local.

Target-specific constraints

no_std (kernel module, FPGA soft-core)

WASM (browser)

FPGA (future)

The portability guarantee

The paper states: SYSTEM is one function — readings in, applications out.

Every target runs the same ast::apply:

ast::apply(env: &Env, expr: &Expr) -> Value

The Env captures all fact bindings; Expr is the compiled AST. Neither mentions I/O, time, or file systems. Variation is confined to two trait objects:

As long as a target can provide those two implementations, ast::apply produces identical outputs for identical inputs. Business logic — constraints, derivations, state machines — is tested once and ported for free.

What’s next

Back to self-modification · Generators