Files
hakorune/docs/development/current/CURRENT_TASK.md
Moe Charm 22212aa314 refactor: Major interpreter modularization and P2PBox enhancements
Major Interpreter Refactoring:
- Split core.rs (373 lines removed) into focused modules
- Split expressions/calls.rs (460 lines removed) into cleaner structure
- Added new modules: calls.rs, errors.rs, eval.rs, methods_dispatch.rs, state.rs
- Improved separation of concerns across interpreter components

P2PBox Enhancements:
- Added on_once() for one-time event handlers
- Added off() for handler deregistration
- Implemented handler flags with AtomicBool for thread-safe management
- Added loopback testing cache (last_from, last_intent_name)
- Improved Arc-based state sharing for transport and handlers

Plugin Loader Unification (In Progress):
- Created plugin_loader_unified.rs skeleton
- Created plugin_ffi_common.rs for shared FFI utilities
- Migration plan documented (2400 lines → 1100 lines target)

MIR & VM Improvements:
- Enhanced modularized MIR builder structure
- Added BoxCall dispatch improvements
- Better separation in builder modules

Documentation Updates:
- Added Phase 9.79a unified box dispatch plan
- Created plugin loader migration plan
- Updated CURRENT_TASK.md with latest progress

All tests passing (180 tests) - ready for next phase of refactoring

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-26 19:13:57 +09:00

75 lines
3.9 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.

# 🎯 CURRENT TASK - 2025-08-26Context Reset / Fresh Focus
コンテキストを「0%」にリセットし、いま必要なことだけに集中するにゃ。
## ⏱️ 今日のフォーカスPhase 9.79a: Unified Dispatch + P2P Polish
- 判断: 統一Box設計は「非侵襲のディスパッチ統一」から入る → P2PBox磨きを同時並行
- 目的: ユニバーサルメソッドtoString/type/equals/cloneをVM/Interpreter前段で統一 + P2PBoxのmulti-node/async UX安定化
### 直近の実行タスク(小さく早く)
1) ユニバーサルメソッドの前段ディスパッチ(非侵襲)
- VM/Interpreterで`toString/type/equals/clone`を共通ヘルパにマップ(トレイト変更なし)
2) P2PBox磨きmulti-node/async/解除)
- share/cloneセマンティクスshare=共有, clone=新規(実装済みの明文化)
- unregisterの安全化endpoint一致 or refcount
- onOnce/off のE2Eテスト追加
- VM表示整合getLast*/debug_* の toString/Console
3) E2Eスモーク更新
- self→self, two-node ping-pong安定
- asyncデモTimeBox併用で確実に出力
### すぐ試せるコマンド(最小)
```bash
# RustRelease
cargo build --release -j32
./target/release/nyash --help
# Plugin デバッグ実行(任意)
NYASH_DEBUG_PLUGIN=1 ./target/release/nyash --backend vm local_tests/extern_console_log.nyash || true
# WASMWeb配布
cd projects/nyash-wasm && wasm-pack build --target web --out-dir pkg
```
## 現在の地図Done / Doing / Next
### ✅ 完了
- PluginHostファサード導入・移行create/invoke/extern
- TLVヘッダ/引数/ハンドルの共通化(`plugin_ffi_common.rs`
- Interpreter分割の導線: `eval.rs` / `calls.rs` / `methods_dispatch.rs` 抽出
- ログ静音の基盤: `idebug!`NYASH_DEBUG=1 で有効)を calls/core/statements に適用
- MIR modular builder ゲート追加feature: `mir_modular_builder`/ 整合パッチ投入
### 🚧 進行中(小タスク)
- Interpreterログ統一の残り`delegation.rs` など)
- PluginHost の `resolve_method` キャッシュ化I/O削減
### ⏭️ 次アクション(今日~明日)
- 9.79a-M1: ユニバーサル前段ディスパッチVM/Interpreter/ 回帰確認
- 9.79a-M2: P2P unregister安全化 + onOnce/off E2E + async安定
- 9.79a-M3: VM表示整合/ Docs更新言語ガイド・P2Pリファレンス
## 決定事項Unified Box設計メモ
- ドキュメント: `docs/ideas/other/2025-08-25-unified-box-design-deep-analysis.md`
- 判断: まずはディスパッチャ層でユニバーサルメソッドを統一(トレイト変更なし)
- P2Pは共有セマンティクスshare=共有, clone=新規)を維持しつつ unregister 正式化へ
## 参考リンク(唯一参照/ゲート)
- MIR命令セット26命令: `docs/reference/mir/INSTRUCTION_SET.md`
- Phase 9.79P2P: `docs/development/roadmap/phases/phase-9/phase_9_79_p2pbox_rebuild.md`
- Phase 9.79aUnified Dispatch + P2P Polish: `docs/development/roadmap/phases/phase-9/phase_9_79a_unified_box_dispatch_and_p2p_polish.md`
- Phase 9.78h(前段完了): `docs/development/roadmap/phases/phase-9/phase_9_78h_mir_pipeline_stabilization.md`
- Phase 10Cranelift JIT主経路: `docs/development/roadmap/phases/phase-10/phase_10_cranelift_jit_backend.md`
## Doneの定義P2PBox 最小)
- `LocalLoopback` で ping/pong が安定
- P2PBox APIstart/stop/send/broadcast/reply/onが固まる
- ResultBox経由でエラーが伝搬E2E テスト含む)
- ログは既定静音(環境変数でデバッグオン)
## Parking Lot後でやる
- NyashValue enum導入即値最適化
- トレイト階層化Comparable/Arithmetic etc.
- メタプログラミング・パイプライン演算子
- `mir_modular_builder` をデフォルト化(パリティ後)