Files
hakorune/docs/how-to/self-hosting.md
nyash-codex d7805e5974 feat(joinir): Phase 213-2 Step 2-2 & 2-3 Data structure extensions
Extended PatternPipelineContext and CarrierUpdateInfo for Pattern 3 AST-based generalization.

Changes:
1. PatternPipelineContext:
   - Added loop_condition: Option<ASTNode>
   - Added loop_body: Option<Vec<ASTNode>>
   - Added loop_update_summary: Option<LoopUpdateSummary>
   - Updated build_pattern_context() for Pattern 3

2. CarrierUpdateInfo:
   - Added then_expr: Option<ASTNode>
   - Added else_expr: Option<ASTNode>
   - Updated analyze_loop_updates() with None defaults

Status: Phase 213-2 Steps 2-2 & 2-3 complete
Next: Create Pattern3IfAnalyzer to extract if statement and populate update summary
2025-12-10 00:01:53 +09:00

45 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# SelfHosting — HowTo前提→手順→検証
目的
- Ny → MIR → VM/JIT の自己ホスト経路を最短手順で動かす。
前提
- Ruststable: `cargo --version`
- Bash + ripgrepWSL/Unix 推奨)
手順v2 推奨)
1) ビルド
- 実行: `cargo build --release`
2) 最小 E2EVM、plugins 無効)
- 実行: `NYASH_DISABLE_PLUGINS=1 ./target/release/hakorune --backend vm apps/selfhost-minimal/main.hako`
3) クイックスモークVM軸
- 実行: `tools/smokes/v2/run.sh --profile quick`
4) プラグイン(任意・動的)
- 実行: `tools/smokes/v2/run.sh --profile plugins`
5) LLVM 統合任意・AOT/ハーネス)
- 実行: `tools/smokes/v2/run.sh --profile integration`
最小 Ny 実行器MirVmMin
- 目的: Ny だけで MIR(JSON v0) のごく最小セットconst/binop/compare/retを実行できることを確認。
- 実行例VM:
- `./target/release/hakorune --backend vm apps/selfhost/vm/mir_min_entry.hako`
- 引数で MIR(JSON) を渡すことも可能(単一文字列)。簡単な例は `apps/selfhost/vm/mir_min_entry.hako` のコメントを参照。
検証
- 期待出力: `Result: 0`selfhostminimal
- スモーク:全成功(非 0 は失敗)
便利フラグ
- `NYASH_DISABLE_PLUGINS=1` 外部プラグイン無効化
- `NYASH_CLI_VERBOSE=1` 実行ログ詳細
- `NYASH_USING_DYLIB_AUTOLOAD=1` using.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`