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>
This commit is contained in:
Selfhosting Dev
2025-09-24 23:27:59 +09:00
parent e5f6d51b3c
commit 9b9a91c859
36 changed files with 556 additions and 178 deletions

View File

@ -98,14 +98,13 @@ MVP-3実装済み・最小対応
- 代入先は変数のみ(フィールド等は対象外)
- 全体の更新変数は最大2種MVP-2 制約を継承)
- セグメント内で「代入の後に非代入」があれば整列しない(順序保持)
- スモーク:
- `tools/test/smoke/macro/loopform_continue_break_output_smoke.sh`
- スモークv2: `tools/smokes/v2/run.sh --profile quick --filter "loopform|macro"`
for / foreach の糖衣と正規化(概要)
- for: `for(fn(){ init }, cond, fn(){ step }, fn(){ body })``init; loop(cond){ body; step }` へ正規化。
- init/step は `Assignment`/`Local` 単体でも可。
- foreach: `foreach(arr, "x", fn(){ body })``__ny_i` で走査する Loop へ正規化し、`x``arr.get(__ny_i)` に置換。
- スモーク: `tools/test/smoke/macro/for_foreach_output_smoke.sh`
- スモークv2: `tools/smokes/v2/run.sh --profile quick --filter "macro|foreach|for"`
対応状況MVP→順次拡張
- Week1: whilebreak/continue無し
@ -124,8 +123,8 @@ for / foreach の糖衣と正規化(概要)
- ゴールデン(キー順無視の比較)
- `tools/test/golden/macro/loop_simple_user_macro_golden.sh`
- `tools/test/golden/macro/loop_two_vars_user_macro_golden.sh`
- 出力一致スモークVM
- `tools/test/smoke/macro/loop_two_vars_output_smoke.sh`
- 出力一致スモークVM, v2
- `tools/smokes/v2/run.sh --profile quick --filter "loop_two_vars|macro"`
- 自己ホスト前展開PyVM 経由)
- `NYASH_VM_USE_PY=1 NYASH_USE_NY_COMPILER=1 NYASH_MACRO_ENABLE=1 NYASH_MACRO_PATHS=apps/macros/examples/loop_normalize_macro.nyash ./target/release/nyash --macro-preexpand --backend vm apps/tests/macro/loopform/simple.nyash`