Phase 10. FFI shells
| Field | Value |
|---|---|
| MEP | MEP-45 §Phases · Phase 10 |
| Status | NOT STARTED |
| Started | — |
| Landed | — |
| Tracking issue | — |
| Tracking PR | — |
Gate
C-direct FFI fixture suite (~15 cases: call a vendored C function, pass scalars + strings + records, return scalars + records, error propagation) compiles + runs byte-equal vs vm3 on host triple.
Goal-alignment audit
To be written before sub-phase 10.0 starts. C-direct FFI is the natural FFI for a C-AOT target and the gateway for the embedding use case. Aligns.
Sub-phases
| # | Scope | Status | Commit | PR |
|---|---|---|---|---|
| 10.0 | C direct: binding declarations in Mochi; emit header in build dir; user-provided .c neighbour compiled in | NOT STARTED | — | — |
| 10.1 | Boxed mochi_value type for FFI-crossing values (sum of scalar + string + handle); marshalling helpers | NOT STARTED | — | — |
| 10.2 | Go FFI via Unix-domain RPC (deferred sub-phase; ships after C-direct is green) | NOT STARTED | — | — |
| 10.3 | Python FFI via embedded libpython3 (deferred sub-phase) | NOT STARTED | — | — |
| 10.4 | TypeScript FFI via QuickJS-NG (deferred sub-phase) | NOT STARTED | — | — |
Decisions made
Fill in along the way.
Deferred work
Go c-archive route (in-process, no RPC): v2, alongside 10.2 review.
Closeout notes
Fill in after gate green.