Files
hakorune/docs/how-to/self-hosting.md
Selfhosting Dev 9b9a91c859 feat: GC機能復活&VM整理&json_native調査完了
## 🎉 ChatGPT×Claude協働成果
-  **GC機能復活**: vm-legacy削除で失われたGC機能を新実装で復活
  - GCメトリクス追跡システム実装(alloc/collect/pause計測)
  - 3種類のGCモード対応(counting/mark_sweep/generational)
  - host_handles.rsでハンドル管理復活

-  **VM整理とエイリアス追加**: 混乱していた名前を整理
  - MirInterpreter = NyashVm = VM のエイリアス統一
  - vm-legacyとインタープリターの違いを明確化
  - 壊れていたvm.rsの互換性修復

-  **スモークテスト整理**: v2構造でプラグイン/コア分離
  - plugins/ディレクトリにプラグインテスト移動
  - gc_metrics.sh, gc_mode_off.sh, async_await.sh追加
  - _ensure_fixture.shでプラグイン事前ビルド確認

## 📊 json_native調査結果
- **現状**: 25%完成(配列/オブジェクトパース未実装)
- **将来性**: 並行処理でyyjson超えの可能性大
  - 100KB以上のJSONで2-10倍速の可能性
  - Nyash ABI実装後はゼロコピー最適化
- **判断**: 現時点では置換不可、将来の大きな足場

## 🔍 技術的発見
- vm-legacy = 完全なVM実装(GC付き)だった
- MirInterpreter = 現在のRust VM(712行、Arc使用)
- 200行簡易JSONは既に削除済み(存在しない)

ChatGPT爆速修復×Claude詳細調査の完璧な協働!

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 23:27:59 +09:00

39 lines
1.4 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/nyash --backend vm apps/selfhost-minimal/main.nyash`
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`
検証
- 期待出力: `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/CONTRIBUTING-MERGE.md`