- Fix condition_fn resolution: Value call path + dev safety + stub injection - VM bridge: handle Method::birth via BoxCall; ArrayBox push/get/length/set direct bridge - Receiver safety: pin receiver in method_call_handlers to avoid undefined use across blocks - Local vars: materialize on declaration (use init ValueId; void for uninit) - Prefer legacy BoxCall for Array/Map/String/user boxes in emit_box_or_plugin_call (stability-first) - Test runner: update LLVM hint to llvmlite harness (remove LLVM_SYS_180_PREFIX guidance) - Docs/roadmap: update CURRENT_TASK with unified default-ON + guards Note: NYASH_DEV_BIRTH_INJECT_BUILTINS=1 can re-enable builtin birth() injection during migration.
1.8 KiB
1.8 KiB
Self‑Hosting — How‑To(前提→手順→検証)
目的
- Ny → MIR → VM/JIT の自己ホスト経路を最短手順で動かす。
前提
- Rust(stable):
cargo --version - Bash + ripgrep(WSL/Unix 推奨)
手順(v2 推奨)
- ビルド
- 実行:
cargo build --release
- 実行:
- 最小 E2E(VM、plugins 無効)
- 実行:
NYASH_DISABLE_PLUGINS=1 ./target/release/nyash --backend vm apps/selfhost-minimal/main.nyash
- 実行:
- クイックスモーク(VM軸)
- 実行:
tools/smokes/v2/run.sh --profile quick
- 実行:
- プラグイン(任意・動的)
- 実行:
tools/smokes/v2/run.sh --profile plugins
- 実行:
- LLVM 統合(任意・AOT/ハーネス)
- 実行:
tools/smokes/v2/run.sh --profile integration
- 実行:
最小 Ny 実行器(MirVmMin)
- 目的: Ny だけで MIR(JSON v0) のごく最小セット(const/binop/compare/ret)を実行できることを確認。
- 実行例(VM):
./target/release/nyash --backend vm apps/selfhost/vm/mir_min_entry.nyash- 引数で MIR(JSON) を渡すことも可能(単一文字列)。簡単な例は
apps/selfhost/vm/mir_min_entry.nyashのコメントを参照。
検証
- 期待出力:
Result: 0(selfhost‑minimal) - スモーク:全成功(非 0 は失敗)
便利フラグ
NYASH_DISABLE_PLUGINS=1外部プラグイン無効化NYASH_CLI_VERBOSE=1実行ログ詳細NYASH_USING_DYLIB_AUTOLOAD=1using.dylib 自動ロード(開発用)
トラブルシュート
- ハング:
timeout 15s ...を付与、NYASH_CLI_VERBOSE=1で詳細 - プラグインエラー: まず
NYASH_DISABLE_PLUGINS=1 - ルート相対パスで実行/
cargo clean -p nyashで個別クリーン
関連
- CI:
.github/workflows/smoke.yml(JSON/JUnit 出力は v2 ランナーで取得可能) - マージ運用:
docs/development/engineering/merge-strategy.md