Files
hakorune/docs/archive/multi_delegation_consultation.txt
Moe Charm ef7a0de3b0 feat: Prepare for code modularization and cleanup
- Archive old documentation and test files to `docs/archive/` and `local_tests/`.
- Remove various temporary and old files from the project root.
- Add `nekocode-rust` analysis tool and its output files (`nekocode/`, `.nekocode_sessions/`, `analysis.json`).
- Minor updates to `apps/chip8_nyash/chip8_emulator.nyash` and `local_tests` files.

This commit cleans up the repository and sets the stage for further code modularization efforts, particularly in the `src/interpreter` and `src/parser` modules, based on recent analysis.
2025-08-16 01:30:39 +09:00

38 lines
1.7 KiB
Plaintext
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.

Nyashプログラミング言語の多重デリゲーション設計について深い相談です。
【現在の状況】
- Everything is Box哲学でデリゲーション優先設計
- 明示性重視(何が起きているかを隠さない)
- 単一デリゲーションbox Child from Parentは完全実装済み
【多重デリゲーション候補】
box MultiChild from ParentA, ParentB {
method() {
from ParentA.methodA()
from ParentB.methodB()
}
}
【Diamond Problem菱形継承問題
box Middle from StringBox { ... }
box Diamond from Middle, StringBox {
toString() {
local a = from Middle.toString() # Middle内でStringBox.toString()呼び出し
local b = from StringBox.toString() # 直接StringBox.toString()呼び出し
# 同じStringBoxに2回アクセス→状態変更重複・パフォーマンス問題
}
}
【解決策候補】
1. **上書き方式**: 後から指定した方を優先from Middle, StringBox → StringBoxが優先
2. **明示的解決**: 曖昧性をコンパイル時エラーにして、ユーザーに解決を強制
3. **完全禁止**: 多重デリゲーション自体を禁止、コンポジション推奨
【質問】
1. Nyash明示性哲学に最も適した解決策は
2. 上書き方式は「明示性」に反するか?
3. Diamond Problemを根本的に避ける設計は
4. 実用性vs安全性のバランスをどう取るべき
5. 他言語Go, Rust, Kotlin等の参考になる設計は
プログラミング言語設計の専門的視点から、Nyashの哲学に最適な多重デリゲーション設計を分析してください。