Phase 20.33: migrate docs to lang compiler entry; add Bridge canonicalize canary skeletons (opt-in); dep_tree.sh fail-fast legacy path; Gate-C OOB strict already present
This commit is contained in:
@ -2,16 +2,17 @@
|
||||
|
||||
This note shows how to run the Nyash self‑host compiler MVP to emit MIR(JSON v0) and execute it with the current VM line. The flow keeps defaults unchanged and uses small, opt‑in flags for development.
|
||||
|
||||
## Layout
|
||||
- Compiler MVP: `apps/selfhost-compiler/compiler.nyash`
|
||||
- Runtime helpers (dev): `apps/selfhost-runtime/`
|
||||
- Mini‑VM samples (dev): `apps/selfhost/vm/`
|
||||
## Layout (migrated)
|
||||
- Compiler entry (Stage‑B): `lang/src/compiler/entry/compiler_stageb.hako`
|
||||
- Compiler entry (compat, Stage‑A/AOT): `lang/src/compiler/entry/compiler.hako`
|
||||
- Shared helpers live under `lang/src/shared/`
|
||||
- VM/Core live under `lang/src/vm/`
|
||||
|
||||
## Run the self‑host compiler
|
||||
Compile a minimal program (string embedded in the compiler) and print JSON:
|
||||
Compile a minimal program (string embedded in the compiler) and print JSON v0:
|
||||
|
||||
```
|
||||
./target/release/nyash apps/selfhost-compiler/compiler.nyash -- --stage3
|
||||
./target/release/nyash lang/src/compiler/entry/compiler_stageb.hako -- --stage3 --source 'box Main { static method main() { return 7 } }'
|
||||
```
|
||||
|
||||
ENV → child args (透過):
|
||||
@ -22,8 +23,8 @@ ENV → child args (透過):
|
||||
|
||||
Examples:
|
||||
```
|
||||
NYASH_NY_COMPILER_MIN_JSON=1 ./target/release/nyash apps/selfhost-compiler/compiler.nyash -- --stage3 > /tmp/out.json
|
||||
NYASH_SELFHOST_READ_TMP=1 ./target/release/nyash apps/selfhost-compiler/compiler.nyash -- --min-json --stage3
|
||||
NYASH_NY_COMPILER_MIN_JSON=1 ./target/release/nyash lang/src/compiler/entry/compiler_stageb.hako -- --stage3 --source 'box Main { static method main() { return 1+2 } }' > /tmp/out.json
|
||||
NYASH_SELFHOST_READ_TMP=1 ./target/release/nyash lang/src/compiler/entry/compiler_stageb.hako -- --min-json --stage3
|
||||
```
|
||||
|
||||
## Execute MIR(JSON v0)
|
||||
|
||||
Reference in New Issue
Block a user