Compiler & ISA
v4.0 · pipelineThe NWO-ASM compiler lowers a single source program into the Process-Matrix IR, then routes each block through the MetaState optimizer to its best substrate target. Multi-stage by design: parse, lower, optimize, schedule, emit. Targets are pluggable — and writing the language itself is free, MIT-licensed, with no platform lock-in.
Compilation as a routed pipeline
Each stage produces a typed artifact handed to the next. The optimizer chooses substrate placement after IR lowering, using free-energy minimisation across substrate cost models.
Six pieces of the compiler
Multi-stage
Parse → AST → Process-Matrix IR → optimized IR → target emission. Each stage is inspectable and replaceable.
LiveMetaState routing
The optimizer evaluates a free-energy bound across substrate cost models to choose per-block placement.
LiveOptimization passes
Dead-code elimination, causal-coherence scheduling, kernel fusion, and substrate-aware tiling on the IR.
LivePost-quantum signing
Compiled artifacts can be signed with CRYSTALS-Dilithium so the binary's provenance is verifiable on-chain.
LiveMulti-backend
One source emits to LLVM (CPU), PTX/HIP (GPU), or QASM3 (QPU). ECG-hive backend is BETA. EVM-target is design-complete.
LiveAgent-native
Compile, sign, and dispatch from an autonomous agent loop. The terminal exposes the full pipeline as commands.
LiveFrom source to QASM3 + USDC settlement
A minimal NWO-ASM program that scores an anomaly signal with the symbolic regressor, then lifts the residual to a 2-qubit process matrix the optimizer can route to a QPU when present, with a classical fallback. Per-call settlement is automatic.
signal.nwo · source# anomaly score on a 1-D signal, fit symbolic residual, route best path module signal { input s : f32[8192] output r : pmx[2] # 2-qubit process matrix let v = anomaly.score(s) # free-energy bound let e = eml.regress(s, v) # closed-form residual r = pmx.lift(e) # causal-coherence channel route r via metastate { prefer: qpu # IBM or Origin Wukong if available fallback: gpu # otherwise nwo-agi distributed GPU settle: usdc(base) # per-call, via splitter — no new contract } }terminal · compile and emit
# compile and inspect IR nwo-asm build signal.nwo --emit pmx,qasm3 → signal.pmx → signal.qasm3 # sign and dispatch (settles in USDC on Base) nwo-asm dispatch signal.qasm3 --backend qpu --wallet $WALLET → dispatched to backend = qpu(origin_wukong) · proof = 0xPOI… → settled $0.0008 USDC · split 35/35/30 · affiliate (if set) +15%
Core instruction set (stable)
| Op | Signature | Notes |
|---|---|---|
| anomaly.score | f32[N] → f32 | Free-energy anomaly metric on a signal. |
| eml.regress | (f32[N], f32) → expr | Closed-form symbolic regression. |
| pmx.lift | expr → pmx[k] | Lift a symbolic expression into a k-qubit process matrix. |
| route | pmx, policy → handle | Defer placement to the MetaState optimizer. |
| poi.verify | handle → proof | Proof of Inference; signed (PQC) and optionally zk. |
| anchor | proof → tx | Prepare keccak256 calldata to settle on Base. |
What it's built on
| Layer | Tech | Status |
|---|---|---|
| Parser / IR | Rust · tree-sitter grammar · custom Process-Matrix IR | Live |
| Optimizer | MetaState kernel · free-energy bound across substrate cost models | Live |
| CPU target | LLVM 17 lowering · x86 / ARM / RISC-V | Live |
| GPU target | PTX (CUDA) · HIP (ROCm) · Metal · nwo-agi distributed mesh | Live |
| QPU target | OpenQASM 3.0 emission · Qiskit Runtime · Origin QPanda | Live |
| Signing | CRYSTALS-Dilithium (PQC) · proof-of-inference attestation | Live |
| Settlement | Existing MetaStateSplitter on Base · 35/35/30 + 15% affiliate | Live · no new contract |
| EVM target | EVM bytecode emission for on-chain hooks · Solidity ABI surface | Design-complete |
| Cross-chain bridge | Quantum-secured message relay between chains and NWO-ASM | Roadmap |
| Photonic / neuromorphic / DNA / crystalline | Backend interfaces specified; pending hardware integration | Roadmap |