omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / docs / osc / OSC-1-SELF-HOST-STATEMENT.md
| 1 | # OSC-1 self-hosting statement |
| 2 | |
| 3 | **OSC-1 slice; not a general Omega compiler; no self-hosting.** |
| 4 | |
| 5 | Question: can the OSC-1 compiler compile any part of itself? |
| 6 | |
| 7 | **Answer: no.** No part of the OSC-1 compiler's source is written in the OSC-1 |
| 8 | language, and the OSC-1 language cannot express it. Reasons, each a missing |
| 9 | language feature, not a missing test: |
| 10 | |
| 11 | 1. **No bytes, strings or text.** The lexer and parser consume source bytes and |
| 12 | produce names and diagnostics. OSC-1 has integer scalars, bool and fixed |
| 13 | arrays of at most 64 integers. It has no `u8` slice over input, no string |
| 14 | type and no way to receive a source file. |
| 15 | 2. **No structs, unions or tagged data.** The IR (`osc_ir.h`) is a tree of |
| 16 | structs and enums (`OscUnit`, `OscFunc`, `OscInsn`). OSC-1 has no aggregate |
| 17 | type other than `own [T; N]` with N <= 64, so it cannot hold an IR. |
| 18 | 3. **No growable or large storage.** The compiler needs tables of thousands of |
| 19 | entries (4096 instructions per function, 480 vregs). OSC-1 allocations are |
| 20 | fixed-size pool slots of 64 cells, at most 64 live. |
| 21 | 4. **No recursion and no forward calls.** The parser is recursive descent. OSC-1 |
| 22 | calls only functions defined earlier in the unit. |
| 23 | 5. **No output channel.** The back end writes machine code into a buffer the |
| 24 | host maps executable, and the receipt writer writes files. OSC-1 programs can |
| 25 | only return a scalar; they have no I/O, no capabilities and no effects. |
| 26 | 6. **No checked contracts.** `requires`/`ensures` are recorded text in OSC-1 |
| 27 | (OSC-0 decision 3). By OSC-0 rule, no production C migrates into Omega |
| 28 | Systems Core until contract enforcement exists (OSC-2). |
| 29 | |
| 30 | What could be written in OSC-1 today is a re-implementation of a few pure |
| 31 | integer helpers that the compiler uses (for example the width mask or the |
| 32 | "is this value representable in type T" check). That would be new code that |
| 33 | happens to compute the same numbers, not the compiler compiling its own |
| 34 | source, and it is not claimed as self-hosting. |
| 35 | |
| 36 | What this means for the roadmap. Self-hosting is OSC-14 in the OSC-0 migration |
| 37 | order (audit III.7). The determinism gate II.9 defines the evidence it will |
| 38 | need: `compiler_n` built by `compiler_{n-1}` producing byte-identical output |
| 39 | on a fixed corpus. The M6 `OMEGA_SELF_HOST` result is a fixed-output self-copy |
| 40 | check and is never evidence of a compiler (OSC-0 decision 2, ROADMAP ยง3 M6 |
| 41 | correction note). OSC-1 does not change that and does not touch M6. |
| 42 | |
| 43 | ## Addendum 2026-10-01: OSC-2 status (history above is kept unchanged) |
| 44 | |
| 45 | The text above describes OSC-1 as written. OSC-2 has since changed two of its six reasons: |
| 46 | |
| 47 | - Reason 2 ("No structs, unions or tagged data") is superseded for structs by OSC-2 item 2 |
| 48 | (omega#149, merge `845dce4`). |
| 49 | - Reason 6 ("No checked contracts") is superseded by OSC-2 item 1 (omega#148, merge `0abdb08`): |
| 50 | `requires`/`ensures` are now enforced, by constant folding or a run-time check. |
| 51 | - OSC-2 item 3 (omega#150, merge `c773622`) wires arenas to the OSC-0B memory model. |
| 52 | OSC-2 item 4 (omega#151, merge `7e713e3`) makes the legacy AArch64 writer refuse out-of-range fields. |
| 53 | - Reasons 1, 3, 4 and 5 are not addressed by this addendum. |
| 54 | |
| 55 | Status of OSC-1 and OSC-2: **IMPLEMENTED / NOT QUALIFIED.** The receipts are host receipts only. Neither slice |
| 56 | is self-hosting, neither is a general Omega compiler, and no production code is compiled by either. |
| 57 | |
| 58 | OSC-2 shortfalls against `docs/adr/OMEGA-SYSTEMS-CORE-0000.md` and audit III.7 |
| 59 | (`OMEGA_SYSTEMS_CORE_CODE_AUDIT.md`): |
| 60 | |
| 61 | - The aienos ADR 0013 u64 generation amendment is not done. |
| 62 | - The II.6 identity break is not done. |
| 63 | - Generational handles moved to OSC-3 (not merged). |
| 64 | - Crumbline migration is not done. |