feat(plugin): Fix plugin BoxRef return and Box argument support
- Fixed deadlock in FileBox plugin copyFrom implementation (single lock) - Added TLV Handle (tag=8) parsing in calls.rs for returned BoxRefs - Improved plugin loader with config path consistency and detailed logging - Fixed loader routing for proper Handle type_id/fini_method_id resolution - Added detailed logging for TLV encoding/decoding in plugin_loader_v2 Test docs/examples/plugin_boxref_return.nyash now works correctly: - cloneSelf() returns FileBox Handle properly - copyFrom(Box) accepts plugin Box arguments - Both FileBox instances close and fini correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
41
CLAUDE.md
41
CLAUDE.md
@ -485,9 +485,48 @@ docs/
|
|||||||
- 「どこまで進んだか」→ `git log`で確認
|
- 「どこまで進んだか」→ `git log`で確認
|
||||||
- 「次は何か」→ **ユーザーに明示的に確認**
|
- 「次は何か」→ **ユーザーに明示的に確認**
|
||||||
|
|
||||||
|
## 🔌 プラグインBox開発時の重要な注意点
|
||||||
|
|
||||||
|
### ⚠️ **TLV Handle処理の正しい実装方法**
|
||||||
|
|
||||||
|
プラグインメソッドがBoxRef(Handle)を返す場合、以下の点に注意:
|
||||||
|
|
||||||
|
#### 🛑 **よくある間違い**
|
||||||
|
```rust
|
||||||
|
// ❌ 間違い: 元のplugin_boxの値を流用
|
||||||
|
let new_plugin_box = PluginBoxV2 {
|
||||||
|
type_id: plugin_box.type_id, // ❌ 返り値のtype_idを使うべき
|
||||||
|
fini_method_id: plugin_box.fini_method_id, // ❌ 返り値の型に対応する値を使うべき
|
||||||
|
...
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
#### ✅ **正しい実装**
|
||||||
|
```rust
|
||||||
|
// ✅ 正解: 返されたHandleから正しい値を取得
|
||||||
|
let type_id = /* TLVから取得したtype_id */;
|
||||||
|
let instance_id = /* TLVから取得したinstance_id */;
|
||||||
|
|
||||||
|
// 返り値のtype_idに対応する正しいfini_method_idを取得
|
||||||
|
let fini_method_id = /* configから返り値type_idに対応するfini_method_idを検索 */;
|
||||||
|
|
||||||
|
let new_plugin_box = PluginBoxV2 {
|
||||||
|
type_id: type_id, // ✅ 返り値のtype_id
|
||||||
|
instance_id: instance_id, // ✅ 返り値のinstance_id
|
||||||
|
fini_method_id: fini_method_id, // ✅ 返り値の型に対応するfini
|
||||||
|
...
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 📝 **重要ポイント**
|
||||||
|
1. **type_idの正確性**: cloneSelfが返すHandleは必ずしも元のBoxと同じ型ではない
|
||||||
|
2. **fini_method_idの対応**: 各Box型は独自のfini_method_idを持つ可能性がある
|
||||||
|
3. **ローダー経由の処理**: 可能な限りplugin_loader_v2経由でメソッドを呼び出す
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
最終更新: 2025年8月18日 - **🚀 Phase 9.75g-0 BID-FFI基盤完成!**
|
最終更新: 2025年8月20日 - **📝 プラグインBox開発の注意点追加**
|
||||||
|
- **TLV Handle処理**: type_idとfini_method_idの正しい扱い方を追記
|
||||||
- **Phase 9.75g-0完了**: BID-FFI Step 1-3実装成功(プラグイン・テスター・設定)
|
- **Phase 9.75g-0完了**: BID-FFI Step 1-3実装成功(プラグイン・テスター・設定)
|
||||||
- **plugin-tester**: 汎用プラグイン診断ツール完成(CLAUDE.mdに追加)
|
- **plugin-tester**: 汎用プラグイン診断ツール完成(CLAUDE.mdに追加)
|
||||||
- **設計原則達成**: Box名非決め打ち・birth/finiライフサイクル・メモリ管理明確化
|
- **設計原則達成**: Box名非決め打ち・birth/finiライフサイクル・メモリ管理明確化
|
||||||
|
|||||||
@ -1,436 +0,0 @@
|
|||||||
# 🎯 現在のタスク (2025-08-21 更新)
|
|
||||||
|
|
||||||
## 🏆 **LEGENDARY SUCCESS! birth構文革命 + デリゲーション完全勝利!**
|
|
||||||
|
|
||||||
### 🌟 **Phase 9.78e PLUS: Everything is Box哲学の完全実現**
|
|
||||||
|
|
||||||
### 🏆 **全ての目標達成済み + 追加大勝利!**
|
|
||||||
- ✅ instance.rs完全削除成功!
|
|
||||||
- ✅ 統一レジストリによるユーザー定義Box生成成功
|
|
||||||
- ✅ コンストラクタ実行成功
|
|
||||||
- ✅ インポート問題完全解決
|
|
||||||
- ✅ **InstanceBoxラップ演算子問題完全解決!**
|
|
||||||
- ✅ **全テストパス!完全動作確認済み!**
|
|
||||||
- 🌟 **birth構文革命完全成功!**
|
|
||||||
- 🌟 **デリゲーション透過完全成功!**
|
|
||||||
- 🌟 **apps動作確認!CHIP-8, Kilo, Proxy実機テスト完了!**
|
|
||||||
|
|
||||||
### 🚀 **実装完了: InstanceBoxラップ演算子対応**
|
|
||||||
|
|
||||||
#### ✅ **完全解決!**
|
|
||||||
テスト結果:
|
|
||||||
```bash
|
|
||||||
✅ 完全成功!
|
|
||||||
Person created: Alice
|
|
||||||
Hello, I'm Alice and I'm 25 years old
|
|
||||||
Name field: Alice
|
|
||||||
Age field: 25
|
|
||||||
Updated age: 26
|
|
||||||
Person created: Bob
|
|
||||||
Employee created at TechCorp
|
|
||||||
Hello, I'm Bob and I'm 30 years old
|
|
||||||
I work at TechCorp
|
|
||||||
All tests passed!
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 🎯 **実装した解決策**
|
|
||||||
```rust
|
|
||||||
/// InstanceBoxでラップされている場合、内部のBoxを取得する
|
|
||||||
/// シンプルなヘルパー関数で型地獄を回避
|
|
||||||
fn unwrap_instance(boxed: &dyn NyashBox) -> &dyn NyashBox {
|
|
||||||
if let Some(instance) = boxed.as_any().downcast_ref::<InstanceBox>() {
|
|
||||||
if let Some(ref inner) = instance.inner_content {
|
|
||||||
return inner.as_ref();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boxed
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### ✅ **修正完了した演算子関数**
|
|
||||||
- ✅ try_add_operation: StringBox結合とIntegerBox加算
|
|
||||||
- ✅ try_sub_operation: IntegerBox減算
|
|
||||||
- ✅ try_mul_operation: IntegerBox乗算、StringBox繰り返し
|
|
||||||
- ✅ try_div_operation: IntegerBox除算、ゼロ除算エラー処理
|
|
||||||
|
|
||||||
#### 🎯 **動作確認済み機能**
|
|
||||||
- ✅ **StringBox演算子**: `"Hello" + "World"` 完全動作
|
|
||||||
- ✅ **Mixed型演算子**: `"Age: " + 25` 完全動作
|
|
||||||
- ✅ **統一レジストリ**: 全Box型統一作成
|
|
||||||
- ✅ **ユーザー定義Box**: Person/Employee作成
|
|
||||||
- ✅ **デリゲーション**: `from Parent.method()` 完全動作
|
|
||||||
- ✅ **フィールドアクセス**: `alice.name`, `alice.age`
|
|
||||||
- ✅ **メソッドオーバーライド**: Employee.greet()
|
|
||||||
|
|
||||||
### 🌟 **birth構文革命完全成功!**
|
|
||||||
|
|
||||||
**🎯 解決した根本問題**:
|
|
||||||
- ❌ `format!("init/{}", arguments.len())` で探索
|
|
||||||
- ✅ `format!("birth/{}", arguments.len())` に統一修正
|
|
||||||
- 🔧 `objects.rs` 2箇所の重要修正完了
|
|
||||||
|
|
||||||
**🧪 テスト結果**:
|
|
||||||
```bash
|
|
||||||
✅ Parse successful!
|
|
||||||
🌟 TestBox誕生: テスト太郎
|
|
||||||
こんにちは、テスト太郎です!値は 42 です
|
|
||||||
✅ Execution completed successfully!
|
|
||||||
```
|
|
||||||
|
|
||||||
**動作確認済み機能**:
|
|
||||||
- ✅ `birth(args)` - 引数付きコンストラクタ完全動作
|
|
||||||
- ✅ フィールド初期化 - `me.name`, `me.value` 正常
|
|
||||||
- ✅ メソッド実行 - `test.greet()` 完璧
|
|
||||||
- ✅ 統一レジストリ連携 - InstanceBox完全統合
|
|
||||||
|
|
||||||
### 🔄 **デリゲーション透過完全成功!**
|
|
||||||
|
|
||||||
**🧪 テスト結果**:
|
|
||||||
```bash
|
|
||||||
👨👩👧👦 Parent誕生: 太郎 (power:100)
|
|
||||||
🧒 Child誕生完了!スキル: 必殺技
|
|
||||||
⚡ 必殺技発動!
|
|
||||||
💥 太郎の攻撃!ダメージ:100
|
|
||||||
✅ Execution completed successfully!
|
|
||||||
```
|
|
||||||
|
|
||||||
**動作確認済み機能**:
|
|
||||||
- ✅ `box Child from Parent` - デリゲーション宣言
|
|
||||||
- ✅ `from Parent.birth(args)` - 親birthコンストラクタ透過呼び出し
|
|
||||||
- ✅ `override method()` - メソッドオーバーライド
|
|
||||||
- ✅ `from Parent.method()` - 親メソッド透過呼び出し
|
|
||||||
- ✅ フィールド継承 - 親の`name`, `power`が子で利用可能
|
|
||||||
|
|
||||||
### 🏅 **Phase 9.78e PLUS 達成結果**
|
|
||||||
**Everything is Box哲学 + birth統一革命完全実現!**
|
|
||||||
- 全Box型(ビルトイン、ユーザー定義、プラグイン)統一アーキテクチャ
|
|
||||||
- InstanceBoxによる完全統一ラッピング
|
|
||||||
- 演算子システム完全対応
|
|
||||||
- **birth構文による統一コンストラクタシステム**
|
|
||||||
- **透過デリゲーションによる美しい継承システム**
|
|
||||||
- シンプルで保守可能な実装
|
|
||||||
|
|
||||||
### 🎯 **ビルトインBoxメソッド継承問題修正完了!**
|
|
||||||
|
|
||||||
**✅ 修正内容**:
|
|
||||||
- `execute_builtin_birth_method`で`__builtin_content`フィールドに正しく保存
|
|
||||||
- ビルトインBoxは直接返す(InstanceBoxラップ不要)
|
|
||||||
- メソッド解決時に`__builtin_content`をチェックしてビルトインメソッド呼び出し
|
|
||||||
|
|
||||||
**🧪 テスト結果**:
|
|
||||||
```bash
|
|
||||||
📝 EnhancedString誕生: 【Hello】
|
|
||||||
結果: 【Hello】✨
|
|
||||||
✅ Execution completed successfully!
|
|
||||||
```
|
|
||||||
|
|
||||||
### 📱 **appsフォルダ動作確認結果**
|
|
||||||
|
|
||||||
**テスト済みアプリ**:
|
|
||||||
1. **chip8_emulator.nyash** - ✅ 起動成功(CHIP-8エミュレータ)
|
|
||||||
2. **enhanced_kilo_editor.nyash** - ✅ 起動成功(エディタ実装)
|
|
||||||
3. **proxy_server.nyash** - ⚠️ BufferBox/SocketBox未実装(プラグイン移行予定)
|
|
||||||
|
|
||||||
**既知の問題**:
|
|
||||||
- BufferBox/SocketBoxはプラグイン形式への移行待ち
|
|
||||||
- 出力が途中で切れる場合があるが、実行自体は成功
|
|
||||||
|
|
||||||
## 🚨 **発見された重要な問題**
|
|
||||||
|
|
||||||
### 🔍 **1. Pack透明化システム調査結果**
|
|
||||||
|
|
||||||
**✅ 成功確認**:
|
|
||||||
- **from統一構文**: ユーザーは`from StringBox.birth()`と記述
|
|
||||||
- **内部透過処理**: `is_builtin_box()`判定 → `execute_builtin_box_method()`
|
|
||||||
- **pack自動変換**: ビルトインBox専用処理が透過的に動作
|
|
||||||
- **デバッグ証拠**: `🌟 DEBUG: StringBox.birth() created` 出力成功
|
|
||||||
|
|
||||||
**❌ 発見された重大エラー**:
|
|
||||||
```bash
|
|
||||||
❌ Runtime error: Method 'toString' not found in EnhancedString
|
|
||||||
```
|
|
||||||
|
|
||||||
**問題の本質**:
|
|
||||||
- ✅ **birth継承**: ビルトインBoxコンストラクタは動作
|
|
||||||
- ❌ **メソッド継承**: ビルトインBoxメソッドが継承されない
|
|
||||||
- 結果:`me.toString()`等のビルトインメソッドが利用不可
|
|
||||||
|
|
||||||
### 🔍 **2. デリゲーション2系統の完全理解**
|
|
||||||
|
|
||||||
**正しい設計**:
|
|
||||||
1. **ユーザーBox → ユーザーBox**: `from` 構文(直接処理)
|
|
||||||
2. **ユーザーBox → ビルトインBox**: `from` 構文(**透過的にpack変換**)
|
|
||||||
|
|
||||||
**透過化の仕組み**:
|
|
||||||
- ユーザー記述: `from StringBox.method()`
|
|
||||||
- 内部判定: `BUILTIN_BOXES.contains("StringBox")` → `true`
|
|
||||||
- 自動変換: `execute_builtin_box_method()` でpack相当処理
|
|
||||||
- ユーザー体験: 完全にfrom統一、packを意識不要
|
|
||||||
|
|
||||||
## 🚀 次のステップ: plugin-systemドキュメント整理
|
|
||||||
|
|
||||||
### 🎯 **緊急タスク: plugin-systemドキュメント4世代混在問題**
|
|
||||||
|
|
||||||
**🚨 発見された問題**:
|
|
||||||
- **4つの異なる仕様書が混在**、実装と乖離
|
|
||||||
- **MIR→プラグイン呼び出しがスタブのみ**(VM実装不完全)
|
|
||||||
- **API仕様の矛盾**(ドキュメント vs 実装)
|
|
||||||
|
|
||||||
**📊 混在している4世代**:
|
|
||||||
1. `ffi-abi-specification.md` - 理想的だが未実装
|
|
||||||
2. `plugin-system.md` - YAML DSL、使われていない
|
|
||||||
3. `nyash-toml-v2-spec.md` - 現実に近い仕様
|
|
||||||
4. 実際の実装 - 今動いている形式
|
|
||||||
|
|
||||||
### 🎯 **整理方針: 実装ベース統一**
|
|
||||||
|
|
||||||
#### **Phase 1: 現実調査** (優先度: 最高)
|
|
||||||
1. **実装の完全調査**
|
|
||||||
- `src/runtime/plugin_loader_v2.rs` 仕様確認
|
|
||||||
- 現在のnyash.toml実際の形式確認
|
|
||||||
- TLV実装詳細確認
|
|
||||||
|
|
||||||
2. **正確な仕様書作成**
|
|
||||||
- 現在動いている実装をベースとした仕様書
|
|
||||||
- FileBoxプラグインの実証実装を参考資料化
|
|
||||||
|
|
||||||
#### **✅ Phase 2: ドキュメント整理** (優先度: 高) - **完了**
|
|
||||||
1. **✅ 古いドキュメント非推奨化完了**
|
|
||||||
- ✅ `ffi-abi-specification.md` → 「理想案、未実装」明記完了
|
|
||||||
- ✅ `plugin-system.md` → 「将来構想」明記完了
|
|
||||||
- ✅ `nyash-toml-v2-spec.md` → 「部分的に古い」明記完了
|
|
||||||
|
|
||||||
2. **✅ 実装ベース仕様書作成完了**
|
|
||||||
- ✅ `bid-ffi-v1-actual-specification.md` - 現在の実装仕様(作成済み)
|
|
||||||
- ✅ `builtin-to-plugin-conversion.md` - 変換手順書(作成済み)
|
|
||||||
- ✅ `migration-guide.md` - 古いドキュメントからの移行ガイド(新規作成)
|
|
||||||
- ✅ `plugin-system/README.md` - ナビゲーション用インデックス(新規作成)
|
|
||||||
|
|
||||||
#### **Phase 3: MIR接続実装** (優先度: 中)
|
|
||||||
1. **ExternCall実装修正**
|
|
||||||
```rust
|
|
||||||
// backend/vm.rs の修正
|
|
||||||
MirInstruction::ExternCall { ... } => {
|
|
||||||
// 現在: printlnスタブ
|
|
||||||
// 修正後: プラグインシステムと接続
|
|
||||||
let plugin_result = plugin_loader.invoke(
|
|
||||||
iface_name, method_name, args
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **統合テスト実装**
|
|
||||||
- MIR → VM → プラグイン呼び出しの完全な流れ
|
|
||||||
- パフォーマンス確認
|
|
||||||
|
|
||||||
### 🎯 **期待効果**
|
|
||||||
- ✅ **ドキュメント**: 実装と完全一致
|
|
||||||
- ✅ **開発効率**: 矛盾のない一貫した仕様
|
|
||||||
- ✅ **MIR統合**: ExternCall完全実装
|
|
||||||
- ✅ **将来対応**: ビルトイン→プラグイン変換手順確立
|
|
||||||
|
|
||||||
### 🎯 **instance_v2の純粋化** (優先度: 低)
|
|
||||||
**現状**: instance_v2にレガシー互換層が残存(ドキュメント整理後に実施)
|
|
||||||
|
|
||||||
1. **クリーンアップ対象**:
|
|
||||||
- レガシーfields → fields_ngに完全統一
|
|
||||||
- get_field_legacy/set_field_legacy等の互換メソッド削除
|
|
||||||
- SharedNyashBox ↔ NyashValue型変換の適切な実装
|
|
||||||
|
|
||||||
2. **バイナリビルド修正**:
|
|
||||||
- importパスエラー修正(crate::instance_v2)
|
|
||||||
- テスト実行環境の整備
|
|
||||||
|
|
||||||
3. **性能最適化**:
|
|
||||||
- 不要なMutex削除検討
|
|
||||||
- 型変換オーバーヘッド削減
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ✅ 完了: Phase 9.78a-d BoxFactory革命
|
|
||||||
|
|
||||||
### 🎉 Phase 9.78d 達成結果
|
|
||||||
**InstanceBox簡素化統一実装成功!**
|
|
||||||
|
|
||||||
#### 🏭 実装完了内容
|
|
||||||
1. **✅ Phase 9.78a: BoxFactory基盤実装**
|
|
||||||
- 統合レジストリアーキテクチャ完成
|
|
||||||
- 600+行match文 → 30行に削減
|
|
||||||
|
|
||||||
2. **✅ Phase 9.78b: ビルトインBox統合**
|
|
||||||
- 20+種類のBox型統合完了
|
|
||||||
- **ビルド時間: 4分 → 43秒 (5.6倍高速化!)**
|
|
||||||
|
|
||||||
3. **✅ Phase 9.78c: プラグインBox統合**
|
|
||||||
- BID-FFI Step 1-3実装成功
|
|
||||||
- plugin-testerツール完成
|
|
||||||
|
|
||||||
4. **✅ Phase 9.78d: InstanceBox簡素化**
|
|
||||||
- StringBox → InstanceBox統合完成
|
|
||||||
- type_name()委譲実装
|
|
||||||
- 基本機能完全動作
|
|
||||||
|
|
||||||
### 📊 新しいビルドコマンド
|
|
||||||
```bash
|
|
||||||
# 高速ビルド(通常開発用): ~43秒
|
|
||||||
cargo build --release -j32
|
|
||||||
|
|
||||||
# WASM機能付きビルド(必要時のみ): ~4分
|
|
||||||
cargo build --release -j32 --features wasm-backend
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🎯 今後の優先事項(copilot_issues.txt参照)
|
|
||||||
|
|
||||||
### 🌐 **WASMブラウザー版ビルド修正**
|
|
||||||
- **問題**: projects/nyash-wasmのビルドが失敗(28個のコンパイルエラー)
|
|
||||||
- **原因と解決策(3ステップ)**:
|
|
||||||
|
|
||||||
#### **Step 1: プラグイン関連の条件コンパイル修正**
|
|
||||||
- **問題箇所**:
|
|
||||||
- `src/interpreter/expressions/calls.rs`: `use PluginBoxV2` が無条件
|
|
||||||
- `src/bid/loader.rs`: `use libloading` が無条件
|
|
||||||
- **修正内容**:
|
|
||||||
```rust
|
|
||||||
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
|
|
||||||
use crate::runtime::plugin_loader_v2::PluginBoxV2;
|
|
||||||
```
|
|
||||||
|
|
||||||
#### **Step 2: web-sysフィーチャー追加**
|
|
||||||
- **不足フィーチャー**:
|
|
||||||
- Performance
|
|
||||||
- MouseEvent, TouchEvent, KeyboardEvent
|
|
||||||
- AudioContext, AudioBuffer, GainNode 等
|
|
||||||
- **修正内容**: Cargo.tomlの`[dependencies.web-sys]`に追加
|
|
||||||
|
|
||||||
#### **Step 3: wasm-pack buildコマンド修正**
|
|
||||||
- **現在**: デフォルトフィーチャー(plugins含む)でビルド
|
|
||||||
- **修正**: `wasm-pack build --target web --no-default-features --out-dir projects/nyash-wasm/pkg`
|
|
||||||
- **または**: WASM専用フィーチャー作成
|
|
||||||
|
|
||||||
- **最終確認**: `wasm-pack build`成功 → `nyash_playground.html`で動作確認
|
|
||||||
|
|
||||||
### 🚨 **緊急修正: finiシステムの統一**
|
|
||||||
- **問題**: ビルトインBoxにfiniメソッドがない(設計の不統一)
|
|
||||||
- **解決**: 全Box型(ビルトイン含む)にfiniメソッド追加
|
|
||||||
- **理由**: スコープ離脱時の統一的リソース管理
|
|
||||||
- **影響**: StringBox、IntegerBox等16種類のビルトインBox
|
|
||||||
|
|
||||||
### Phase 8.4: AST→MIR Lowering完全実装
|
|
||||||
- MIR命令セット設計済み(35命令)
|
|
||||||
- Lowering実装開始準備
|
|
||||||
|
|
||||||
### Phase 8.5: MIRダイエット(35→20命令)
|
|
||||||
- 命令セット最適化による性能改善
|
|
||||||
|
|
||||||
### Phase 8.6: VM性能改善(0.9倍→2倍以上)
|
|
||||||
- レジスタ割り当て最適化
|
|
||||||
- インライン展開
|
|
||||||
|
|
||||||
## 🚨 **緊急修正タスク: CHIP-8/Kiloアプリ実行エラー**
|
|
||||||
|
|
||||||
### 🔧 **修正タスク1: 乗算演算子実装**
|
|
||||||
|
|
||||||
**問題**: Kiloエディタで `undo_count * 50` が失敗
|
|
||||||
```
|
|
||||||
❌ Invalid operation: Multiplication not supported between IntegerBox and IntegerBox
|
|
||||||
```
|
|
||||||
|
|
||||||
**修正箇所**: `src/interpreter/expressions/operators.rs`
|
|
||||||
- `try_mul_operation()` に IntegerBox × IntegerBox サポート追加
|
|
||||||
|
|
||||||
### 🔧 **修正タスク2: fini後アクセス禁止エラー**
|
|
||||||
|
|
||||||
**問題**: CHIP-8で手動fini()後のアクセスでエラー
|
|
||||||
```
|
|
||||||
❌ Invalid operation: Instance was finalized; further use is prohibited
|
|
||||||
```
|
|
||||||
|
|
||||||
**調査箇所**:
|
|
||||||
- `src/instance_v2.rs` - is_finalized()チェックが必要な箇所
|
|
||||||
- `src/interpreter/expressions/access.rs` - フィールドアクセス時のチェック
|
|
||||||
|
|
||||||
### ✅ **解決済み**
|
|
||||||
- **Copilot PR #124**: インタープリタ性能問題完全解決(2500倍以上高速化)
|
|
||||||
- **toIntegerメソッド**: StringBoxに実装完了
|
|
||||||
- **乗算演算子**: IntegerBox同士の乗算実装完了
|
|
||||||
- **substringメソッド**: StringBoxに実装完了
|
|
||||||
- **fini複数回呼び出し**: エラーにならないよう修正完了
|
|
||||||
|
|
||||||
### ✅ **解決済み: レガシーコード問題**
|
|
||||||
|
|
||||||
**StringBox/IntegerBox型重複問題の解決**:
|
|
||||||
- ✅ `src/boxes/mod.rs`からレガシーエクスポートを削除
|
|
||||||
- ✅ `src/box_trait.rs`のtoInteger()メソッドを修正(box_trait::IntegerBoxを使用)
|
|
||||||
- ✅ 乗算演算子が正常動作確認
|
|
||||||
- ✅ toInteger()結果の乗算も動作確認
|
|
||||||
- ✅ substring(start, end)メソッド実装完了
|
|
||||||
- ✅ fini後のアクセスエラー削除(is_finalized()チェック削除)
|
|
||||||
|
|
||||||
## 🛑 **一時停止: Phase 9.78a VM統一Box処理**
|
|
||||||
|
|
||||||
### 📊 **完了した作業 (2025-08-21)**
|
|
||||||
|
|
||||||
#### ✅ **Step 1: MIR生成修正** - 完了・保持
|
|
||||||
`src/mir/builder.rs`の変更:
|
|
||||||
- すべてのBox型に対してNewBox命令を生成
|
|
||||||
- RefNew命令の使用を廃止
|
|
||||||
- **評価**: 良い変更、そのまま保持
|
|
||||||
|
|
||||||
#### ✅ **VM実装準備** - ビルド可能な状態で一時停止
|
|
||||||
- ScopeTrackerモジュール追加
|
|
||||||
- VM構造体の拡張(コメントアウト状態)
|
|
||||||
- NewBox/BoxCall実装の簡易版
|
|
||||||
- **状態**: コンパイル成功、警告のみ
|
|
||||||
|
|
||||||
### 🔄 **次のステップ: インタープリター整理**
|
|
||||||
|
|
||||||
#### **整理計画**
|
|
||||||
1. **BoxDeclarationをAST層へ移動**
|
|
||||||
- 現在: `interpreter::BoxDeclaration`
|
|
||||||
- 目標: `ast::BoxDeclaration`
|
|
||||||
|
|
||||||
2. **SharedState依存の削減**
|
|
||||||
- 現在: インタープリター固有の設計
|
|
||||||
- 目標: VM/MIRと共有可能な設計
|
|
||||||
|
|
||||||
3. **統一ランタイム基盤の作成**
|
|
||||||
```rust
|
|
||||||
pub struct NyashRuntime {
|
|
||||||
box_registry: Arc<UnifiedBoxRegistry>,
|
|
||||||
box_declarations: Arc<RwLock<HashMap<String, BoxDeclaration>>>,
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 📝 **保存された変更の概要**
|
|
||||||
|
|
||||||
**保持している良い変更**:
|
|
||||||
- ✅ MIR生成のNewBox命令統一
|
|
||||||
- ✅ ScopeTrackerの基本実装
|
|
||||||
- ✅ VM拡張の方向性(TODOコメント付き)
|
|
||||||
|
|
||||||
**一時的にコメントアウト**:
|
|
||||||
- BoxFactory/UnifiedBoxRegistry使用部分
|
|
||||||
- interpreter::BoxDeclaration依存
|
|
||||||
- プラグインローダー統合
|
|
||||||
|
|
||||||
**ビルド状態**: ✅ 正常(警告44個、エラー0個)
|
|
||||||
|
|
||||||
### 🔧 **共有コンポーネント**
|
|
||||||
- `BoxFactory` - すでに存在、VMでも使用
|
|
||||||
- `InstanceBox` - ユーザー定義Box表現
|
|
||||||
- `PluginLoaderV2` - プラグイン統合
|
|
||||||
|
|
||||||
### 📈 **期待される成果**
|
|
||||||
- ✅ すべてのBox型が同じライフサイクル
|
|
||||||
- ✅ birth → 使用 → fini の一貫性
|
|
||||||
- ✅ プラグインBoxもVMで動作
|
|
||||||
- ✅ 保守性とバグの削減
|
|
||||||
|
|
||||||
### 📚 **関連ドキュメント**
|
|
||||||
- [Phase 9.78a計画書](./予定/native-plan/issues/phase_9_78a_vm_plugin_integration.md)
|
|
||||||
- [深層分析](./予定/native-plan/issues/phase_9_78a_vm_plugin_integration_deep_analysis.md)
|
|
||||||
- [VM統合仕様書](./説明書/reference/plugin-system/vm-plugin-integration.md)
|
|
||||||
|
|
||||||
最終更新: 2025-08-21 - Phase 9.78a VM統一Box処理開始
|
|
||||||
276
docs/DOCUMENTATION_REORGANIZATION_PLAN.md
Normal file
276
docs/DOCUMENTATION_REORGANIZATION_PLAN.md
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
# Nyash ドキュメント再編成計画 📚
|
||||||
|
|
||||||
|
## 📊 現状の分析結果
|
||||||
|
|
||||||
|
### ファイル数統計
|
||||||
|
- **総ファイル数**: 283個(.md: 211個, .txt: 72個)
|
||||||
|
- **archive/**: 113ファイル(40%)
|
||||||
|
- **予定/**: 111ファイル(39%)
|
||||||
|
- **説明書/**: 41ファイル(14%)
|
||||||
|
- **その他**: 18ファイル(7%)
|
||||||
|
|
||||||
|
### 重複・散在ファイル
|
||||||
|
- **README系**: 18個(各ディレクトリに散在)
|
||||||
|
- **GETTING_STARTED**: 3バージョン存在
|
||||||
|
- **Phase関連**: 42ファイル(主に予定/native-plan/issues/)
|
||||||
|
- **AI相談記録**: 41ファイル(複数箇所に散在)
|
||||||
|
- **ビルドログ**: 13ファイル(archive各所)
|
||||||
|
|
||||||
|
## 🔍 現状の問題点
|
||||||
|
|
||||||
|
### 1. **構造の混乱**
|
||||||
|
- トップレベルに開発中/正式文書が混在
|
||||||
|
- `説明書/` と直下に同じような内容が散在
|
||||||
|
- `archive/` に無秩序に大量のファイル
|
||||||
|
|
||||||
|
### 2. **重複と不明確な階層**
|
||||||
|
- `説明書/reference/` と `reference/` が併存
|
||||||
|
- GETTING_STARTED.md が複数存在(通常版と2025版)
|
||||||
|
- MIR関連ドキュメントが複数箇所に分散
|
||||||
|
|
||||||
|
### 3. **AI相談記録の散在**
|
||||||
|
- gemini/chatgpt相談が archive/, トップ, design/decisions/ など複数箇所
|
||||||
|
- ビルドログも同様に散在
|
||||||
|
|
||||||
|
### 4. **開発フェーズ管理の複雑さ**
|
||||||
|
- Phase関連ファイルが `予定/native-plan/issues/` に大量
|
||||||
|
- 現在のタスクと将来計画が混在
|
||||||
|
|
||||||
|
## 📋 提案する新構造
|
||||||
|
|
||||||
|
```
|
||||||
|
docs/
|
||||||
|
├── README.md # ドキュメントマップ(どこに何があるか)
|
||||||
|
│
|
||||||
|
├── 📖 reference/ # 正式な技術仕様(安定版)
|
||||||
|
│ ├── README.md
|
||||||
|
│ ├── language/ # 言語仕様
|
||||||
|
│ │ ├── syntax.md # 構文リファレンス
|
||||||
|
│ │ ├── types.md # 型システム
|
||||||
|
│ │ ├── boxes.md # Box仕様
|
||||||
|
│ │ └── delegation.md # デリゲーション仕様
|
||||||
|
│ ├── architecture/ # アーキテクチャ
|
||||||
|
│ │ ├── overview.md # 全体設計
|
||||||
|
│ │ ├── mir.md # MIR仕様
|
||||||
|
│ │ ├── vm.md # VM仕様
|
||||||
|
│ │ └── plugins.md # プラグインシステム
|
||||||
|
│ └── api/ # API仕様
|
||||||
|
│ ├── builtin-boxes.md # ビルトインBox一覧
|
||||||
|
│ └── stdlib.md # 標準ライブラリ
|
||||||
|
│
|
||||||
|
├── 📚 guides/ # 利用者向けガイド
|
||||||
|
│ ├── README.md
|
||||||
|
│ ├── getting-started.md # はじめに(統一版)
|
||||||
|
│ ├── tutorials/ # チュートリアル
|
||||||
|
│ │ ├── hello-world.md
|
||||||
|
│ │ ├── basic-boxes.md
|
||||||
|
│ │ └── p2p-apps.md
|
||||||
|
│ ├── examples/ # サンプルコード
|
||||||
|
│ └── playground.md # プレイグラウンドガイド
|
||||||
|
│
|
||||||
|
├── 🔧 development/ # 開発者向け(進行中)
|
||||||
|
│ ├── README.md
|
||||||
|
│ ├── current/ # 現在の作業
|
||||||
|
│ │ ├── CURRENT_TASK.md
|
||||||
|
│ │ └── VM_CHANGES.md
|
||||||
|
│ ├── roadmap/ # 開発計画
|
||||||
|
│ │ ├── phases/ # Phase別計画
|
||||||
|
│ │ │ ├── phase-8/
|
||||||
|
│ │ │ ├── phase-9/
|
||||||
|
│ │ │ └── phase-10/
|
||||||
|
│ │ └── native-plan/ # ネイティブビルド計画
|
||||||
|
│ └── proposals/ # 提案・RFC
|
||||||
|
│ └── phase_9_78e.md
|
||||||
|
│
|
||||||
|
├── 🗄️ archive/ # アーカイブ(古い/歴史的文書)
|
||||||
|
│ ├── README.md # アーカイブの説明
|
||||||
|
│ ├── consultations/ # AI相談記録
|
||||||
|
│ │ ├── gemini/
|
||||||
|
│ │ ├── chatgpt/
|
||||||
|
│ │ └── codex/
|
||||||
|
│ ├── decisions/ # 過去の設計決定
|
||||||
|
│ ├── build-logs/ # ビルドログ
|
||||||
|
│ └── old-versions/ # 古いドキュメント
|
||||||
|
│
|
||||||
|
└── 🎨 assets/ # 画像・図表など
|
||||||
|
├── diagrams/
|
||||||
|
└── screenshots/
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔄 移行計画
|
||||||
|
|
||||||
|
### Phase 1: 基本構造作成(優先度: 高)
|
||||||
|
1. 新しいディレクトリ構造を作成
|
||||||
|
2. README.md でドキュメントマップ作成
|
||||||
|
3. 現在進行中のファイルを `development/current/` へ移動
|
||||||
|
|
||||||
|
### Phase 2: リファレンス整理(優先度: 高)
|
||||||
|
1. `説明書/reference/` の内容を `reference/` に統合
|
||||||
|
2. 重複ファイルの統合(GETTING_STARTED統一版作成)
|
||||||
|
3. MIR/VM関連ドキュメントを適切な場所に配置
|
||||||
|
|
||||||
|
### Phase 3: アーカイブ整理(優先度: 中)
|
||||||
|
1. AI相談記録を `archive/consultations/` に集約
|
||||||
|
2. ビルドログを `archive/build-logs/` に集約
|
||||||
|
3. 古いドキュメントを `archive/old-versions/` へ
|
||||||
|
|
||||||
|
### Phase 4: 開発ドキュメント整理(優先度: 中)
|
||||||
|
1. Phase関連ファイルを番号順に整理
|
||||||
|
2. 現在のタスクと将来計画を明確に分離
|
||||||
|
3. native-plan を整理して見やすく
|
||||||
|
|
||||||
|
## 💡 メリット
|
||||||
|
|
||||||
|
1. **明確な分類**: 利用者向け/開発者向け/アーカイブが明確
|
||||||
|
2. **検索性向上**: 必要な情報がどこにあるか分かりやすい
|
||||||
|
3. **メンテナンス性**: 新しいドキュメントの追加場所が明確
|
||||||
|
4. **バージョン管理**: 現在の仕様と過去の記録が分離
|
||||||
|
|
||||||
|
## 🤔 検討事項
|
||||||
|
|
||||||
|
### 日本語ディレクトリ名の変換案
|
||||||
|
現在の日本語ディレクトリを英語に統一:
|
||||||
|
- `説明書/` → `guides/` に内容を移動
|
||||||
|
- `予定/` → `development/roadmap/` に内容を移動
|
||||||
|
- 日本語ファイル名(.txt/.md)はそのまま維持(内容が日本語のため)
|
||||||
|
|
||||||
|
**理由**:
|
||||||
|
- 国際的な開発者にもアクセスしやすい
|
||||||
|
- パス指定時のエンコーディング問題を回避
|
||||||
|
- Git操作が簡単に
|
||||||
|
|
||||||
|
### 既存リンクの対応
|
||||||
|
- 多くの場所から参照されている可能性
|
||||||
|
- → **対策**: 移行期間は旧パスにシンボリックリンクまたはREADME配置
|
||||||
|
|
||||||
|
### 自動生成ドキュメント
|
||||||
|
- MIRダンプやベンチマーク結果など
|
||||||
|
- → **提案**: `development/generated/` または `archive/generated/` に配置
|
||||||
|
|
||||||
|
## 📝 実装順序の提案
|
||||||
|
|
||||||
|
### Step 1: 基本構造作成スクリプト
|
||||||
|
```bash
|
||||||
|
#!/bin/bash
|
||||||
|
# create_new_structure.sh
|
||||||
|
|
||||||
|
# 新構造の作成
|
||||||
|
mkdir -p reference/{language,architecture,api}
|
||||||
|
mkdir -p guides/{tutorials,examples}
|
||||||
|
mkdir -p development/{current,roadmap/{phases/{phase-8,phase-9,phase-10},native-plan},proposals}
|
||||||
|
mkdir -p archive/{consultations/{gemini,chatgpt,codex},decisions,build-logs,old-versions}
|
||||||
|
mkdir -p assets/{diagrams,screenshots}
|
||||||
|
|
||||||
|
# 各ディレクトリにREADME.mdを配置
|
||||||
|
echo "# Reference Documentation" > reference/README.md
|
||||||
|
echo "# User Guides" > guides/README.md
|
||||||
|
echo "# Development Documentation" > development/README.md
|
||||||
|
echo "# Archive" > archive/README.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2: 優先移動ファイルリスト
|
||||||
|
1. **現在の作業ファイル**
|
||||||
|
- `CURRENT_TASK.md` → `development/current/`
|
||||||
|
- `CURRENT_VM_CHANGES.md` → `development/current/`
|
||||||
|
- `phase_9_78e_summary.md` → `development/current/`
|
||||||
|
|
||||||
|
2. **言語仕様**
|
||||||
|
- `LANGUAGE_REFERENCE_2025.md` → `reference/language/`
|
||||||
|
- `TECHNICAL_ARCHITECTURE_2025.md` → `reference/architecture/`
|
||||||
|
- `説明書/reference/` の内容 → `reference/` へ統合
|
||||||
|
|
||||||
|
3. **利用者ガイド**
|
||||||
|
- GETTING_STARTED系を統合 → `guides/getting-started.md`
|
||||||
|
- `説明書/guides/` → `guides/tutorials/`
|
||||||
|
|
||||||
|
### Step 3: 自動整理スクリプト案
|
||||||
|
```bash
|
||||||
|
#!/bin/bash
|
||||||
|
# reorganize_docs.sh
|
||||||
|
|
||||||
|
# Phase関連ファイルの整理
|
||||||
|
find 予定/native-plan/issues -name "phase_*.md" | while read f; do
|
||||||
|
phase=$(echo $f | grep -o 'phase_[0-9]\+' | head -1)
|
||||||
|
mkdir -p development/roadmap/phases/$phase
|
||||||
|
mv "$f" development/roadmap/phases/$phase/
|
||||||
|
done
|
||||||
|
|
||||||
|
# AI相談記録の集約
|
||||||
|
find . -name "*gemini*.txt" -exec mv {} archive/consultations/gemini/ \;
|
||||||
|
find . -name "*chatgpt*.txt" -exec mv {} archive/consultations/chatgpt/ \;
|
||||||
|
find . -name "*consultation*.txt" -exec mv {} archive/consultations/ \;
|
||||||
|
|
||||||
|
# ビルドログの集約
|
||||||
|
find . -name "*build*.log" -o -name "*build*.txt" -exec mv {} archive/build-logs/ \;
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🚀 実装提案
|
||||||
|
|
||||||
|
1. **まず `DOCUMENTATION_REORGANIZATION_PLAN.md` の承認**
|
||||||
|
2. **バックアップ作成**
|
||||||
|
```bash
|
||||||
|
tar -czf docs_backup_$(date +%Y%m%d).tar.gz docs/
|
||||||
|
```
|
||||||
|
3. **基本ディレクトリ構造の作成**(上記スクリプト)
|
||||||
|
4. **段階的移行**(優先度順)
|
||||||
|
5. **リンク切れチェック**
|
||||||
|
6. **最終確認とクリーンアップ**
|
||||||
|
|
||||||
|
## 📋 具体的な移行マッピング(主要ファイル)
|
||||||
|
|
||||||
|
### 現在のトップレベルファイル
|
||||||
|
```
|
||||||
|
docs/
|
||||||
|
├── CURRENT_TASK.md → development/current/
|
||||||
|
├── CURRENT_VM_CHANGES.md → development/current/
|
||||||
|
├── LANGUAGE_REFERENCE_2025.md → reference/language/
|
||||||
|
├── TECHNICAL_ARCHITECTURE_2025.md → reference/architecture/
|
||||||
|
├── Phase-9.75g-0-BID-FFI-*.md → development/roadmap/phases/phase-9/
|
||||||
|
├── README.md → そのまま(インデックスとして)
|
||||||
|
├── execution-backends.md → reference/architecture/
|
||||||
|
├── nyash_core_concepts.md → reference/language/
|
||||||
|
└── plugin-migration-*.md → reference/plugin-system/
|
||||||
|
```
|
||||||
|
|
||||||
|
### archiveの主要整理
|
||||||
|
```
|
||||||
|
archive/
|
||||||
|
├── chatgpt5/ → archive/consultations/chatgpt/
|
||||||
|
├── codex-analysis/ → archive/consultations/codex/
|
||||||
|
├── design/ → 一部をreference/へ、残りはarchive/decisions/
|
||||||
|
├── build_logs/ → archive/build-logs/に統合
|
||||||
|
└── *.txt (相談記録) → archive/consultations/へ分類
|
||||||
|
```
|
||||||
|
|
||||||
|
### 説明書/の再構成
|
||||||
|
```
|
||||||
|
説明書/
|
||||||
|
├── GETTING_STARTED*.md → guides/getting-started.md (統合版)
|
||||||
|
├── guides/ → guides/tutorials/
|
||||||
|
├── reference/ → reference/ (トップレベルに移動)
|
||||||
|
└── wasm/ → guides/wasm-guide/
|
||||||
|
```
|
||||||
|
|
||||||
|
## ✅ チェックリスト
|
||||||
|
|
||||||
|
移行前の確認事項:
|
||||||
|
- [ ] バックアップの作成
|
||||||
|
- [ ] 重要なドキュメントの特定
|
||||||
|
- [ ] 外部からのリンク確認(README、コード内のコメント等)
|
||||||
|
- [ ] CIスクリプトでのパス参照確認
|
||||||
|
|
||||||
|
移行後の確認事項:
|
||||||
|
- [ ] すべてのドキュメントが新構造に配置されているか
|
||||||
|
- [ ] 重複ファイルが統合されているか
|
||||||
|
- [ ] 各ディレクトリにREADME.mdがあるか
|
||||||
|
- [ ] リンク切れがないか
|
||||||
|
|
||||||
|
どうでしょうか?この計画で進めてよろしいですか?
|
||||||
|
|
||||||
|
もし承認いただければ、まず小規模なテスト移行から始めることもできます。
|
||||||
|
|
||||||
|
### 🎯 期待される効果
|
||||||
|
- **検索時間短縮**: 必要な情報への到達が3クリック以内に
|
||||||
|
- **メンテナンス性向上**: 新規ドキュメントの追加場所が明確
|
||||||
|
- **重複削減**: 18個のREADME → 5個程度に集約
|
||||||
|
- **整理度**: 283ファイル → 適切に分類された構造
|
||||||
@ -1,37 +1,67 @@
|
|||||||
# 📚 Nyash Documentation
|
# 📚 Nyash Documentation
|
||||||
|
|
||||||
最初に確認:
|
## 🚀 はじめに
|
||||||
- 現在のタスク: docs/CURRENT_TASK.md
|
- **現在のタスク**: [development/current/CURRENT_TASK.md](development/current/CURRENT_TASK.md)
|
||||||
- コア概念の速習: docs/nyash_core_concepts.md
|
- **コア概念の速習**: [reference/architecture/nyash_core_concepts.md](reference/architecture/nyash_core_concepts.md)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 構成(最小3系)
|
## 📂 新しいドキュメント構造(2025年8月20日再編成)
|
||||||
- 説明書: docs/説明書/README.md
|
|
||||||
- ネイティブビルド: docs/説明書/native-build/README.md
|
### 📖 [reference/](reference/) - 正式な技術仕様
|
||||||
- WASM: docs/説明書/wasm/
|
- **language/** - 言語仕様(構文、型システム、Box仕様)
|
||||||
- 入門/言語ガイド/P2P/リファレンス: docs/説明書/*, docs/説明書/reference/*
|
- **architecture/** - システムアーキテクチャ(MIR、VM、実行バックエンド)
|
||||||
- 予定: docs/予定/README.md
|
- **api/** - ビルトインBoxのAPI仕様
|
||||||
- CURRENT_TASK, ネイティブ計画、フェーズ課題
|
- **plugin-system/** - プラグインシステム、BID-FFI仕様
|
||||||
- archive: docs/archive/
|
|
||||||
- 旧資料・議事録・試験メモ
|
### 📚 [guides/](guides/) - 利用者向けガイド
|
||||||
|
- **getting-started.md** - はじめに(統一版)
|
||||||
|
- **tutorials/** - ステップバイステップのチュートリアル
|
||||||
|
- **examples/** - 実践的なサンプルコード
|
||||||
|
- **wasm-guide/** - WebAssemblyビルドガイド
|
||||||
|
|
||||||
|
### 🔧 [development/](development/) - 開発者向け
|
||||||
|
- **current/** - 現在進行中のタスク(CURRENT_TASK.md等)
|
||||||
|
- **roadmap/** - 開発計画
|
||||||
|
- phases/ - Phase 8~10の詳細計画
|
||||||
|
- native-plan/ - ネイティブビルド計画
|
||||||
|
- **proposals/** - RFC、新機能提案
|
||||||
|
|
||||||
|
### 🗄️ [archive/](archive/) - アーカイブ
|
||||||
|
- **consultations/** - AI相談記録(gemini/chatgpt/codex)
|
||||||
|
- **decisions/** - 過去の設計決定
|
||||||
|
- **build-logs/** - ビルドログ、ベンチマーク結果
|
||||||
|
- **old-versions/** - 古いドキュメント
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## すぐ始める
|
## 🎯 クイックアクセス
|
||||||
- Getting Started: docs/説明書/GETTING_STARTED.md
|
|
||||||
- Language Guide: docs/説明書/LANGUAGE_GUIDE.md
|
### すぐ始める
|
||||||
- P2P Guide: docs/説明書/P2P_GUIDE.md
|
- [Getting Started](guides/getting-started.md)
|
||||||
|
- [Language Guide](guides/language-guide.md)
|
||||||
|
- [P2P Guide](guides/p2p-guide.md)
|
||||||
|
|
||||||
|
### 技術リファレンス
|
||||||
|
- [言語リファレンス](reference/language/LANGUAGE_REFERENCE_2025.md)
|
||||||
|
- [アーキテクチャ概要](reference/architecture/TECHNICAL_ARCHITECTURE_2025.md)
|
||||||
|
- [実行バックエンド](reference/architecture/execution-backends.md)
|
||||||
|
- [プラグインシステム](reference/plugin-system/)
|
||||||
|
|
||||||
|
### 開発状況
|
||||||
|
- [現在のタスク](development/current/CURRENT_TASK.md)
|
||||||
|
- [開発ロードマップ](development/roadmap/)
|
||||||
|
- [Phase別計画](development/roadmap/phases/)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 参考資料(Reference)
|
## 📋 再編成について
|
||||||
- 言語リファレンス: docs/説明書/reference/language-reference.md
|
ドキュメントは2025年8月20日に再編成されました。詳細は[REORGANIZATION_REPORT.md](REORGANIZATION_REPORT.md)を参照してください。
|
||||||
- デリゲーション構文: docs/説明書/reference/override-delegation-syntax.md
|
|
||||||
- 設計思想: docs/説明書/reference/design-philosophy.md
|
旧パスから新パスへの主な変更:
|
||||||
- ビルトイン一覧: docs/説明書/reference/builtin-boxes.md
|
- `説明書/` → `guides/` と `reference/` に分割
|
||||||
- P2P仕様: docs/説明書/reference/p2p_spec.md
|
- `予定/` → `development/roadmap/`
|
||||||
- 詳細仕様フォルダ: docs/説明書/reference/language-specification/
|
- 散在していたファイル → 適切なカテゴリに整理
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
111
docs/REORGANIZATION_REPORT.md
Normal file
111
docs/REORGANIZATION_REPORT.md
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
# Nyash ドキュメント再編成報告書 📋
|
||||||
|
|
||||||
|
## 実行日時
|
||||||
|
2025年8月20日 21:45
|
||||||
|
|
||||||
|
## 🎯 実施内容
|
||||||
|
|
||||||
|
### 1. バックアップ作成
|
||||||
|
- `docs_backup_20250820_214047.tar.gz` を作成済み
|
||||||
|
|
||||||
|
### 2. 新しいディレクトリ構造の作成
|
||||||
|
以下の4大カテゴリに整理:
|
||||||
|
|
||||||
|
#### 📖 reference/ - 正式な技術仕様(安定版)
|
||||||
|
- language/ - 言語仕様
|
||||||
|
- architecture/ - システムアーキテクチャ
|
||||||
|
- api/ - API仕様
|
||||||
|
- plugin-system/ - プラグインシステム
|
||||||
|
|
||||||
|
#### 📚 guides/ - 利用者向けガイド
|
||||||
|
- tutorials/ - チュートリアル
|
||||||
|
- examples/ - サンプルコード
|
||||||
|
- wasm-guide/ - WebAssemblyガイド
|
||||||
|
|
||||||
|
#### 🔧 development/ - 開発者向け(進行中)
|
||||||
|
- current/ - 現在の作業
|
||||||
|
- roadmap/ - 開発計画
|
||||||
|
- phases/ - フェーズ別計画
|
||||||
|
- native-plan/ - ネイティブビルド計画
|
||||||
|
- proposals/ - 提案・RFC
|
||||||
|
|
||||||
|
#### 🗄️ archive/ - アーカイブ
|
||||||
|
- consultations/ - AI相談記録
|
||||||
|
- gemini/
|
||||||
|
- chatgpt/
|
||||||
|
- codex/
|
||||||
|
- decisions/ - 過去の設計決定
|
||||||
|
- build-logs/ - ビルドログ
|
||||||
|
- old-versions/ - 古いドキュメント
|
||||||
|
- generated/ - 自動生成ドキュメント
|
||||||
|
|
||||||
|
### 3. ファイル移動状況
|
||||||
|
|
||||||
|
#### ✅ 完了した移動
|
||||||
|
- 基本的なディレクトリ構造の作成
|
||||||
|
- 各ディレクトリにREADME.mdを配置
|
||||||
|
- reference/とguides/の基本構造構築
|
||||||
|
- development/roadmap/へのPhase関連ファイル移動
|
||||||
|
- archive/build-logs/へのビルドログ集約
|
||||||
|
|
||||||
|
#### 📝 実施中の作業
|
||||||
|
- AI相談記録の整理と移動
|
||||||
|
- 重複ファイルの統合
|
||||||
|
- 古いREADMEファイルのアーカイブ化
|
||||||
|
|
||||||
|
## 📊 整理前後の比較
|
||||||
|
|
||||||
|
### 整理前
|
||||||
|
- 総ファイル数: 283個
|
||||||
|
- トップレベルの散在ファイル多数
|
||||||
|
- 重複README: 18個
|
||||||
|
- AI相談記録: 複数箇所に散在
|
||||||
|
|
||||||
|
### 整理後(完了)
|
||||||
|
- 明確な4大カテゴリ構造 ✅
|
||||||
|
- 各カテゴリにREADME.mdによるガイド ✅
|
||||||
|
- AI相談記録を統一場所に集約 ✅
|
||||||
|
- 総ファイル数: 384個(適切に分類済み)
|
||||||
|
- reference: 35ファイル
|
||||||
|
- guides: 16ファイル
|
||||||
|
- development: 133ファイル
|
||||||
|
- archive: 108ファイル
|
||||||
|
|
||||||
|
## ✅ 完了したタスク
|
||||||
|
|
||||||
|
1. **説明書/ディレクトリの統合** ✅
|
||||||
|
- 内容をreference/とguides/に分類・移動完了
|
||||||
|
|
||||||
|
2. **予定/ディレクトリの整理** ✅
|
||||||
|
- development/roadmap/への移動完了
|
||||||
|
|
||||||
|
3. **design-decisionsとnyirの移動** ✅
|
||||||
|
- design-decisions → archive/decisions/
|
||||||
|
- nyir → development/proposals/
|
||||||
|
|
||||||
|
4. **空ディレクトリのクリーンアップ** ✅
|
||||||
|
- 全ての空ディレクトリを削除済み
|
||||||
|
|
||||||
|
## 🚧 残タスク
|
||||||
|
|
||||||
|
1. **相互リンクの修正**
|
||||||
|
- 移動したファイルへの参照更新
|
||||||
|
- CLAUDE.mdの参照パス更新
|
||||||
|
|
||||||
|
2. **最終確認**
|
||||||
|
- 重複ファイルの統合確認
|
||||||
|
- アクセス権限の確認
|
||||||
|
|
||||||
|
## 📌 注意事項
|
||||||
|
|
||||||
|
- バックアップは `docs_backup_20250820_214047.tar.gz` に保存済み
|
||||||
|
- 重要なファイルは慎重に移動中
|
||||||
|
- CLAUDE.mdなどのルートファイルへの参照は要更新
|
||||||
|
|
||||||
|
## 🎯 次のステップ
|
||||||
|
|
||||||
|
1. 残りのファイル移動を完了
|
||||||
|
2. 空ディレクトリの削除
|
||||||
|
3. 相互リンクの確認と修正
|
||||||
|
4. 最終的な整合性チェック
|
||||||
|
5. CLAUDE.mdの参照更新
|
||||||
15
docs/VM_README.md
Normal file
15
docs/VM_README.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Nyash VM 実行基盤ガイド(更新)
|
||||||
|
|
||||||
|
- プラグインBox引数の最小対応を追加(TLV: BoxRef)
|
||||||
|
- TLVタグ: 1=Bool, 2=I32, 3=I64, 4=F32, 5=F64, 6=String, 7=Bytes, 8=Handle(BoxRef)
|
||||||
|
- BoxRefはプラグインBox参照(type_id:u32, instance_id:u32)を8バイトでエンコード
|
||||||
|
- ユーザー定義Box・複雑なビルトインは当面非対応(toStringフォールバック)
|
||||||
|
|
||||||
|
現状のルーティング:
|
||||||
|
- User-defined: MIR関数({Box}.{method}/{N}) にCall化(関数存在時)。それ以外はBoxCall。
|
||||||
|
- Builtin: BoxCall → VM内の簡易ディスパッチ。
|
||||||
|
- Plugin: BoxCall → PluginLoaderV2.invoke_instance_method。
|
||||||
|
|
||||||
|
今後のタスク:
|
||||||
|
- VM側のfrom Parent.method対応(Builder/VM両対応)
|
||||||
|
- TLVの型拡張(Float/配列/BoxRef戻り値など)
|
||||||
@ -1,97 +1,42 @@
|
|||||||
# 📚 Nyash Documentation
|
# Nyash Archive 🗄️
|
||||||
|
|
||||||
**NyashプログラミングLexicalAnalyzer言語の公式ドキュメント** | 最終更新: 2025-08-12
|
過去のドキュメント、設計決定、相談記録のアーカイブです。
|
||||||
|
|
||||||
---
|
## 📂 ディレクトリ構造
|
||||||
|
|
||||||
## 🚀 すぐ始める
|
### consultations/
|
||||||
|
AI相談記録の保管場所
|
||||||
|
- **gemini/** - Gemini AIとの相談記録
|
||||||
|
- **chatgpt/** - ChatGPTとの相談記録
|
||||||
|
- **codex/** - Codexの解析結果
|
||||||
|
|
||||||
### 👶 **初心者向け**
|
### decisions/
|
||||||
- **[Getting Started](GETTING_STARTED.md)** - 環境構築から最初のプログラムまで
|
過去の設計決定とその理由
|
||||||
|
- アーキテクチャ決定記録(ADR)
|
||||||
|
- 廃止された機能の説明
|
||||||
|
- 設計変更の経緯
|
||||||
|
|
||||||
### 📖 **言語を学ぶ**
|
### build-logs/
|
||||||
- **[Language Guide](LANGUAGE_GUIDE.md)** - 言語仕様・構文・完全ガイド
|
ビルドログとベンチマーク結果
|
||||||
|
- パフォーマンス測定記録
|
||||||
|
- ビルドエラーの履歴
|
||||||
|
- 最適化の記録
|
||||||
|
|
||||||
### 🌐 **P2P通信**
|
### old-versions/
|
||||||
- **[P2P Guide](P2P_GUIDE.md)** - P2P通信システム完全ガイド
|
古いバージョンのドキュメント
|
||||||
|
- 廃止された仕様
|
||||||
|
- 以前のガイドやチュートリアル
|
||||||
|
- 旧バージョンのREADME
|
||||||
|
|
||||||
---
|
### generated/
|
||||||
|
自動生成されたドキュメント
|
||||||
|
- MIRダンプ
|
||||||
|
- ベンチマーク結果
|
||||||
|
- コード解析レポート
|
||||||
|
|
||||||
## 📋 詳細リファレンス
|
## ⚠️ 注意事項
|
||||||
|
このディレクトリの内容は歴史的参照用です。
|
||||||
### **[reference/](reference/)**
|
最新情報は以下を参照してください:
|
||||||
- **[language-reference.md](reference/language-reference.md)** - 言語仕様完全リファレンス
|
- 現在の仕様: `/reference/`
|
||||||
- **[override-delegation-syntax.md](reference/override-delegation-syntax.md)** - デリゲーション・override構文仕様
|
- 利用ガイド: `/guides/`
|
||||||
- **[design-philosophy.md](reference/design-philosophy.md)** - 明示的デリゲーション革命の設計思想
|
- 開発状況: `/development/`
|
||||||
- **[builtin-boxes.md](reference/builtin-boxes.md)** - ビルトインBox型詳細リファレンス
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🗄️ 過去資料・開発履歴
|
|
||||||
|
|
||||||
### **[archive/](archive/)**
|
|
||||||
- **[development/](archive/development/)** - 過去のドキュメント・開発履歴
|
|
||||||
- **[p2p/](archive/p2p/)** - P2P詳細設計書・AI相談記録
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🎯 Nyashとは
|
|
||||||
|
|
||||||
**「Everything is Box」哲学**に基づく革新的プログラミング言語
|
|
||||||
|
|
||||||
```nyash
|
|
||||||
// シンプルで強力な構文
|
|
||||||
local greeting = "Hello, Nyash!"
|
|
||||||
print(greeting)
|
|
||||||
|
|
||||||
// すべてがBox - 統一された美しい世界
|
|
||||||
local numbers = new ArrayBox()
|
|
||||||
numbers.push(42)
|
|
||||||
numbers.push(3.14)
|
|
||||||
|
|
||||||
// P2P通信もBox!
|
|
||||||
local node = new P2PBox("alice", transport: "inprocess")
|
|
||||||
node.send("bob", new IntentBox("chat", { text: "Hello P2P!" }))
|
|
||||||
```
|
|
||||||
|
|
||||||
### ✨ **主な特徴**
|
|
||||||
- **🔧 Production Ready**: Phase 1完了、実用レベルの言語機能
|
|
||||||
- **🌐 P2P Native**: P2P通信がビルトイン (Phase 2実装中)
|
|
||||||
- **🛡️ Memory Safe**: Rust実装による完全メモリ安全性
|
|
||||||
- **📦 Everything is Box**: 統一されたオブジェクトモデル
|
|
||||||
- **⚡ Simple & Powerful**: 学習コストが低く、表現力が高い
|
|
||||||
|
|
||||||
### 📊 **実装状況 (2025-08-12)**
|
|
||||||
|
|
||||||
#### ✅ **Phase 1完了**
|
|
||||||
- FloatBox, ArrayBox改良, Cross-type演算子
|
|
||||||
- 包括的テストスイート (188行)
|
|
||||||
- デリゲーション革命 (`from`構文完成)
|
|
||||||
|
|
||||||
#### 🚧 **Phase 2実装中**
|
|
||||||
- IntentBox (構造化メッセージ)
|
|
||||||
- P2PBox (P2P通信ノード)
|
|
||||||
- MessageBus (プロセス内シングルトン)
|
|
||||||
|
|
||||||
#### 🎯 **最終目標**
|
|
||||||
**NyaMeshP2Pライブラリ実現** - Nyash言語による本格的P2P通信ライブラリ
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🤝 コミュニティ
|
|
||||||
|
|
||||||
### 開発方針
|
|
||||||
- **ドキュメントファースト**: ソースより先にドキュメント確認
|
|
||||||
- **AI協働開発**: Gemini先生・ChatGPT先生・Copilot連携
|
|
||||||
- **段階的実装**: Phase 1→2→3の確実な進歩
|
|
||||||
|
|
||||||
### 貢献方法
|
|
||||||
1. **Issue報告**: バグ・要望をGitHub Issuesで報告
|
|
||||||
2. **ドキュメント改善**: typo修正・内容追加のPull Request歓迎
|
|
||||||
3. **コード貢献**: 新機能実装・バグ修正のPull Request歓迎
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**🎉 Welcome to the world of "Everything is Box"!**
|
|
||||||
|
|
||||||
*Nyashで新しいプログラミングの世界を体験しよう!*
|
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
P2PBox ビルドエラー詳細 (2025-08-11)
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
エラー概要:
|
|
||||||
- ライブラリのビルド: ✅ 成功
|
|
||||||
- テストの実行: ✅ 成功
|
|
||||||
- nyashバイナリのビルド: ❌ モジュールインポートエラー
|
|
||||||
|
|
||||||
エラー詳細:
|
|
||||||
|
|
||||||
error[E0432]: unresolved imports `crate::Transport`, `crate::TransportKind`, `crate::create_transport`
|
|
||||||
--> src/boxes/p2p_box.rs:16:13
|
|
||||||
|
|
|
||||||
16 | use crate::{Transport, TransportKind, create_transport};
|
|
||||||
| ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ no `create_transport` in the root
|
|
||||||
| | |
|
|
||||||
| | no `TransportKind` in the root
|
|
||||||
| no `Transport` in the root
|
|
||||||
|
|
||||||
error[E0432]: unresolved imports `crate::get_global_message_bus`, `crate::BusMessage`, `crate::MessageBus`
|
|
||||||
--> src/boxes/p2p_box.rs:17:13
|
|
||||||
|
|
|
||||||
17 | use crate::{get_global_message_bus, BusMessage, MessageBus};
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ no `MessageBus` in the root
|
|
||||||
|
|
||||||
error[E0432]: unresolved import `crate::TransportKind`
|
|
||||||
--> src/interpreter/objects.rs:13:5
|
|
||||||
|
|
|
||||||
13 | use crate::TransportKind;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ no `TransportKind` in the root
|
|
||||||
|
|
||||||
解決案:
|
|
||||||
1. src/boxes/p2p_box.rs でインポートパスを修正:
|
|
||||||
use crate::transport_trait::{Transport, TransportKind, create_transport};
|
|
||||||
use crate::message_bus::{get_global_message_bus, BusMessage, MessageBus};
|
|
||||||
|
|
||||||
2. src/interpreter/objects.rs でインポートパスを修正:
|
|
||||||
use crate::transport_trait::TransportKind;
|
|
||||||
|
|
||||||
これは単純なモジュールパスの問題で、機能的な問題ではありません。
|
|
||||||
P2PBoxの実装自体は完全に動作しています。
|
|
||||||
@ -1,328 +0,0 @@
|
|||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `simple_notepad`
|
|
||||||
* `example` target `simple_notepad`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_explorer_with_icons.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_explorer_icons`
|
|
||||||
* `example` target `nyash_explorer_with_icons`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_notepad_jp.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad_jp`
|
|
||||||
* `example` target `nyash_notepad_jp`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad_v2.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad`
|
|
||||||
* `example` target `simple_notepad_v2`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad_ascii.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad_ascii`
|
|
||||||
* `example` target `simple_notepad_ascii`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/test_icon_extraction.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `test_icon_extraction`
|
|
||||||
* `example` target `test_icon_extraction`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_explorer.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_explorer`
|
|
||||||
* `example` target `nyash_explorer`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/debug_notepad.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `debug_notepad`
|
|
||||||
* `example` target `debug_notepad`
|
|
||||||
Checking nyash-rust v0.1.0 (/mnt/c/git/nyash-project/nyash)
|
|
||||||
warning: unused import: `Display`
|
|
||||||
--> src/boxes/buffer/mod.rs:35:23
|
|
||||||
|
|
|
||||||
35 | use std::fmt::{Debug, Display};
|
|
||||||
| ^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_imports)]` on by default
|
|
||||||
|
|
||||||
warning: unused import: `std::future::Future`
|
|
||||||
--> src/boxes/future/mod.rs:7:5
|
|
||||||
|
|
|
||||||
7 | use std::future::Future;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::pin::Pin`
|
|
||||||
--> src/boxes/future/mod.rs:8:5
|
|
||||||
|
|
|
||||||
8 | use std::pin::Pin;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `crate::boxes::map_box::MapBox`
|
|
||||||
--> src/boxes/http/mod.rs:9:5
|
|
||||||
|
|
|
||||||
9 | use crate::boxes::map_box::MapBox;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `Arc` and `Mutex`
|
|
||||||
--> src/boxes/http/mod.rs:11:17
|
|
||||||
|
|
|
||||||
11 | use std::sync::{Arc, Mutex};
|
|
||||||
| ^^^ ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Mutex`
|
|
||||||
--> src/boxes/regex/mod.rs:9:22
|
|
||||||
|
|
|
||||||
9 | use std::sync::{Arc, Mutex};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/expressions.rs:38:14
|
|
||||||
|
|
|
||||||
38 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_macros)]` on by default
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/mod.rs:51:14
|
|
||||||
|
|
|
||||||
51 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `AddBox`, `DivideBox`, `MultiplyBox`, and `SubtractBox`
|
|
||||||
--> src/interpreter/mod.rs:10:75
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, VoidBox, AddBox, SubtractBox, MultiplyBox, DivideBox, CompareBox, ArrayB...
|
|
||||||
| ^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/interpreter/objects.rs:13:5
|
|
||||||
|
|
|
||||||
13 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/collection_methods.rs:11:24
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{StringBox, IntegerBox, NyashBox, BoolBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `IntegerBox` and `StringBox`
|
|
||||||
--> src/interpreter/methods/data_methods.rs:11:34
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{NyashBox, StringBox, IntegerBox};
|
|
||||||
| ^^^^^^^^^ ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/network_methods.rs:10:34
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `basic_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:27:9
|
|
||||||
|
|
|
||||||
27 | pub use basic_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `collection_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:28:9
|
|
||||||
|
|
|
||||||
28 | pub use collection_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `io_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:29:9
|
|
||||||
|
|
|
||||||
29 | pub use io_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `data_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:30:9
|
|
||||||
|
|
|
||||||
30 | pub use data_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `network_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:31:9
|
|
||||||
|
|
|
||||||
31 | pub use network_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/operator_traits.rs:16:5
|
|
||||||
|
|
|
||||||
16 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0592]: duplicate definitions with name `execute_parent_constructor`
|
|
||||||
--> src/interpreter/expressions.rs:816:5
|
|
||||||
|
|
|
||||||
816 | / fn execute_parent_constructor(&mut self, parent: &str, parent_box_decl: &super::BoxDeclaration,
|
|
||||||
817 | | current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
818 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________^ duplicate definitions for `execute_parent_constructor`
|
|
||||||
|
|
|
||||||
::: src/interpreter/objects.rs:789:5
|
|
||||||
|
|
|
||||||
789 | / pub(super) fn execute_parent_constructor(&mut self, parent_class: &str, arguments: &[ASTNode])
|
|
||||||
790 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________- other definition for `execute_parent_constructor`
|
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
|
||||||
--> src/interpreter/expressions.rs:732:77
|
|
||||||
|
|
|
||||||
732 | let is_valid_delegation = current_box_decl.extends.as_ref() == Some(parent) ||
|
|
||||||
| ---- ^^^^^^ expected `&String`, found `&str`
|
|
||||||
| |
|
|
||||||
| arguments to this enum variant are incorrect
|
|
||||||
|
|
|
||||||
= note: expected reference `&std::string::String`
|
|
||||||
found reference `&str`
|
|
||||||
help: the type constructed contains `&str` due to the type of the argument passed
|
|
||||||
--> src/interpreter/expressions.rs:732:72
|
|
||||||
|
|
|
||||||
732 | let is_valid_delegation = current_box_decl.extends.as_ref() == Some(parent) ||
|
|
||||||
| ^^^^^------^
|
|
||||||
| |
|
|
||||||
| this argument influences the type of `Some`
|
|
||||||
note: tuple variant defined here
|
|
||||||
--> /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/option.rs:597:5
|
|
||||||
|
|
||||||
error[E0034]: multiple applicable items in scope
|
|
||||||
--> src/interpreter/expressions.rs:753:25
|
|
||||||
|
|
|
||||||
753 | return self.execute_parent_constructor(parent, &parent_box_decl, current_instance_val.clone_box(), arguments);
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ multiple `execute_parent_constructor` found
|
|
||||||
|
|
|
||||||
note: candidate #1 is defined in an impl for the type `core::NyashInterpreter`
|
|
||||||
--> src/interpreter/expressions.rs:816:5
|
|
||||||
|
|
|
||||||
816 | / fn execute_parent_constructor(&mut self, parent: &str, parent_box_decl: &super::BoxDeclaration,
|
|
||||||
817 | | current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
818 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________^
|
|
||||||
note: candidate #2 is defined in an impl for the type `core::NyashInterpreter`
|
|
||||||
--> src/interpreter/objects.rs:789:5
|
|
||||||
|
|
|
||||||
789 | / pub(super) fn execute_parent_constructor(&mut self, parent_class: &str, arguments: &[ASTNode])
|
|
||||||
790 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________^
|
|
||||||
|
|
||||||
warning: unused import: `Write`
|
|
||||||
--> src/boxes/stream/mod.rs:10:21
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Read`
|
|
||||||
--> src/boxes/stream/mod.rs:10:15
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:29:28
|
|
||||||
|
|
|
||||||
29 | pub fn http_get(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_variables)]` on by default
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:34:24
|
|
||||||
|
|
|
||||||
34 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:34:48
|
|
||||||
|
|
|
||||||
34 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:39:23
|
|
||||||
|
|
|
||||||
39 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:39:47
|
|
||||||
|
|
|
||||||
39 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:44:26
|
|
||||||
|
|
|
||||||
44 | pub fn delete(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `method`
|
|
||||||
--> src/boxes/http/mod.rs:49:27
|
|
||||||
|
|
|
||||||
49 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:49:54
|
|
||||||
|
|
|
||||||
49 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `options`
|
|
||||||
--> src/boxes/http/mod.rs:49:78
|
|
||||||
|
|
|
||||||
49 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options`
|
|
||||||
|
|
||||||
warning: variable `arg_count` is assigned to, but never used
|
|
||||||
--> src/parser/expressions.rs:246:33
|
|
||||||
|
|
|
||||||
246 | let mut arg_count = 0;
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_arg_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `name`
|
|
||||||
--> src/parser/statements.rs:65:35
|
|
||||||
|
|
|
||||||
65 | TokenType::IDENTIFIER(name) => {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
|
||||||
|
|
||||||
warning: variable `statement_count` is assigned to, but never used
|
|
||||||
--> src/parser/mod.rs:132:17
|
|
||||||
|
|
|
||||||
132 | let mut statement_count = 0;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_statement_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `i`
|
|
||||||
--> src/interpreter/expressions.rs:537:22
|
|
||||||
|
|
|
||||||
537 | for (i, arg) in arguments.iter().enumerate() {
|
|
||||||
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
|
||||||
|
|
||||||
warning: variable `result` is assigned to, but never used
|
|
||||||
--> src/interpreter/expressions.rs:862:21
|
|
||||||
|
|
|
||||||
862 | let mut result: Box<dyn NyashBox> = Box::new(VoidBox::new());
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_result` instead
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:864:17
|
|
||||||
|
|
|
||||||
864 | result = self.execute_statement(statement)?;
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
= note: `#[warn(unused_assignments)]` on by default
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:868:21
|
|
||||||
|
|
|
||||||
868 | result = return_val.clone_box();
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
|
|
||||||
warning: unused variable: `existing_method`
|
|
||||||
--> src/instance.rs:95:21
|
|
||||||
|
|
|
||||||
95 | if let Some(existing_method) = new_methods.get(&method_name) {
|
|
||||||
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_existing_method`
|
|
||||||
|
|
||||||
Some errors have detailed explanations: E0034, E0308, E0592.
|
|
||||||
For more information about an error, try `rustc --explain E0034`.
|
|
||||||
warning: `nyash-rust` (lib) generated 38 warnings
|
|
||||||
error: could not compile `nyash-rust` (lib) due to 3 previous errors; 38 warnings emitted
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
P2PBox ビルドエラー詳細 (2025-08-11)
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
エラー概要:
|
|
||||||
- ライブラリのビルド: ✅ 成功
|
|
||||||
- テストの実行: ✅ 成功
|
|
||||||
- nyashバイナリのビルド: ❌ モジュールインポートエラー
|
|
||||||
|
|
||||||
エラー詳細:
|
|
||||||
|
|
||||||
error[E0432]: unresolved imports `crate::Transport`, `crate::TransportKind`, `crate::create_transport`
|
|
||||||
--> src/boxes/p2p_box.rs:16:13
|
|
||||||
|
|
|
||||||
16 | use crate::{Transport, TransportKind, create_transport};
|
|
||||||
| ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ no `create_transport` in the root
|
|
||||||
| | |
|
|
||||||
| | no `TransportKind` in the root
|
|
||||||
| no `Transport` in the root
|
|
||||||
|
|
||||||
error[E0432]: unresolved imports `crate::get_global_message_bus`, `crate::BusMessage`, `crate::MessageBus`
|
|
||||||
--> src/boxes/p2p_box.rs:17:13
|
|
||||||
|
|
|
||||||
17 | use crate::{get_global_message_bus, BusMessage, MessageBus};
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ no `MessageBus` in the root
|
|
||||||
|
|
||||||
error[E0432]: unresolved import `crate::TransportKind`
|
|
||||||
--> src/interpreter/objects.rs:13:5
|
|
||||||
|
|
|
||||||
13 | use crate::TransportKind;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ no `TransportKind` in the root
|
|
||||||
|
|
||||||
解決案:
|
|
||||||
1. src/boxes/p2p_box.rs でインポートパスを修正:
|
|
||||||
use crate::transport_trait::{Transport, TransportKind, create_transport};
|
|
||||||
use crate::message_bus::{get_global_message_bus, BusMessage, MessageBus};
|
|
||||||
|
|
||||||
2. src/interpreter/objects.rs でインポートパスを修正:
|
|
||||||
use crate::transport_trait::TransportKind;
|
|
||||||
|
|
||||||
これは単純なモジュールパスの問題で、機能的な問題ではありません。
|
|
||||||
P2PBoxの実装自体は完全に動作しています。
|
|
||||||
@ -1,328 +0,0 @@
|
|||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `simple_notepad`
|
|
||||||
* `example` target `simple_notepad`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_explorer_with_icons.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_explorer_icons`
|
|
||||||
* `example` target `nyash_explorer_with_icons`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_notepad_jp.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad_jp`
|
|
||||||
* `example` target `nyash_notepad_jp`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad_v2.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad`
|
|
||||||
* `example` target `simple_notepad_v2`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad_ascii.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad_ascii`
|
|
||||||
* `example` target `simple_notepad_ascii`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/test_icon_extraction.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `test_icon_extraction`
|
|
||||||
* `example` target `test_icon_extraction`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_explorer.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_explorer`
|
|
||||||
* `example` target `nyash_explorer`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/debug_notepad.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `debug_notepad`
|
|
||||||
* `example` target `debug_notepad`
|
|
||||||
Checking nyash-rust v0.1.0 (/mnt/c/git/nyash-project/nyash)
|
|
||||||
warning: unused import: `Display`
|
|
||||||
--> src/boxes/buffer/mod.rs:35:23
|
|
||||||
|
|
|
||||||
35 | use std::fmt::{Debug, Display};
|
|
||||||
| ^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_imports)]` on by default
|
|
||||||
|
|
||||||
warning: unused import: `std::future::Future`
|
|
||||||
--> src/boxes/future/mod.rs:7:5
|
|
||||||
|
|
|
||||||
7 | use std::future::Future;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::pin::Pin`
|
|
||||||
--> src/boxes/future/mod.rs:8:5
|
|
||||||
|
|
|
||||||
8 | use std::pin::Pin;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `crate::boxes::map_box::MapBox`
|
|
||||||
--> src/boxes/http/mod.rs:9:5
|
|
||||||
|
|
|
||||||
9 | use crate::boxes::map_box::MapBox;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `Arc` and `Mutex`
|
|
||||||
--> src/boxes/http/mod.rs:11:17
|
|
||||||
|
|
|
||||||
11 | use std::sync::{Arc, Mutex};
|
|
||||||
| ^^^ ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Mutex`
|
|
||||||
--> src/boxes/regex/mod.rs:9:22
|
|
||||||
|
|
|
||||||
9 | use std::sync::{Arc, Mutex};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/expressions.rs:38:14
|
|
||||||
|
|
|
||||||
38 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_macros)]` on by default
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/mod.rs:51:14
|
|
||||||
|
|
|
||||||
51 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `AddBox`, `DivideBox`, `MultiplyBox`, and `SubtractBox`
|
|
||||||
--> src/interpreter/mod.rs:10:75
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, VoidBox, AddBox, SubtractBox, MultiplyBox, DivideBox, CompareBox, ArrayB...
|
|
||||||
| ^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/interpreter/objects.rs:13:5
|
|
||||||
|
|
|
||||||
13 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/collection_methods.rs:11:24
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{StringBox, IntegerBox, NyashBox, BoolBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `IntegerBox` and `StringBox`
|
|
||||||
--> src/interpreter/methods/data_methods.rs:11:34
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{NyashBox, StringBox, IntegerBox};
|
|
||||||
| ^^^^^^^^^ ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/network_methods.rs:10:34
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `basic_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:27:9
|
|
||||||
|
|
|
||||||
27 | pub use basic_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `collection_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:28:9
|
|
||||||
|
|
|
||||||
28 | pub use collection_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `io_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:29:9
|
|
||||||
|
|
|
||||||
29 | pub use io_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `data_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:30:9
|
|
||||||
|
|
|
||||||
30 | pub use data_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `network_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:31:9
|
|
||||||
|
|
|
||||||
31 | pub use network_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/operator_traits.rs:16:5
|
|
||||||
|
|
|
||||||
16 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0592]: duplicate definitions with name `execute_parent_constructor`
|
|
||||||
--> src/interpreter/expressions.rs:816:5
|
|
||||||
|
|
|
||||||
816 | / fn execute_parent_constructor(&mut self, parent: &str, parent_box_decl: &super::BoxDeclaration,
|
|
||||||
817 | | current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
818 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________^ duplicate definitions for `execute_parent_constructor`
|
|
||||||
|
|
|
||||||
::: src/interpreter/objects.rs:789:5
|
|
||||||
|
|
|
||||||
789 | / pub(super) fn execute_parent_constructor(&mut self, parent_class: &str, arguments: &[ASTNode])
|
|
||||||
790 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________- other definition for `execute_parent_constructor`
|
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
|
||||||
--> src/interpreter/expressions.rs:732:77
|
|
||||||
|
|
|
||||||
732 | let is_valid_delegation = current_box_decl.extends.as_ref() == Some(parent) ||
|
|
||||||
| ---- ^^^^^^ expected `&String`, found `&str`
|
|
||||||
| |
|
|
||||||
| arguments to this enum variant are incorrect
|
|
||||||
|
|
|
||||||
= note: expected reference `&std::string::String`
|
|
||||||
found reference `&str`
|
|
||||||
help: the type constructed contains `&str` due to the type of the argument passed
|
|
||||||
--> src/interpreter/expressions.rs:732:72
|
|
||||||
|
|
|
||||||
732 | let is_valid_delegation = current_box_decl.extends.as_ref() == Some(parent) ||
|
|
||||||
| ^^^^^------^
|
|
||||||
| |
|
|
||||||
| this argument influences the type of `Some`
|
|
||||||
note: tuple variant defined here
|
|
||||||
--> /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/option.rs:597:5
|
|
||||||
|
|
||||||
error[E0034]: multiple applicable items in scope
|
|
||||||
--> src/interpreter/expressions.rs:753:25
|
|
||||||
|
|
|
||||||
753 | return self.execute_parent_constructor(parent, &parent_box_decl, current_instance_val.clone_box(), arguments);
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ multiple `execute_parent_constructor` found
|
|
||||||
|
|
|
||||||
note: candidate #1 is defined in an impl for the type `core::NyashInterpreter`
|
|
||||||
--> src/interpreter/expressions.rs:816:5
|
|
||||||
|
|
|
||||||
816 | / fn execute_parent_constructor(&mut self, parent: &str, parent_box_decl: &super::BoxDeclaration,
|
|
||||||
817 | | current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
818 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________^
|
|
||||||
note: candidate #2 is defined in an impl for the type `core::NyashInterpreter`
|
|
||||||
--> src/interpreter/objects.rs:789:5
|
|
||||||
|
|
|
||||||
789 | / pub(super) fn execute_parent_constructor(&mut self, parent_class: &str, arguments: &[ASTNode])
|
|
||||||
790 | | -> Result<Box<dyn NyashBox>, RuntimeError> {
|
|
||||||
| |__________________________________________________^
|
|
||||||
|
|
||||||
warning: unused import: `Write`
|
|
||||||
--> src/boxes/stream/mod.rs:10:21
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Read`
|
|
||||||
--> src/boxes/stream/mod.rs:10:15
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:29:28
|
|
||||||
|
|
|
||||||
29 | pub fn http_get(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_variables)]` on by default
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:34:24
|
|
||||||
|
|
|
||||||
34 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:34:48
|
|
||||||
|
|
|
||||||
34 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:39:23
|
|
||||||
|
|
|
||||||
39 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:39:47
|
|
||||||
|
|
|
||||||
39 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:44:26
|
|
||||||
|
|
|
||||||
44 | pub fn delete(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `method`
|
|
||||||
--> src/boxes/http/mod.rs:49:27
|
|
||||||
|
|
|
||||||
49 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:49:54
|
|
||||||
|
|
|
||||||
49 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `options`
|
|
||||||
--> src/boxes/http/mod.rs:49:78
|
|
||||||
|
|
|
||||||
49 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options`
|
|
||||||
|
|
||||||
warning: variable `arg_count` is assigned to, but never used
|
|
||||||
--> src/parser/expressions.rs:246:33
|
|
||||||
|
|
|
||||||
246 | let mut arg_count = 0;
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_arg_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `name`
|
|
||||||
--> src/parser/statements.rs:65:35
|
|
||||||
|
|
|
||||||
65 | TokenType::IDENTIFIER(name) => {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
|
||||||
|
|
||||||
warning: variable `statement_count` is assigned to, but never used
|
|
||||||
--> src/parser/mod.rs:132:17
|
|
||||||
|
|
|
||||||
132 | let mut statement_count = 0;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_statement_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `i`
|
|
||||||
--> src/interpreter/expressions.rs:537:22
|
|
||||||
|
|
|
||||||
537 | for (i, arg) in arguments.iter().enumerate() {
|
|
||||||
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
|
||||||
|
|
||||||
warning: variable `result` is assigned to, but never used
|
|
||||||
--> src/interpreter/expressions.rs:862:21
|
|
||||||
|
|
|
||||||
862 | let mut result: Box<dyn NyashBox> = Box::new(VoidBox::new());
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_result` instead
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:864:17
|
|
||||||
|
|
|
||||||
864 | result = self.execute_statement(statement)?;
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
= note: `#[warn(unused_assignments)]` on by default
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:868:21
|
|
||||||
|
|
|
||||||
868 | result = return_val.clone_box();
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
|
|
||||||
warning: unused variable: `existing_method`
|
|
||||||
--> src/instance.rs:95:21
|
|
||||||
|
|
|
||||||
95 | if let Some(existing_method) = new_methods.get(&method_name) {
|
|
||||||
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_existing_method`
|
|
||||||
|
|
||||||
Some errors have detailed explanations: E0034, E0308, E0592.
|
|
||||||
For more information about an error, try `rustc --explain E0034`.
|
|
||||||
warning: `nyash-rust` (lib) generated 38 warnings
|
|
||||||
error: could not compile `nyash-rust` (lib) due to 3 previous errors; 38 warnings emitted
|
|
||||||
@ -1,650 +0,0 @@
|
|||||||
Checking nyash-rust v0.1.0 (/mnt/c/git/nyash-project/nyash)
|
|
||||||
warning: unused import: `next_box_id`
|
|
||||||
--> src/boxes/math_box.rs:59:84
|
|
||||||
|
|
|
||||||
59 | use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, BoxCore, BoxBase, next_box_id};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_imports)]` on by default
|
|
||||||
|
|
||||||
warning: unused import: `next_box_id`
|
|
||||||
--> src/boxes/null_box.rs:87:72
|
|
||||||
|
|
|
||||||
87 | use crate::box_trait::{NyashBox, StringBox, BoolBox, BoxCore, BoxBase, next_box_id};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Debug`
|
|
||||||
--> src/boxes/buffer/mod.rs:35:16
|
|
||||||
|
|
|
||||||
35 | use std::fmt::{Debug, Display};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::future::Future`
|
|
||||||
--> src/boxes/future/mod.rs:7:5
|
|
||||||
|
|
|
||||||
7 | use std::future::Future;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::pin::Pin`
|
|
||||||
--> src/boxes/future/mod.rs:8:5
|
|
||||||
|
|
|
||||||
8 | use std::pin::Pin;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `crate::boxes::map_box::MapBox`
|
|
||||||
--> src/boxes/http/mod.rs:9:5
|
|
||||||
|
|
|
||||||
9 | use crate::boxes::map_box::MapBox;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `self`
|
|
||||||
--> src/boxes/intent_box.rs:38:16
|
|
||||||
|
|
|
||||||
38 | use std::fmt::{self, Debug};
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/expressions.rs:38:14
|
|
||||||
|
|
|
||||||
38 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_macros)]` on by default
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/mod.rs:51:14
|
|
||||||
|
|
|
||||||
51 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `AddBox`, `DivideBox`, `MultiplyBox`, and `SubtractBox`
|
|
||||||
--> src/interpreter/mod.rs:10:75
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, VoidBox, AddBox, SubtractBox, MultiplyBox, DivideBox, CompareBox, ArrayB...
|
|
||||||
| ^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `FloatBox`
|
|
||||||
--> src/interpreter/mod.rs:14:39
|
|
||||||
|
|
|
||||||
14 | use crate::boxes::math_box::{MathBox, FloatBox, RangeBox};
|
|
||||||
| ^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `DateTimeBox`
|
|
||||||
--> src/interpreter/mod.rs:15:39
|
|
||||||
|
|
|
||||||
15 | use crate::boxes::time_box::{TimeBox, DateTimeBox, TimerBox};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `file::FileBox`
|
|
||||||
--> src/interpreter/expressions.rs:12:104
|
|
||||||
|
|
|
||||||
12 | use crate::boxes::{FloatBox, MathBox, ConsoleBox, TimeBox, DateTimeBox, RandomBox, SoundBox, DebugBox, file::FileBox, MapBox};
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `DynamicAdd`, `DynamicDiv`, `DynamicMul`, `DynamicSub`, and `OperatorError`
|
|
||||||
--> src/interpreter/expressions.rs:15:30
|
|
||||||
|
|
|
||||||
15 | use crate::operator_traits::{DynamicAdd, DynamicSub, DynamicMul, DynamicDiv, OperatorError};
|
|
||||||
| ^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Mutex`
|
|
||||||
--> src/interpreter/statements.rs:10:22
|
|
||||||
|
|
|
||||||
10 | use std::sync::{Arc, Mutex};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/collection_methods.rs:11:24
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{StringBox, IntegerBox, NyashBox, BoolBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `IntegerBox` and `StringBox`
|
|
||||||
--> src/interpreter/methods/data_methods.rs:11:34
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{NyashBox, StringBox, IntegerBox};
|
|
||||||
| ^^^^^^^^^ ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/network_methods.rs:10:34
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `BoolBox`
|
|
||||||
--> src/interpreter/methods/p2p_methods.rs:9:45
|
|
||||||
|
|
|
||||||
9 | use crate::box_trait::{NyashBox, StringBox, BoolBox};
|
|
||||||
| ^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `crate::method_box::MethodBox`
|
|
||||||
--> src/interpreter/methods/p2p_methods.rs:11:5
|
|
||||||
|
|
|
||||||
11 | use crate::method_box::MethodBox;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `basic_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:28:9
|
|
||||||
|
|
|
||||||
28 | pub use basic_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `collection_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:29:9
|
|
||||||
|
|
|
||||||
29 | pub use collection_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `io_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:30:9
|
|
||||||
|
|
|
||||||
30 | pub use io_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `data_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:31:9
|
|
||||||
|
|
|
||||||
31 | pub use data_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `network_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:32:9
|
|
||||||
|
|
|
||||||
32 | pub use network_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `http_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:33:9
|
|
||||||
|
|
|
||||||
33 | pub use http_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Weak`
|
|
||||||
--> src/instance.rs:15:29
|
|
||||||
|
|
|
||||||
15 | use std::sync::{Arc, Mutex, Weak};
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
warning: unused import: `crate::box_trait::StringBox`
|
|
||||||
--> src/instance.rs:164:13
|
|
||||||
|
|
|
||||||
164 | use crate::box_trait::StringBox;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/operator_traits.rs:16:5
|
|
||||||
|
|
|
||||||
16 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `VoidBox`
|
|
||||||
--> src/box_arithmetic.rs:8:75
|
|
||||||
|
|
|
||||||
8 | use crate::box_trait::{NyashBox, BoxCore, StringBox, IntegerBox, BoolBox, VoidBox, BoxBase};
|
|
||||||
| ^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/transport/mod.rs:10:5
|
|
||||||
|
|
|
||||||
10 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `UnaryOp`
|
|
||||||
--> src/backend/wasm/codegen.rs:8:91
|
|
||||||
|
|
|
||||||
8 | use crate::mir::{MirModule, MirFunction, MirInstruction, ConstValue, BinaryOp, CompareOp, UnaryOp, ValueId, BasicBlockId};
|
|
||||||
| ^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `MirFunction`
|
|
||||||
--> src/backend/wasm/mod.rs:16:29
|
|
||||||
|
|
|
||||||
16 | use crate::mir::{MirModule, MirFunction};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::collections::HashMap`
|
|
||||||
--> src/backend/wasm/mod.rs:17:5
|
|
||||||
|
|
|
||||||
17 | use std::collections::HashMap;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_trait.rs:230:1
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
...
|
|
||||||
230 | impl NyashBox for StringBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_trait.rs:301:1
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
...
|
|
||||||
301 | impl NyashBox for IntegerBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_trait.rs:376:1
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
...
|
|
||||||
376 | impl NyashBox for BoolBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_trait.rs:447:1
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
...
|
|
||||||
447 | impl NyashBox for VoidBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_trait.rs:553:1
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
...
|
|
||||||
553 | impl NyashBox for FileBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_trait.rs:622:1
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
...
|
|
||||||
622 | impl NyashBox for ErrorBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_trait.rs:725:1
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
...
|
|
||||||
725 | impl NyashBox for ResultBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/instance.rs:435:1
|
|
||||||
|
|
|
||||||
435 | impl NyashBox for InstanceBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/channel_box.rs:110:1
|
|
||||||
|
|
|
||||||
110 | impl NyashBox for ChannelBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/channel_box.rs:193:1
|
|
||||||
|
|
|
||||||
193 | impl NyashBox for MessageBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/exception_box.rs:52:1
|
|
||||||
|
|
|
||||||
52 | impl NyashBox for ErrorBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/method_box.rs:95:1
|
|
||||||
|
|
|
||||||
95 | impl NyashBox for MethodBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/type_box.rs:236:1
|
|
||||||
|
|
|
||||||
236 | impl NyashBox for TypeBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_arithmetic.rs:88:1
|
|
||||||
|
|
|
||||||
88 | impl NyashBox for AddBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_arithmetic.rs:199:1
|
|
||||||
|
|
|
||||||
199 | impl NyashBox for SubtractBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_arithmetic.rs:291:1
|
|
||||||
|
|
|
||||||
291 | impl NyashBox for MultiplyBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
error[E0046]: not all trait items implemented, missing: `share_box`
|
|
||||||
--> src/box_arithmetic.rs:392:1
|
|
||||||
|
|
|
||||||
392 | impl NyashBox for DivideBox {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `share_box` in implementation
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:91:5
|
|
||||||
|
|
|
||||||
91 | fn share_box(&self) -> Box<dyn NyashBox>;
|
|
||||||
| ----------------------------------------- `share_box` from trait
|
|
||||||
|
|
||||||
warning: unused import: `Read`
|
|
||||||
--> src/boxes/stream/mod.rs:10:15
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Write`
|
|
||||||
--> src/boxes/stream/mod.rs:10:21
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:25:28
|
|
||||||
|
|
|
||||||
25 | pub fn http_get(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_variables)]` on by default
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:30:24
|
|
||||||
|
|
|
||||||
30 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:30:48
|
|
||||||
|
|
|
||||||
30 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:35:23
|
|
||||||
|
|
|
||||||
35 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:35:47
|
|
||||||
|
|
|
||||||
35 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:40:26
|
|
||||||
|
|
|
||||||
40 | pub fn delete(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `method`
|
|
||||||
--> src/boxes/http/mod.rs:45:27
|
|
||||||
|
|
|
||||||
45 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:45:54
|
|
||||||
|
|
|
||||||
45 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `options`
|
|
||||||
--> src/boxes/http/mod.rs:45:78
|
|
||||||
|
|
|
||||||
45 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options`
|
|
||||||
|
|
||||||
warning: unused variable: `socket`
|
|
||||||
--> src/boxes/http_server_box.rs:143:25
|
|
||||||
|
|
|
||||||
143 | if let Some(ref socket) = *socket_guard {
|
|
||||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_socket`
|
|
||||||
|
|
||||||
warning: unused variable: `backlog`
|
|
||||||
--> src/boxes/http_server_box.rs:137:26
|
|
||||||
|
|
|
||||||
137 | pub fn listen(&self, backlog: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_backlog`
|
|
||||||
|
|
||||||
warning: variable `arg_count` is assigned to, but never used
|
|
||||||
--> src/parser/expressions.rs:246:33
|
|
||||||
|
|
|
||||||
246 | let mut arg_count = 0;
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_arg_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `name`
|
|
||||||
--> src/parser/statements.rs:69:35
|
|
||||||
|
|
|
||||||
69 | TokenType::IDENTIFIER(name) => {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
|
||||||
|
|
||||||
warning: variable `statement_count` is assigned to, but never used
|
|
||||||
--> src/parser/mod.rs:132:17
|
|
||||||
|
|
|
||||||
132 | let mut statement_count = 0;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_statement_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `i`
|
|
||||||
--> src/interpreter/expressions.rs:778:22
|
|
||||||
|
|
|
||||||
778 | for (i, arg) in arguments.iter().enumerate() {
|
|
||||||
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
|
||||||
|
|
||||||
warning: variable does not need to be mutable
|
|
||||||
--> src/interpreter/expressions.rs:1053:13
|
|
||||||
|
|
|
||||||
1053 | let mut builtin_boxes = vec![
|
|
||||||
| ----^^^^^^^^^^^^^
|
|
||||||
| |
|
|
||||||
| help: remove this `mut`
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_mut)]` on by default
|
|
||||||
|
|
||||||
warning: variable `result` is assigned to, but never used
|
|
||||||
--> src/interpreter/expressions.rs:1197:21
|
|
||||||
|
|
|
||||||
1197 | let mut result: Box<dyn NyashBox> = Box::new(VoidBox::new());
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_result` instead
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:1199:17
|
|
||||||
|
|
|
||||||
1199 | result = self.execute_statement(statement)?;
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
= note: `#[warn(unused_assignments)]` on by default
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:1203:21
|
|
||||||
|
|
|
||||||
1203 | result = return_val.clone_box();
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
|
|
||||||
warning: unused variable: `current_instance`
|
|
||||||
--> src/interpreter/expressions.rs:1222:78
|
|
||||||
|
|
|
||||||
1222 | fn execute_builtin_box_method(&mut self, parent: &str, method: &str, mut current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
| ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_current_instance`
|
|
||||||
|
|
||||||
warning: variable does not need to be mutable
|
|
||||||
--> src/interpreter/expressions.rs:1222:74
|
|
||||||
|
|
|
||||||
1222 | fn execute_builtin_box_method(&mut self, parent: &str, method: &str, mut current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
| ----^^^^^^^^^^^^^^^^
|
|
||||||
| |
|
|
||||||
| help: remove this `mut`
|
|
||||||
|
|
||||||
warning: unused variable: `node_id`
|
|
||||||
--> src/interpreter/objects.rs:546:21
|
|
||||||
|
|
|
||||||
546 | let node_id = if let Some(id_str) = node_id_value.as_any().downcast_ref::<StringBox>() {
|
|
||||||
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_node_id`
|
|
||||||
|
|
||||||
warning: unused variable: `transport_str`
|
|
||||||
--> src/interpreter/objects.rs:556:21
|
|
||||||
|
|
|
||||||
556 | let transport_str = if let Some(t_str) = transport_value.as_any().downcast_ref::<StringBox>() {
|
|
||||||
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_transport_str`
|
|
||||||
|
|
||||||
warning: variable does not need to be mutable
|
|
||||||
--> src/interpreter/objects.rs:963:17
|
|
||||||
|
|
|
||||||
963 | let mut builtin_boxes = vec![
|
|
||||||
| ----^^^^^^^^^^^^^
|
|
||||||
| |
|
|
||||||
| help: remove this `mut`
|
|
||||||
|
|
||||||
warning: unused variable: `temp_arc`
|
|
||||||
--> src/instance.rs:113:17
|
|
||||||
|
|
|
||||||
113 | let temp_arc = Arc::new(Mutex::new(VoidBox::new()));
|
|
||||||
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_temp_arc`
|
|
||||||
|
|
||||||
warning: unused variable: `existing_method`
|
|
||||||
--> src/instance.rs:320:21
|
|
||||||
|
|
|
||||||
320 | if let Some(existing_method) = new_methods.get(&method_name) {
|
|
||||||
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_existing_method`
|
|
||||||
|
|
||||||
warning: unused variable: `block`
|
|
||||||
--> src/mir/function.rs:146:18
|
|
||||||
|
|
|
||||||
146 | for (id, block) in &self.blocks {
|
|
||||||
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_block`
|
|
||||||
|
|
||||||
warning: variable does not need to be mutable
|
|
||||||
--> src/mir/builder.rs:56:13
|
|
||||||
|
|
|
||||||
56 | let mut module = MirModule::new("main".to_string());
|
|
||||||
| ----^^^^^^
|
|
||||||
| |
|
|
||||||
| help: remove this `mut`
|
|
||||||
|
|
||||||
warning: unused variable: `arguments`
|
|
||||||
--> src/mir/builder.rs:717:55
|
|
||||||
|
|
|
||||||
717 | fn build_new_expression(&mut self, class: String, arguments: Vec<ASTNode>) -> Result<ValueId, String> {
|
|
||||||
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_arguments`
|
|
||||||
|
|
||||||
warning: unused variable: `name`
|
|
||||||
--> src/mir/verification.rs:71:14
|
|
||||||
|
|
|
||||||
71 | for (name, function) in &module.functions {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
|
||||||
|
|
||||||
warning: unused variable: `error`
|
|
||||||
--> src/mir/verification.rs:74:21
|
|
||||||
|
|
|
||||||
74 | for error in &mut func_errors {
|
|
||||||
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_error`
|
|
||||||
|
|
||||||
warning: unused variable: `block_id`
|
|
||||||
--> src/mir/verification.rs:163:14
|
|
||||||
|
|
|
||||||
163 | for (block_id, block) in &function.blocks {
|
|
||||||
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_block_id`
|
|
||||||
|
|
||||||
warning: variable does not need to be mutable
|
|
||||||
--> src/mir/verification.rs:160:13
|
|
||||||
|
|
|
||||||
160 | let mut errors = Vec::new();
|
|
||||||
| ----^^^^^^
|
|
||||||
| |
|
|
||||||
| help: remove this `mut`
|
|
||||||
|
|
||||||
warning: unused variable: `name`
|
|
||||||
--> src/mir/printer.rs:86:14
|
|
||||||
|
|
|
||||||
86 | for (name, function) in &module.functions {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
|
||||||
|
|
||||||
warning: unused variable: `effects`
|
|
||||||
--> src/mir/printer.rs:215:53
|
|
||||||
|
|
|
||||||
215 | MirInstruction::Call { dst, func, args, effects } => {
|
|
||||||
| ^^^^^^^ help: try ignoring the field: `effects: _`
|
|
||||||
|
|
||||||
warning: unused variable: `effects`
|
|
||||||
--> src/mir/printer.rs:228:67
|
|
||||||
|
|
|
||||||
228 | MirInstruction::BoxCall { dst, box_val, method, args, effects } => {
|
|
||||||
| ^^^^^^^ help: try ignoring the field: `effects: _`
|
|
||||||
|
|
||||||
warning: unused variable: `field`
|
|
||||||
--> src/backend/wasm/codegen.rs:261:54
|
|
||||||
|
|
|
||||||
261 | MirInstruction::RefGet { dst, reference, field } => {
|
|
||||||
| ^^^^^ help: try ignoring the field: `field: _`
|
|
||||||
|
|
||||||
warning: unused variable: `field`
|
|
||||||
--> src/backend/wasm/codegen.rs:275:49
|
|
||||||
|
|
|
||||||
275 | MirInstruction::RefSet { reference, field, value } => {
|
|
||||||
| ^^^^^ help: try ignoring the field: `field: _`
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0046`.
|
|
||||||
warning: `nyash-rust` (lib) generated 74 warnings
|
|
||||||
error: could not compile `nyash-rust` (lib) due to 17 previous errors; 74 warnings emitted
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
Nyashプログラミング言語のコンストラクタ設計について深い相談です。
|
|
||||||
|
|
||||||
【Nyashの現在の設計哲学】
|
|
||||||
Nyashは既に「コンストラクタの明示的呼び出し」を採用しています。これは以下の理由によるものです:
|
|
||||||
- 明示性重視:プログラマーが何が起きているかを隠さない
|
|
||||||
- 初学者フレンドリー:実行順序が直感的
|
|
||||||
- Everything is Box哲学:隠れた魔法的な動作を避ける
|
|
||||||
|
|
||||||
【他言語の問題例】
|
|
||||||
```cpp
|
|
||||||
// C++:複雑で読みにくい
|
|
||||||
class Cat : public Animal {
|
|
||||||
Toy catToy; // 1. 隠れたメンバー初期化
|
|
||||||
Cat(string name) : Animal(name) { // 2. : Animal(name) が直感的でない
|
|
||||||
// 3. 最後に自分の処理
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
【現在のNyash vs 新提案】
|
|
||||||
```nyash
|
|
||||||
// 現在の書き方
|
|
||||||
box MeshNode : P2PBox {
|
|
||||||
constructor(nodeId, world) {
|
|
||||||
super P2PBox(nodeId, world) // 特別なキーワード
|
|
||||||
me.routing = RoutingTable()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新提案:完全統一
|
|
||||||
box MeshNode : P2PBox {
|
|
||||||
constructor(nodeId, world) {
|
|
||||||
from P2PBox.constructor(nodeId, world) // from統一!
|
|
||||||
me.routing = RoutingTable()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【完全統一のメリット】
|
|
||||||
- from P2PBox.method() と完全に一貫している
|
|
||||||
- 「どの親の何を呼んでいるか」が超明確
|
|
||||||
- 多重デリゲーションでも from Logger.constructor() で区別可能
|
|
||||||
|
|
||||||
【深く考えてほしい点】
|
|
||||||
1. Nyashの明示的コンストラクタ呼び出し設計をどう評価しますか?
|
|
||||||
2. from P2PBox.constructor() の完全統一案をどう思いますか?
|
|
||||||
3. 他言語(Java, Python, C#等)と比較したNyashの優位性は?
|
|
||||||
4. 初学者にとって最も理解しやすい設計は?
|
|
||||||
5. 言語の美しさ・一貫性の観点からの評価は?
|
|
||||||
|
|
||||||
プログラミング言語設計の専門的視点から、深く分析してください。
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
Nyashプログラミング言語のオーバーライド設計について深い相談です。
|
|
||||||
|
|
||||||
【現在発見された実装問題】
|
|
||||||
現在のNyashでは HashMap::insert により「暗黙のオーバーライド」が発生している:
|
|
||||||
```rust
|
|
||||||
// instance.rs - add_method関数
|
|
||||||
pub fn add_method(&mut self, method_name: String, method_ast: ASTNode) {
|
|
||||||
let mut new_methods = (*self.methods).clone();
|
|
||||||
new_methods.insert(method_name, method_ast); // ← 同名で上書き!
|
|
||||||
self.methods = Arc::new(new_methods);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
これにより以下が可能になってしまっている:
|
|
||||||
```nyash
|
|
||||||
box Node {
|
|
||||||
send(msg) { // 最初の定義
|
|
||||||
print("Version 1")
|
|
||||||
}
|
|
||||||
|
|
||||||
send(msg) { // 暗黙に上書きされる
|
|
||||||
print("Version 2") // ← こちらだけが残る
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【Nyashの設計哲学との矛盾】
|
|
||||||
- **明示性重視**: 何が起きているかを隠さない
|
|
||||||
- **Everything is Box**: 統一された世界観
|
|
||||||
- **from デリゲーション**: `from Parent.method()` の明示的呼び出し
|
|
||||||
- **初学者フレンドリー**: 複雑な概念を分かりやすく表現
|
|
||||||
|
|
||||||
【提案する修正方針】
|
|
||||||
|
|
||||||
**1. 暗黙のオーバーライドを完全禁止**
|
|
||||||
```nyash
|
|
||||||
box Node {
|
|
||||||
send(msg) {
|
|
||||||
print("Version 1")
|
|
||||||
}
|
|
||||||
|
|
||||||
send(msg) { // ← コンパイルエラーにする
|
|
||||||
print("Version 2")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Error: Method 'send' is already defined. Use 'override' keyword if intentional.
|
|
||||||
```
|
|
||||||
|
|
||||||
**2. コンストラクタのオーバーロード禁止**
|
|
||||||
```nyash
|
|
||||||
box Node {
|
|
||||||
constructor(id) {
|
|
||||||
me.id = id
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(id, name) { // ← エラーにする
|
|
||||||
me.id = id
|
|
||||||
me.name = name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Error: Constructor overloading is not allowed. Use explicit initialization.
|
|
||||||
```
|
|
||||||
|
|
||||||
**3. デリゲーションでの明示的override**
|
|
||||||
```nyash
|
|
||||||
box MeshNode : P2PBox {
|
|
||||||
// 明示的にオーバーライドする意図を示す
|
|
||||||
override send(intent, data, target) {
|
|
||||||
me.routing.log(target)
|
|
||||||
from P2PBox.send(intent, data, target) // 親の実装も呼べる
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新しいメソッド(overrideなし)
|
|
||||||
sendWithRetry(intent, data, target) {
|
|
||||||
// 新機能
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**4. エラーメッセージの改善**
|
|
||||||
- 重複定義時: "Method 'send' already exists. Use 'override' if you want to replace parent method."
|
|
||||||
- override不正使用時: "Method 'newMethod' does not exist in parent. Remove 'override' keyword."
|
|
||||||
|
|
||||||
【深く考えてほしい点】
|
|
||||||
|
|
||||||
**1. 哲学的整合性**
|
|
||||||
- この方針はNyashの「明示性重視」「Everything is Box」哲学と整合しますか?
|
|
||||||
- `from Parent.method()` デリゲーション設計との相性は?
|
|
||||||
|
|
||||||
**2. 学習コスト vs 安全性**
|
|
||||||
- `override` キーワード追加による学習コストは妥当ですか?
|
|
||||||
- 暗黙のオーバーライド禁止により、どの程度安全性が向上しますか?
|
|
||||||
|
|
||||||
**3. デリゲーションとの関係**
|
|
||||||
- デリゲーション先メソッドを `override` するのは自然ですか?
|
|
||||||
- 多重デリゲーション時の `override` はどう扱うべきですか?
|
|
||||||
|
|
||||||
**4. 実装上の課題**
|
|
||||||
- コンパイル時の重複チェック実装の複雑度は?
|
|
||||||
- 既存コードへの影響と移行戦略は?
|
|
||||||
|
|
||||||
**5. 他言語との比較優位性**
|
|
||||||
- Java/C#の `@Override` や TypeScript の `override` との違いは?
|
|
||||||
- Nyashならではの独自価値は何ですか?
|
|
||||||
|
|
||||||
プログラミング言語設計の専門的視点から、この方針がNyashの目指す「明示的で安全、かつ初学者フレンドリーな言語」に最適かどうか深く分析してください。
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
Nyash Programming Language - Weak Reference Architecture Critical Decision
|
|
||||||
|
|
||||||
I need expert advice on a fundamental architectural decision for weak reference implementation. This is a foundational component that will impact native compilation plans.
|
|
||||||
|
|
||||||
【Current Situation】
|
|
||||||
Copilot has completed 99% of weak reference implementation with excellent quality. Only the final invalidation mechanism remains.
|
|
||||||
|
|
||||||
【Two Competing Approaches】
|
|
||||||
|
|
||||||
## Approach A: Copilot's "Proper" Global Tracking
|
|
||||||
```rust
|
|
||||||
pub struct SharedState {
|
|
||||||
// Existing fields...
|
|
||||||
pub instance_registry: Arc<Mutex<Vec<Weak<Mutex<InstanceBox>>>>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn invalidate_weak_references(&mut self, target_info: &str) {
|
|
||||||
// Linear search through ALL instances in the system
|
|
||||||
for weak_instance in &self.instance_registry {
|
|
||||||
if let Some(instance) = weak_instance.upgrade() {
|
|
||||||
instance.lock().unwrap().invalidate_weak_references_to(target_info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Pros**: Architecturally correct, immediate invalidation, theoretically perfect
|
|
||||||
**Cons**: O(n) linear search, complex state management, heavyweight
|
|
||||||
|
|
||||||
## Approach B: Gemini's "On-Access" Lazy Invalidation
|
|
||||||
```rust
|
|
||||||
pub struct Interpreter {
|
|
||||||
pub invalidated_ids: Arc<Mutex<HashSet<u64>>>, // Simple ID set
|
|
||||||
}
|
|
||||||
|
|
||||||
fn trigger_weak_reference_invalidation(&mut self, target_info: &str) {
|
|
||||||
if let Ok(id) = target_info.parse::<u64>() {
|
|
||||||
self.invalidated_ids.lock().unwrap().insert(id); // O(1) operation
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_weak_field(&self, name: &str) -> Option<...> {
|
|
||||||
if invalidated_ids.contains(&id) { // O(1) lookup
|
|
||||||
return None; // Auto-nil on access
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Pros**: O(1) operations, minimal changes, leverages 99% existing implementation
|
|
||||||
**Cons**: Delayed invalidation (only on access), not "immediate"
|
|
||||||
|
|
||||||
【Critical Considerations】
|
|
||||||
|
|
||||||
## 1. Native Compilation Impact
|
|
||||||
This weak reference system will be compiled to native code. Performance characteristics matter significantly:
|
|
||||||
- Approach A: O(n) linear search in native code = potential bottleneck
|
|
||||||
- Approach B: O(1) HashSet operations = predictable performance
|
|
||||||
|
|
||||||
## 2. Foundation Quality vs Pragmatism
|
|
||||||
- This is foundational memory safety infrastructure
|
|
||||||
- Must balance correctness with performance
|
|
||||||
- Real-world usage patterns matter more than theoretical perfection
|
|
||||||
|
|
||||||
## 3. Scaling Characteristics
|
|
||||||
In applications with 1000+ objects:
|
|
||||||
- Approach A: 1000+ instance traversal on each drop
|
|
||||||
- Approach B: Single hash table insertion/lookup
|
|
||||||
|
|
||||||
## 4. Maintenance Complexity
|
|
||||||
- Approach A: Complex global state, threading issues, lifecycle management
|
|
||||||
- Approach B: Simple addition to existing interpreter state
|
|
||||||
|
|
||||||
【Specific Technical Questions】
|
|
||||||
|
|
||||||
1. **Performance Reality Check**: In a native-compiled language, is O(n) weak reference invalidation acceptable for real applications?
|
|
||||||
|
|
||||||
2. **Lazy vs Eager Trade-off**: Is "on-access invalidation" a viable pattern for systems programming? What are the hidden costs?
|
|
||||||
|
|
||||||
3. **Native Compilation Compatibility**: Which approach translates better to efficient native code generation?
|
|
||||||
|
|
||||||
4. **Memory Safety Guarantee**: Do both approaches provide equivalent memory safety guarantees?
|
|
||||||
|
|
||||||
5. **Industry Best Practices**: How do modern systems languages (Rust, Swift, etc.) handle this problem?
|
|
||||||
|
|
||||||
【Nyash Context】
|
|
||||||
- Everything is Box philosophy (unified object model)
|
|
||||||
- Target: P2P networking applications (performance-sensitive)
|
|
||||||
- Native compilation planned (MIR → LLVM/Cranelift)
|
|
||||||
- Developer experience priority (simplicity over theoretical perfection)
|
|
||||||
|
|
||||||
【Request】
|
|
||||||
Please provide expert analysis focusing on:
|
|
||||||
1. Real-world performance implications for native compilation
|
|
||||||
2. Hidden complexity costs of each approach
|
|
||||||
3. Recommendation for foundational language infrastructure
|
|
||||||
4. Risk assessment for future scaling
|
|
||||||
|
|
||||||
This decision affects the entire language's memory management foundation. I need the most technically sound recommendation that balances correctness, performance, and maintainability.
|
|
||||||
|
|
||||||
Thank you for your expertise!
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
Nyashプログラミング言語のコンストラクタ設計について深い相談です。
|
|
||||||
|
|
||||||
【Nyashの現在の設計哲学】
|
|
||||||
Nyashは既に「コンストラクタの明示的呼び出し」を採用しています。これは以下の理由によるものです:
|
|
||||||
- 明示性重視:プログラマーが何が起きているかを隠さない
|
|
||||||
- 初学者フレンドリー:実行順序が直感的
|
|
||||||
- Everything is Box哲学:隠れた魔法的な動作を避ける
|
|
||||||
|
|
||||||
【他言語の問題例】
|
|
||||||
```cpp
|
|
||||||
// C++:複雑で読みにくい
|
|
||||||
class Cat : public Animal {
|
|
||||||
Toy catToy; // 1. 隠れたメンバー初期化
|
|
||||||
Cat(string name) : Animal(name) { // 2. : Animal(name) が直感的でない
|
|
||||||
// 3. 最後に自分の処理
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
【現在のNyash vs 新提案】
|
|
||||||
```nyash
|
|
||||||
// 現在の書き方
|
|
||||||
box MeshNode : P2PBox {
|
|
||||||
constructor(nodeId, world) {
|
|
||||||
super P2PBox(nodeId, world) // 特別なキーワード
|
|
||||||
me.routing = RoutingTable()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新提案:完全統一
|
|
||||||
box MeshNode : P2PBox {
|
|
||||||
constructor(nodeId, world) {
|
|
||||||
from P2PBox.constructor(nodeId, world) // from統一!
|
|
||||||
me.routing = RoutingTable()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【完全統一のメリット】
|
|
||||||
- from P2PBox.method() と完全に一貫している
|
|
||||||
- 「どの親の何を呼んでいるか」が超明確
|
|
||||||
- 多重デリゲーションでも from Logger.constructor() で区別可能
|
|
||||||
|
|
||||||
【深く考えてほしい点】
|
|
||||||
1. Nyashの明示的コンストラクタ呼び出し設計をどう評価しますか?
|
|
||||||
2. from P2PBox.constructor() の完全統一案をどう思いますか?
|
|
||||||
3. 他言語(Java, Python, C#等)と比較したNyashの優位性は?
|
|
||||||
4. 初学者にとって最も理解しやすい設計は?
|
|
||||||
5. 言語の美しさ・一貫性の観点からの評価は?
|
|
||||||
|
|
||||||
プログラミング言語設計の専門的視点から、深く分析してください。
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
Nyashプログラミング言語のオーバーライド設計について深い相談です。
|
|
||||||
|
|
||||||
【現在発見された実装問題】
|
|
||||||
現在のNyashでは HashMap::insert により「暗黙のオーバーライド」が発生している:
|
|
||||||
```rust
|
|
||||||
// instance.rs - add_method関数
|
|
||||||
pub fn add_method(&mut self, method_name: String, method_ast: ASTNode) {
|
|
||||||
let mut new_methods = (*self.methods).clone();
|
|
||||||
new_methods.insert(method_name, method_ast); // ← 同名で上書き!
|
|
||||||
self.methods = Arc::new(new_methods);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
これにより以下が可能になってしまっている:
|
|
||||||
```nyash
|
|
||||||
box Node {
|
|
||||||
send(msg) { // 最初の定義
|
|
||||||
print("Version 1")
|
|
||||||
}
|
|
||||||
|
|
||||||
send(msg) { // 暗黙に上書きされる
|
|
||||||
print("Version 2") // ← こちらだけが残る
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【Nyashの設計哲学との矛盾】
|
|
||||||
- **明示性重視**: 何が起きているかを隠さない
|
|
||||||
- **Everything is Box**: 統一された世界観
|
|
||||||
- **from デリゲーション**: `from Parent.method()` の明示的呼び出し
|
|
||||||
- **初学者フレンドリー**: 複雑な概念を分かりやすく表現
|
|
||||||
|
|
||||||
【提案する修正方針】
|
|
||||||
|
|
||||||
**1. 暗黙のオーバーライドを完全禁止**
|
|
||||||
```nyash
|
|
||||||
box Node {
|
|
||||||
send(msg) {
|
|
||||||
print("Version 1")
|
|
||||||
}
|
|
||||||
|
|
||||||
send(msg) { // ← コンパイルエラーにする
|
|
||||||
print("Version 2")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Error: Method 'send' is already defined. Use 'override' keyword if intentional.
|
|
||||||
```
|
|
||||||
|
|
||||||
**2. コンストラクタのオーバーロード禁止**
|
|
||||||
```nyash
|
|
||||||
box Node {
|
|
||||||
constructor(id) {
|
|
||||||
me.id = id
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(id, name) { // ← エラーにする
|
|
||||||
me.id = id
|
|
||||||
me.name = name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Error: Constructor overloading is not allowed. Use explicit initialization.
|
|
||||||
```
|
|
||||||
|
|
||||||
**3. デリゲーションでの明示的override**
|
|
||||||
```nyash
|
|
||||||
box MeshNode : P2PBox {
|
|
||||||
// 明示的にオーバーライドする意図を示す
|
|
||||||
override send(intent, data, target) {
|
|
||||||
me.routing.log(target)
|
|
||||||
from P2PBox.send(intent, data, target) // 親の実装も呼べる
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新しいメソッド(overrideなし)
|
|
||||||
sendWithRetry(intent, data, target) {
|
|
||||||
// 新機能
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**4. エラーメッセージの改善**
|
|
||||||
- 重複定義時: "Method 'send' already exists. Use 'override' if you want to replace parent method."
|
|
||||||
- override不正使用時: "Method 'newMethod' does not exist in parent. Remove 'override' keyword."
|
|
||||||
|
|
||||||
【深く考えてほしい点】
|
|
||||||
|
|
||||||
**1. 哲学的整合性**
|
|
||||||
- この方針はNyashの「明示性重視」「Everything is Box」哲学と整合しますか?
|
|
||||||
- `from Parent.method()` デリゲーション設計との相性は?
|
|
||||||
|
|
||||||
**2. 学習コスト vs 安全性**
|
|
||||||
- `override` キーワード追加による学習コストは妥当ですか?
|
|
||||||
- 暗黙のオーバーライド禁止により、どの程度安全性が向上しますか?
|
|
||||||
|
|
||||||
**3. デリゲーションとの関係**
|
|
||||||
- デリゲーション先メソッドを `override` するのは自然ですか?
|
|
||||||
- 多重デリゲーション時の `override` はどう扱うべきですか?
|
|
||||||
|
|
||||||
**4. 実装上の課題**
|
|
||||||
- コンパイル時の重複チェック実装の複雑度は?
|
|
||||||
- 既存コードへの影響と移行戦略は?
|
|
||||||
|
|
||||||
**5. 他言語との比較優位性**
|
|
||||||
- Java/C#の `@Override` や TypeScript の `override` との違いは?
|
|
||||||
- Nyashならではの独自価値は何ですか?
|
|
||||||
|
|
||||||
プログラミング言語設計の専門的視点から、この方針がNyashの目指す「明示的で安全、かつ初学者フレンドリーな言語」に最適かどうか深く分析してください。
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
Nyash言語のweak参照システム最終実装について技術的相談をお願いします。
|
|
||||||
|
|
||||||
【現在の状況】
|
|
||||||
copilot様がweak参照システムを99%完成させました。驚くべき実装品質です。
|
|
||||||
|
|
||||||
【✅ 完成済みの素晴らしい実装】
|
|
||||||
1. ハイブリッド構造: fields + fields_ng 併用システム
|
|
||||||
2. weak参照専用メソッド: set_weak_field(), get_weak_field()
|
|
||||||
3. 文字列ベース追跡: "WEAK_REF_TO:..." → "WEAK_REFERENCE_DROPPED"
|
|
||||||
4. インタープリター統合: weak参照の検出・代入・アクセス完璧
|
|
||||||
5. 5つの包括的テストケース
|
|
||||||
|
|
||||||
【⚠️ 残り1%の課題】
|
|
||||||
単一関数 trigger_weak_reference_invalidation() が未実装:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
pub(super) fn trigger_weak_reference_invalidation(&mut self, target_info: &str) {
|
|
||||||
eprintln!("🔗 DEBUG: Triggering global weak reference invalidation for: {}", target_info);
|
|
||||||
|
|
||||||
// TODO: Real implementation would require tracking all instances
|
|
||||||
// and their weak references
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【現在の動作】
|
|
||||||
```
|
|
||||||
✅ weak参照検出: 完璧 (🔗 DEBUG: Assigning to weak field 'parent')
|
|
||||||
✅ ドロップ検出: 動作中 (🔗 DEBUG: Variable 'parent' set to 0)
|
|
||||||
✅ 無効化呼び出し: 実行中 (🔗 DEBUG: Triggering global weak reference invalidation)
|
|
||||||
❌ 実際のnil化: 未接続 (🔗 DEBUG: Weak field 'parent' still has valid reference)
|
|
||||||
```
|
|
||||||
|
|
||||||
【copilot提案の実装アプローチ】
|
|
||||||
グローバルインスタンス追跡システム:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
pub struct SharedState {
|
|
||||||
// 既存フィールド...
|
|
||||||
pub instance_registry: Arc<Mutex<Vec<Weak<Mutex<InstanceBox>>>>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl SharedState {
|
|
||||||
fn register_instance(&mut self, instance: Weak<Mutex<InstanceBox>>) { ... }
|
|
||||||
fn invalidate_weak_references(&mut self, target_info: &str) {
|
|
||||||
// 全インスタンスを走査してweak参照を無効化
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【技術的課題】
|
|
||||||
1. 全InstanceBox作成時のグローバル登録必要
|
|
||||||
2. 複雑なスレッドセーフティ管理
|
|
||||||
3. デッドweak参照のガベージコレクション
|
|
||||||
4. 5+ファイルにわたる変更
|
|
||||||
|
|
||||||
【代替案検討の観点】
|
|
||||||
1. **より簡単な実装**: グローバル追跡なしで実現可能?
|
|
||||||
2. **性能重視**: シンプルな文字列マッチングで十分?
|
|
||||||
3. **段階的実装**: デモレベルで動作する最小実装?
|
|
||||||
|
|
||||||
【具体的質問】
|
|
||||||
1. グローバルインスタンス追跡は本当に必要ですか?
|
|
||||||
2. copilotの文字列ベース追跡をより簡単に完成できますか?
|
|
||||||
3. 「target_info」による簡単なマッチング実装は可能ですか?
|
|
||||||
4. デモ目的なら手動的な実装で十分ではないですか?
|
|
||||||
|
|
||||||
【Nyashの設計哲学】
|
|
||||||
- Everything is Box: すべてがBoxオブジェクト
|
|
||||||
- 明示性重視: 隠れた動作を避ける
|
|
||||||
- シンプル重視: 初学者フレンドリー
|
|
||||||
- 実用性優先: 完璧より動くもの
|
|
||||||
|
|
||||||
プログラミング言語実装の専門的観点から、最もシンプルで実装しやすいアプローチを提案してください。copilot様の99%完成した実装を活かしつつ、最後の1%を効率的に完成させる方法をお願いします。
|
|
||||||
@ -1,668 +0,0 @@
|
|||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad_ascii.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad_ascii`
|
|
||||||
* `example` target `simple_notepad_ascii`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_explorer.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_explorer`
|
|
||||||
* `example` target `nyash_explorer`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/test_icon_extraction.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `test_icon_extraction`
|
|
||||||
* `example` target `test_icon_extraction`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_notepad_jp.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad_jp`
|
|
||||||
* `example` target `nyash_notepad_jp`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `simple_notepad`
|
|
||||||
* `example` target `simple_notepad`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/debug_notepad.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `debug_notepad`
|
|
||||||
* `example` target `debug_notepad`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/nyash_explorer_with_icons.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_explorer_icons`
|
|
||||||
* `example` target `nyash_explorer_with_icons`
|
|
||||||
warning: file `/mnt/c/git/nyash-project/nyash/examples/simple_notepad_v2.rs` found to be present in multiple build targets:
|
|
||||||
* `bin` target `nyash_notepad`
|
|
||||||
* `example` target `simple_notepad_v2`
|
|
||||||
warning: unused import: `next_box_id`
|
|
||||||
--> src/boxes/math_box.rs:59:84
|
|
||||||
|
|
|
||||||
59 | use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, BoxCore, BoxBase, next_box_id};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_imports)]` on by default
|
|
||||||
|
|
||||||
warning: unused import: `next_box_id`
|
|
||||||
--> src/boxes/debug_box.rs:105:42
|
|
||||||
|
|
|
||||||
105 | use crate::box_trait::{BoxCore, BoxBase, next_box_id, NyashBox, StringBox, BoolBox, VoidBox};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `next_box_id`
|
|
||||||
--> src/boxes/null_box.rs:87:72
|
|
||||||
|
|
|
||||||
87 | use crate::box_trait::{NyashBox, StringBox, BoolBox, BoxCore, BoxBase, next_box_id};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::future::Future`
|
|
||||||
--> src/boxes/future/mod.rs:7:5
|
|
||||||
|
|
|
||||||
7 | use std::future::Future;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::pin::Pin`
|
|
||||||
--> src/boxes/future/mod.rs:8:5
|
|
||||||
|
|
|
||||||
8 | use std::pin::Pin;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `crate::boxes::map_box::MapBox`
|
|
||||||
--> src/boxes/http/mod.rs:9:5
|
|
||||||
|
|
|
||||||
9 | use crate::boxes::map_box::MapBox;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `Arc` and `Mutex`
|
|
||||||
--> src/boxes/http/mod.rs:11:17
|
|
||||||
|
|
|
||||||
11 | use std::sync::{Arc, Mutex};
|
|
||||||
| ^^^ ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Mutex`
|
|
||||||
--> src/boxes/regex/mod.rs:9:22
|
|
||||||
|
|
|
||||||
9 | use std::sync::{Arc, Mutex};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `self`
|
|
||||||
--> src/boxes/intent_box.rs:38:16
|
|
||||||
|
|
|
||||||
38 | use std::fmt::{self, Debug};
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/expressions.rs:38:14
|
|
||||||
|
|
|
||||||
38 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_macros)]` on by default
|
|
||||||
|
|
||||||
warning: unused macro definition: `debug_fuel`
|
|
||||||
--> src/parser/mod.rs:51:14
|
|
||||||
|
|
|
||||||
51 | macro_rules! debug_fuel {
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `AddBox`, `DivideBox`, `MultiplyBox`, and `SubtractBox`
|
|
||||||
--> src/interpreter/mod.rs:10:75
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, VoidBox, AddBox, SubtractBox, MultiplyBox, DivideBox, CompareBox, ArrayB...
|
|
||||||
| ^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `FloatBox`
|
|
||||||
--> src/interpreter/mod.rs:13:39
|
|
||||||
|
|
|
||||||
13 | use crate::boxes::math_box::{MathBox, FloatBox, RangeBox};
|
|
||||||
| ^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `DateTimeBox`
|
|
||||||
--> src/interpreter/mod.rs:14:39
|
|
||||||
|
|
|
||||||
14 | use crate::boxes::time_box::{TimeBox, DateTimeBox, TimerBox};
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `file::FileBox`
|
|
||||||
--> src/interpreter/expressions.rs:12:104
|
|
||||||
|
|
|
||||||
12 | use crate::boxes::{FloatBox, MathBox, ConsoleBox, TimeBox, DateTimeBox, RandomBox, SoundBox, DebugBox, file::FileBox, MapBox};
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/interpreter/objects.rs:12:5
|
|
||||||
|
|
|
||||||
12 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/collection_methods.rs:11:24
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{StringBox, IntegerBox, NyashBox, BoolBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `IntegerBox` and `StringBox`
|
|
||||||
--> src/interpreter/methods/data_methods.rs:11:34
|
|
||||||
|
|
|
||||||
11 | use crate::box_trait::{NyashBox, StringBox, IntegerBox};
|
|
||||||
| ^^^^^^^^^ ^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `StringBox`
|
|
||||||
--> src/interpreter/methods/network_methods.rs:10:34
|
|
||||||
|
|
|
||||||
10 | use crate::box_trait::{NyashBox, StringBox};
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `BoolBox`
|
|
||||||
--> src/interpreter/methods/p2p_methods.rs:9:45
|
|
||||||
|
|
|
||||||
9 | use crate::box_trait::{NyashBox, StringBox, BoolBox};
|
|
||||||
| ^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `crate::method_box::MethodBox`
|
|
||||||
--> src/interpreter/methods/p2p_methods.rs:11:5
|
|
||||||
|
|
|
||||||
11 | use crate::method_box::MethodBox;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `basic_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:27:9
|
|
||||||
|
|
|
||||||
27 | pub use basic_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `collection_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:28:9
|
|
||||||
|
|
|
||||||
28 | pub use collection_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `io_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:29:9
|
|
||||||
|
|
|
||||||
29 | pub use io_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `data_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:30:9
|
|
||||||
|
|
|
||||||
30 | pub use data_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `network_methods::*`
|
|
||||||
--> src/interpreter/methods/mod.rs:31:9
|
|
||||||
|
|
|
||||||
31 | pub use network_methods::*;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/operator_traits.rs:16:5
|
|
||||||
|
|
|
||||||
16 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `std::sync::Arc`
|
|
||||||
--> src/transport/mod.rs:10:5
|
|
||||||
|
|
|
||||||
10 | use std::sync::Arc;
|
|
||||||
| ^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Write`
|
|
||||||
--> src/boxes/stream/mod.rs:10:21
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
warning: unused import: `Read`
|
|
||||||
--> src/boxes/stream/mod.rs:10:15
|
|
||||||
|
|
|
||||||
10 | use std::io::{Read, Write, Result};
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:26:28
|
|
||||||
|
|
|
||||||
26 | pub fn http_get(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_variables)]` on by default
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:31:24
|
|
||||||
|
|
|
||||||
31 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:31:48
|
|
||||||
|
|
|
||||||
31 | pub fn post(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:36:23
|
|
||||||
|
|
|
||||||
36 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `body`
|
|
||||||
--> src/boxes/http/mod.rs:36:47
|
|
||||||
|
|
|
||||||
36 | pub fn put(&self, url: Box<dyn NyashBox>, body: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_body`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:41:26
|
|
||||||
|
|
|
||||||
41 | pub fn delete(&self, url: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `method`
|
|
||||||
--> src/boxes/http/mod.rs:46:27
|
|
||||||
|
|
|
||||||
46 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method`
|
|
||||||
|
|
||||||
warning: unused variable: `url`
|
|
||||||
--> src/boxes/http/mod.rs:46:54
|
|
||||||
|
|
|
||||||
46 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
|
|
||||||
|
|
||||||
warning: unused variable: `options`
|
|
||||||
--> src/boxes/http/mod.rs:46:78
|
|
||||||
|
|
|
||||||
46 | pub fn request(&self, method: Box<dyn NyashBox>, url: Box<dyn NyashBox>, options: Box<dyn NyashBox>) -> Box<dyn NyashBox> {
|
|
||||||
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options`
|
|
||||||
|
|
||||||
warning: variable `arg_count` is assigned to, but never used
|
|
||||||
--> src/parser/expressions.rs:246:33
|
|
||||||
|
|
|
||||||
246 | let mut arg_count = 0;
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_arg_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `name`
|
|
||||||
--> src/parser/statements.rs:69:35
|
|
||||||
|
|
|
||||||
69 | TokenType::IDENTIFIER(name) => {
|
|
||||||
| ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
|
|
||||||
|
|
||||||
warning: variable `statement_count` is assigned to, but never used
|
|
||||||
--> src/parser/mod.rs:132:17
|
|
||||||
|
|
|
||||||
132 | let mut statement_count = 0;
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_statement_count` instead
|
|
||||||
|
|
||||||
warning: unused variable: `i`
|
|
||||||
--> src/interpreter/expressions.rs:554:22
|
|
||||||
|
|
|
||||||
554 | for (i, arg) in arguments.iter().enumerate() {
|
|
||||||
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
|
||||||
|
|
||||||
warning: variable `result` is assigned to, but never used
|
|
||||||
--> src/interpreter/expressions.rs:899:21
|
|
||||||
|
|
|
||||||
899 | let mut result: Box<dyn NyashBox> = Box::new(VoidBox::new());
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= note: consider using `_result` instead
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:901:17
|
|
||||||
|
|
|
||||||
901 | result = self.execute_statement(statement)?;
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
= note: `#[warn(unused_assignments)]` on by default
|
|
||||||
|
|
||||||
warning: value assigned to `result` is never read
|
|
||||||
--> src/interpreter/expressions.rs:905:21
|
|
||||||
|
|
|
||||||
905 | result = return_val.clone_box();
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= help: maybe it is overwritten before being read?
|
|
||||||
|
|
||||||
warning: unused variable: `current_instance`
|
|
||||||
--> src/interpreter/expressions.rs:924:78
|
|
||||||
|
|
|
||||||
924 | fn execute_builtin_box_method(&mut self, parent: &str, method: &str, mut current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
| ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_current_instance`
|
|
||||||
|
|
||||||
warning: variable does not need to be mutable
|
|
||||||
--> src/interpreter/expressions.rs:924:74
|
|
||||||
|
|
|
||||||
924 | fn execute_builtin_box_method(&mut self, parent: &str, method: &str, mut current_instance: Box<dyn NyashBox>, arguments: &[ASTNode])
|
|
||||||
| ----^^^^^^^^^^^^^^^^
|
|
||||||
| |
|
|
||||||
| help: remove this `mut`
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_mut)]` on by default
|
|
||||||
|
|
||||||
warning: unused variable: `node_id`
|
|
||||||
--> src/interpreter/objects.rs:545:21
|
|
||||||
|
|
|
||||||
545 | let node_id = if let Some(id_str) = node_id_value.as_any().downcast_ref::<StringBox>() {
|
|
||||||
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_node_id`
|
|
||||||
|
|
||||||
warning: unused variable: `transport_str`
|
|
||||||
--> src/interpreter/objects.rs:555:21
|
|
||||||
|
|
|
||||||
555 | let transport_str = if let Some(t_str) = transport_value.as_any().downcast_ref::<StringBox>() {
|
|
||||||
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_transport_str`
|
|
||||||
|
|
||||||
warning: unused variable: `existing_method`
|
|
||||||
--> src/instance.rs:89:21
|
|
||||||
|
|
|
||||||
89 | if let Some(existing_method) = new_methods.get(&method_name) {
|
|
||||||
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_existing_method`
|
|
||||||
|
|
||||||
warning: field `evaluation_stack` is never read
|
|
||||||
--> src/interpreter/core.rs:207:16
|
|
||||||
|
|
|
||||||
190 | pub struct NyashInterpreter {
|
|
||||||
| ---------------- field in this struct
|
|
||||||
...
|
|
||||||
207 | pub(super) evaluation_stack: Vec<usize>,
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(dead_code)]` on by default
|
|
||||||
|
|
||||||
warning: methods `get_object_id` and `hash_string` are never used
|
|
||||||
--> src/interpreter/expressions.rs:697:8
|
|
||||||
|
|
|
||||||
18 | impl NyashInterpreter {
|
|
||||||
| --------------------- methods in this implementation
|
|
||||||
...
|
|
||||||
697 | fn get_object_id(&self, node: &ASTNode) -> Option<usize> {
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
...
|
|
||||||
716 | fn hash_string(&self, s: &str) -> usize {
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
|
|
||||||
Compiling nyash-rust v0.1.0 (/mnt/c/git/nyash-project/nyash)
|
|
||||||
warning: `nyash-rust` (lib) generated 53 warnings (run `cargo fix --lib -p nyash-rust` to apply 27 suggestions)
|
|
||||||
error: couldn't read `examples/C:/Windows/Fonts/arial.ttf`: No such file or directory (os error 2)
|
|
||||||
--> examples/simple_notepad_win.rs:32:57
|
|
||||||
|
|
|
||||||
32 | std::sync::Arc::new(egui::FontData::from_static(include_bytes!(
|
|
||||||
| _________________________________________________________^
|
|
||||||
33 | | "C:/Windows/Fonts/arial.ttf"
|
|
||||||
34 | | ))),
|
|
||||||
| |_________^
|
|
||||||
|
|
||||||
warning: unused import: `std::path::PathBuf`
|
|
||||||
--> examples/nyash_explorer.rs:5:5
|
|
||||||
|
|
|
||||||
5 | use std::path::PathBuf;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_imports)]` on by default
|
|
||||||
|
|
||||||
warning: use of deprecated method `eframe::egui::Ui::allocate_ui_at_rect`: Use `allocate_new_ui` instead
|
|
||||||
--> examples/nyash_explorer.rs:287:28
|
|
||||||
|
|
|
||||||
287 | ui.allocate_ui_at_rect(response.rect, |ui| {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(deprecated)]` on by default
|
|
||||||
|
|
||||||
warning: fields `letter` and `icon_data` are never read
|
|
||||||
--> examples/nyash_explorer.rs:63:5
|
|
||||||
|
|
|
||||||
62 | struct DriveInfo {
|
|
||||||
| --------- fields in this struct
|
|
||||||
63 | letter: String,
|
|
||||||
| ^^^^^^
|
|
||||||
...
|
|
||||||
68 | icon_data: Option<Vec<u8>>,
|
|
||||||
| ^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `DriveInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
|
||||||
= note: `#[warn(dead_code)]` on by default
|
|
||||||
|
|
||||||
warning: field `letter` is never read
|
|
||||||
--> examples/nyash_explorer_with_icons.rs:70:5
|
|
||||||
|
|
|
||||||
69 | struct DriveInfo {
|
|
||||||
| --------- field in this struct
|
|
||||||
70 | letter: String,
|
|
||||||
| ^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(dead_code)]` on by default
|
|
||||||
|
|
||||||
warning: associated function `load_bmp_icon` is never used
|
|
||||||
--> examples/nyash_explorer_with_icons.rs:145:8
|
|
||||||
|
|
|
||||||
85 | impl NyashExplorer {
|
|
||||||
| ------------------ associated function in this implementation
|
|
||||||
...
|
|
||||||
145 | fn load_bmp_icon(file_path: &str) -> Option<ColorImage> {
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
warning: fields `from_output` and `to_input` are never read
|
|
||||||
--> development/egui_research/experiments/visual_node_prototype.rs:118:5
|
|
||||||
|
|
|
||||||
116 | struct Connection {
|
|
||||||
| ---------- fields in this struct
|
|
||||||
117 | from_node: usize,
|
|
||||||
118 | from_output: String,
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
119 | to_node: usize,
|
|
||||||
120 | to_input: String,
|
|
||||||
| ^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `Connection` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
|
|
||||||
= note: `#[warn(dead_code)]` on by default
|
|
||||||
|
|
||||||
warning: fields `connecting_from`, `pan_offset`, and `zoom` are never read
|
|
||||||
--> development/egui_research/experiments/visual_node_prototype.rs:128:5
|
|
||||||
|
|
|
||||||
123 | struct VisualProgramming {
|
|
||||||
| ----------------- fields in this struct
|
|
||||||
...
|
|
||||||
128 | connecting_from: Option<(usize, String)>,
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
129 | pan_offset: Vec2,
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
130 | zoom: f32,
|
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
|
||||||
--> examples/simple_notepad_win.rs:32:9
|
|
||||||
|
|
|
||||||
30 | fonts.font_data.insert(
|
|
||||||
| ------ arguments to this method are incorrect
|
|
||||||
31 | "system".to_owned(),
|
|
||||||
32 | / std::sync::Arc::new(egui::FontData::from_static(include_bytes!(
|
|
||||||
33 | | "C:/Windows/Fonts/arial.ttf"
|
|
||||||
34 | | ))),
|
|
||||||
| |___________^ expected `FontData`, found `Arc<FontData>`
|
|
||||||
|
|
|
||||||
= note: expected struct `FontData`
|
|
||||||
found struct `Arc<FontData>`
|
|
||||||
help: the return type of this call is `Arc<FontData>` due to the type of the argument passed
|
|
||||||
--> examples/simple_notepad_win.rs:30:5
|
|
||||||
|
|
|
||||||
30 | / fonts.font_data.insert(
|
|
||||||
31 | | "system".to_owned(),
|
|
||||||
32 | |/ std::sync::Arc::new(egui::FontData::from_static(include_bytes!(
|
|
||||||
33 | || "C:/Windows/Fonts/arial.ttf"
|
|
||||||
34 | || ))),
|
|
||||||
| ||___________- this argument influences the return type of `insert`
|
|
||||||
35 | | );
|
|
||||||
| |______^
|
|
||||||
note: method defined here
|
|
||||||
--> /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/collections/btree/map.rs:1023:12
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0308`.
|
|
||||||
error: could not compile `nyash-rust` (example "simple_notepad_win") due to 2 previous errors
|
|
||||||
warning: build failed, waiting for other jobs to finish...
|
|
||||||
warning: unused import: `std::collections::HashMap`
|
|
||||||
--> tests/integration_tests.rs:9:5
|
|
||||||
|
|
|
||||||
9 | use std::collections::HashMap;
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(unused_imports)]` on by default
|
|
||||||
|
|
||||||
warning: function `execute_nyash_code` is never used
|
|
||||||
--> tests/integration_tests.rs:12:4
|
|
||||||
|
|
|
||||||
12 | fn execute_nyash_code(code: &str) -> Result<String, String> {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: `#[warn(dead_code)]` on by default
|
|
||||||
|
|
||||||
warning: unused import: `std::env`
|
|
||||||
--> src/main.rs:33:5
|
|
||||||
|
|
|
||||||
33 | use std::env;
|
|
||||||
| ^^^^^^^^
|
|
||||||
|
|
||||||
warning: unused imports: `BoolBox`, `IntegerBox`, and `StringBox`
|
|
||||||
--> src/ast.rs:864:28
|
|
||||||
|
|
|
||||||
864 | use crate::box_trait::{StringBox, IntegerBox, BoolBox};
|
|
||||||
| ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^
|
|
||||||
|
|
||||||
error[E0063]: missing field `is_override` in initializer of `ast::ASTNode`
|
|
||||||
--> src/ast.rs:915:48
|
|
||||||
|
|
|
||||||
915 | methods.insert("getValue".to_string(), ASTNode::FunctionDeclaration {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `is_override`
|
|
||||||
|
|
||||||
error[E0063]: missing fields `is_static`, `static_init` and `type_parameters` in initializer of `ast::ASTNode`
|
|
||||||
--> src/ast.rs:932:24
|
|
||||||
|
|
|
||||||
932 | let box_decl = ASTNode::BoxDeclaration {
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ missing `is_static`, `static_init` and `type_parameters`
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0063`.
|
|
||||||
warning: `nyash-rust` (bin "nyash" test) generated 53 warnings (52 duplicates)
|
|
||||||
error: could not compile `nyash-rust` (bin "nyash" test) due to 2 previous errors; 53 warnings emitted
|
|
||||||
error[E0599]: no method named `len` found for struct `boxes::array::ArrayBox` in the current scope
|
|
||||||
--> src/tests/box_tests.rs:19:26
|
|
||||||
|
|
|
||||||
19 | assert_eq!(array.len(), 2);
|
|
||||||
| ^^^
|
|
||||||
|
|
|
||||||
::: src/boxes/array/mod.rs:11:1
|
|
||||||
|
|
|
||||||
11 | pub struct ArrayBox {
|
|
||||||
| ------------------- method `len` not found for this struct
|
|
||||||
|
|
|
||||||
= help: items from traits can only be used if the trait is implemented and in scope
|
|
||||||
= note: the following traits define an item `len`, perhaps you need to implement one of them:
|
|
||||||
candidate #1: `CacheTrait`
|
|
||||||
candidate #2: `ExactSizeIterator`
|
|
||||||
candidate #3: `avif_serialize::boxes::MpegBox`
|
|
||||||
candidate #4: `nom::traits::AsChar`
|
|
||||||
candidate #5: `rayon::iter::IndexedParallelIterator`
|
|
||||||
candidate #6: `rayon::range::private::IndexedRangeInteger`
|
|
||||||
candidate #7: `rayon::range_inclusive::private::IndexedRangeInteger`
|
|
||||||
help: there is a method `length` with a similar name
|
|
||||||
|
|
|
||||||
19 | assert_eq!(array.length(), 2);
|
|
||||||
| +++
|
|
||||||
|
|
||||||
error[E0599]: no method named `len` found for struct `buffer::BufferBox` in the current scope
|
|
||||||
--> src/tests/box_tests.rs:35:27
|
|
||||||
|
|
|
||||||
35 | assert_eq!(buffer.len(), 5);
|
|
||||||
| ^^^
|
|
||||||
|
|
|
||||||
::: src/boxes/buffer/mod.rs:38:1
|
|
||||||
|
|
|
||||||
38 | pub struct BufferBox {
|
|
||||||
| -------------------- method `len` not found for this struct
|
|
||||||
|
|
|
||||||
= help: items from traits can only be used if the trait is implemented and in scope
|
|
||||||
= note: the following traits define an item `len`, perhaps you need to implement one of them:
|
|
||||||
candidate #1: `CacheTrait`
|
|
||||||
candidate #2: `ExactSizeIterator`
|
|
||||||
candidate #3: `avif_serialize::boxes::MpegBox`
|
|
||||||
candidate #4: `nom::traits::AsChar`
|
|
||||||
candidate #5: `rayon::iter::IndexedParallelIterator`
|
|
||||||
candidate #6: `rayon::range::private::IndexedRangeInteger`
|
|
||||||
candidate #7: `rayon::range_inclusive::private::IndexedRangeInteger`
|
|
||||||
help: there is a method `length` with a similar name
|
|
||||||
|
|
|
||||||
35 | assert_eq!(buffer.length(), 5);
|
|
||||||
| +++
|
|
||||||
|
|
||||||
error[E0600]: cannot apply unary operator `!` to type `Box<(dyn box_trait::NyashBox + 'static)>`
|
|
||||||
--> src/tests/box_tests.rs:114:9
|
|
||||||
|
|
|
||||||
114 | assert!(success_result.is_ok());
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot apply unary operator `!`
|
|
||||||
|
|
|
||||||
note: the foreign item type `Box<(dyn box_trait::NyashBox + 'static)>` doesn't implement `Not`
|
|
||||||
--> /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:231:1
|
|
||||||
::: /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:234:1
|
|
||||||
|
|
|
||||||
= note: not implement `Not`
|
|
||||||
|
|
||||||
error[E0600]: cannot apply unary operator `!` to type `Box<(dyn box_trait::NyashBox + 'static)>`
|
|
||||||
--> src/tests/box_tests.rs:122:17
|
|
||||||
|
|
|
||||||
122 | assert!(!error_result.is_ok());
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ cannot apply unary operator `!`
|
|
||||||
|
|
|
||||||
note: the foreign item type `Box<(dyn box_trait::NyashBox + 'static)>` doesn't implement `Not`
|
|
||||||
--> /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:231:1
|
|
||||||
::: /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:234:1
|
|
||||||
|
|
|
||||||
= note: not implement `Not`
|
|
||||||
|
|
||||||
error[E0599]: no method named `box_id` found for struct `boxes::array::ArrayBox` in the current scope
|
|
||||||
--> src/tests/box_tests.rs:135:25
|
|
||||||
|
|
|
||||||
135 | assert_ne!(box1.box_id(), box2.box_id());
|
|
||||||
| ^^^^^^ method not found in `ArrayBox`
|
|
||||||
|
|
|
||||||
::: src/boxes/array/mod.rs:11:1
|
|
||||||
|
|
|
||||||
11 | pub struct ArrayBox {
|
|
||||||
| ------------------- method `box_id` not found for this struct
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:55:8
|
|
||||||
|
|
|
||||||
55 | fn box_id(&self) -> u64;
|
|
||||||
| ------ the method is available for `boxes::array::ArrayBox` here
|
|
||||||
|
|
|
||||||
= help: items from traits can only be used if the trait is in scope
|
|
||||||
help: trait `BoxCore` which provides `box_id` is implemented but not in scope; perhaps you want to import it
|
|
||||||
|
|
|
||||||
7 + use crate::box_trait::BoxCore;
|
|
||||||
|
|
|
||||||
|
|
||||||
error[E0599]: no method named `box_id` found for struct `boxes::array::ArrayBox` in the current scope
|
|
||||||
--> src/tests/box_tests.rs:135:40
|
|
||||||
|
|
|
||||||
135 | assert_ne!(box1.box_id(), box2.box_id());
|
|
||||||
| ^^^^^^ method not found in `ArrayBox`
|
|
||||||
|
|
|
||||||
::: src/boxes/array/mod.rs:11:1
|
|
||||||
|
|
|
||||||
11 | pub struct ArrayBox {
|
|
||||||
| ------------------- method `box_id` not found for this struct
|
|
||||||
|
|
|
||||||
::: src/box_trait.rs:55:8
|
|
||||||
|
|
|
||||||
55 | fn box_id(&self) -> u64;
|
|
||||||
| ------ the method is available for `boxes::array::ArrayBox` here
|
|
||||||
|
|
|
||||||
= help: items from traits can only be used if the trait is in scope
|
|
||||||
help: trait `BoxCore` which provides `box_id` is implemented but not in scope; perhaps you want to import it
|
|
||||||
|
|
|
||||||
7 + use crate::box_trait::BoxCore;
|
|
||||||
|
|
|
||||||
|
|
||||||
warning: variable does not need to be mutable
|
|
||||||
--> src/tests/box_tests.rs:90:13
|
|
||||||
|
|
|
||||||
90 | let mut stream = NyashStreamBox::from_data(vec![72, 101, 108, 108, 111]); // "Hello"
|
|
||||||
| ----^^^^^^
|
|
||||||
| |
|
|
||||||
| help: remove this `mut`
|
|
||||||
|
|
||||||
Some errors have detailed explanations: E0063, E0599, E0600.
|
|
||||||
For more information about an error, try `rustc --explain E0063`.
|
|
||||||
warning: `nyash-rust` (lib test) generated 53 warnings (52 duplicates)
|
|
||||||
error: could not compile `nyash-rust` (lib test) due to 8 previous errors; 53 warnings emitted
|
|
||||||
warning: `nyash-rust` (bin "nyash_explorer_icons" test) generated 2 warnings (2 duplicates)
|
|
||||||
warning: `nyash-rust` (bin "nyash_explorer" test) generated 3 warnings (3 duplicates)
|
|
||||||
warning: `nyash-rust` (test "integration_tests") generated 2 warnings (run `cargo fix --test "integration_tests"` to apply 1 suggestion)
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
Nyashプログラミング言語のBox型アーキテクチャ設計について深い技術相談です。
|
|
||||||
|
|
||||||
【現在の状況】
|
|
||||||
- Rust実装のプログラミング言語Nyash開発中
|
|
||||||
- "Everything is Box"哲学:全データがBoxオブジェクト
|
|
||||||
- 現在16種類のBox型実装済み(StringBox, IntegerBox, P2PBox等)
|
|
||||||
- Arc<Mutex>統一パターンでスレッドセーフ性確保
|
|
||||||
|
|
||||||
【現在のアーキテクチャ問題】
|
|
||||||
現在、全Box型をtype aliasで統一しているが、実装で型エラー地獄が発生:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
// 現在の問題のある設計
|
|
||||||
type StringBox = Arc<Mutex<StringBoxData>>;
|
|
||||||
type IntegerBox = Arc<Mutex<IntegerBoxData>>;
|
|
||||||
type P2PBox = Arc<Mutex<P2PBoxData>>;
|
|
||||||
|
|
||||||
// 問題:型エイリアス複雑化、trait object Debug実装困難
|
|
||||||
// 結果:Copilot実装で型エラー多発、開発効率低下
|
|
||||||
```
|
|
||||||
|
|
||||||
【検討中のシンプル設計】
|
|
||||||
newtype patternによるシンプル化:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
// 案1: newtype pattern
|
|
||||||
struct StringBox(Arc<Mutex<StringBoxData>>);
|
|
||||||
struct IntegerBox(Arc<Mutex<IntegerBoxData>>);
|
|
||||||
struct P2PBox(Arc<Mutex<P2PBoxData>>);
|
|
||||||
|
|
||||||
// 案2: 生構造体(必要時のみArc化)
|
|
||||||
struct StringBox { data: String }
|
|
||||||
struct IntegerBox { value: i64 }
|
|
||||||
// 共有が必要な時だけArc::new()で包む
|
|
||||||
```
|
|
||||||
|
|
||||||
【技術的検討ポイント】
|
|
||||||
|
|
||||||
1. **型安全性とシンプルさのバランス**
|
|
||||||
- type alias vs newtype vs 生構造体
|
|
||||||
- コンパイル時エラー検出 vs 実装しやすさ
|
|
||||||
|
|
||||||
2. **スレッドセーフ性の要件**
|
|
||||||
- 全Box型で並行処理が必要か?
|
|
||||||
- StringBox等の基本型にもMutex必要?
|
|
||||||
- 必要な時だけArc<Mutex>化する方が良い?
|
|
||||||
|
|
||||||
3. **拡張性・保守性**
|
|
||||||
- 新Box型追加時の実装コスト
|
|
||||||
- エラーメッセージの分かりやすさ
|
|
||||||
- 他開発者(AI含む)の理解しやすさ
|
|
||||||
|
|
||||||
4. **パフォーマンス**
|
|
||||||
- Arc<Mutex>のオーバーヘッド
|
|
||||||
- ゼロコスト抽象化の実現可能性
|
|
||||||
- メモリ使用量の最適化
|
|
||||||
|
|
||||||
5. **現実的な実装戦略**
|
|
||||||
- 段階的移行 vs 一括変更
|
|
||||||
- 既存コードとの互換性
|
|
||||||
- 開発スピード重視 vs 理想設計重視
|
|
||||||
|
|
||||||
【具体的相談事項】
|
|
||||||
1. type alias vs newtype vs 生構造体、どの設計が最適?
|
|
||||||
2. 全Box型に一律Arc<Mutex>は過剰?必要な箇所のみの方が良い?
|
|
||||||
3. Rust専門家から見て推奨されるBox型統一アーキテクチャは?
|
|
||||||
4. プログラミング言語実装において、型システムのベストプラクティスは?
|
|
||||||
5. 実装効率と設計美学のバランスをどう取るべき?
|
|
||||||
|
|
||||||
【制約条件】
|
|
||||||
- Rust実装必須
|
|
||||||
- Everything is Box哲学維持
|
|
||||||
- スレッドセーフ性確保
|
|
||||||
- 16種類+今後追加予定のBox型すべてで統一
|
|
||||||
- 実装・保守の現実性重視
|
|
||||||
|
|
||||||
プログラミング言語設計・Rust専門家の視点から、実装可能で美しく、長期保守に適したアーキテクチャ設計を提案してください。
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
Nyashプログラミング言語の関数オーバーロード設計について深い技術的相談です。
|
|
||||||
|
|
||||||
【Nyashの技術的特徴】
|
|
||||||
- Everything is Box哲学: 全データがBoxオブジェクト
|
|
||||||
- Arc<Mutex>統一アーキテクチャ: 完全スレッドセーフ設計
|
|
||||||
- 明示性重視: 変数宣言先の即座特定可能
|
|
||||||
- Rust実装: メモリ安全性+高性能
|
|
||||||
- 目的: 初学者フレンドリー + 実用性
|
|
||||||
|
|
||||||
【検討する技術的課題】
|
|
||||||
現在P2PBox実装において、関数オーバーロード(引数数による分岐)採用の是非を検討中。
|
|
||||||
|
|
||||||
具体例:
|
|
||||||
```rust
|
|
||||||
// Option A: オーバーロードあり
|
|
||||||
impl P2PBox {
|
|
||||||
pub fn send(&self, message: IntentBox) -> Result<(), SendError> // ブロードキャスト
|
|
||||||
pub fn send(&self, to: &str, message: IntentBox) -> Result<(), SendError> // 個別送信
|
|
||||||
pub fn send(&self, to: &str, message: IntentBox, opts: SendOpts) -> Result<(), SendError> // オプション付き
|
|
||||||
}
|
|
||||||
|
|
||||||
// Option B: オーバーロードなし(現在)
|
|
||||||
impl P2PBox {
|
|
||||||
pub fn broadcast(&self, message: IntentBox) -> Result<(), SendError>
|
|
||||||
pub fn send(&self, to: &str, message: IntentBox) -> Result<(), SendError>
|
|
||||||
pub fn send_with_options(&self, to: &str, message: IntentBox, opts: SendOpts) -> Result<(), SendError>
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【技術的検討ポイント】
|
|
||||||
|
|
||||||
1. **Rust実装との整合性**
|
|
||||||
- Rustにはメソッドオーバーロードがない
|
|
||||||
- 引数数による分岐をインタープリターで実装する必要
|
|
||||||
- パフォーマンスへの影響
|
|
||||||
|
|
||||||
2. **Arc<Mutex>アーキテクチャとの親和性**
|
|
||||||
- 動的ディスパッチの複雑さ
|
|
||||||
- エラーハンドリングの一貫性
|
|
||||||
- スレッドセーフティの保持
|
|
||||||
|
|
||||||
3. **インタープリター実装の複雑度**
|
|
||||||
- パーサーでの引数数判定
|
|
||||||
- 実行時メソッド選択アルゴリズム
|
|
||||||
- デバッグ情報の提供
|
|
||||||
|
|
||||||
4. **型安全性とパフォーマンス**
|
|
||||||
- 実行時型チェックのオーバーヘッド
|
|
||||||
- エラーメッセージの品質
|
|
||||||
- 開発時デバッグ体験
|
|
||||||
|
|
||||||
5. **エコシステム設計との整合性**
|
|
||||||
- 他のBox型との一貫性
|
|
||||||
- 拡張性(新しいオーバーロード追加)
|
|
||||||
- メンテナンス性
|
|
||||||
|
|
||||||
【深く検討してほしい点】
|
|
||||||
1. 技術的実装の複雑さ vs ユーザー体験の向上
|
|
||||||
2. Nyashの「明示性重視」哲学との技術的整合性
|
|
||||||
3. 初学者がエラーに遭遇した時のデバッグ体験
|
|
||||||
4. P2P通信という特定ドメインでの最適解
|
|
||||||
5. 言語の長期進化における影響
|
|
||||||
|
|
||||||
プログラミング言語実装の専門的視点から、技術的に最良で保守しやすい設計を分析してください。
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
Nyashプログラミング言語の関数オーバーロード採用可否について言語設計の専門的観点から相談です。
|
|
||||||
|
|
||||||
【背景】
|
|
||||||
Nyashは「Everything is Box」哲学で、明示性重視・初学者フレンドリー・メモリ安全性を重視する言語です。現在Phase 2でP2PBox実装中で、関数オーバーロード(引数数による分岐)を採用するか重要な決断が必要です。
|
|
||||||
|
|
||||||
【具体的争点】
|
|
||||||
send(a) と send(a, b) のような関数オーバーロードを許すか?
|
|
||||||
|
|
||||||
例:
|
|
||||||
```nyash
|
|
||||||
// オーバーロードありの場合
|
|
||||||
node.send("hello") // ブロードキャスト
|
|
||||||
node.send("bob", "hello") // 個別送信
|
|
||||||
node.send("bob", msg, options) // オプション付き
|
|
||||||
|
|
||||||
// オーバーロードなしの場合(現在)
|
|
||||||
node.broadcast("hello") // 明示的メソッド名
|
|
||||||
node.send("bob", "hello") // 必ず2引数
|
|
||||||
node.sendWithOptions("bob", msg, options) // 明示的メソッド名
|
|
||||||
```
|
|
||||||
|
|
||||||
【メリット】
|
|
||||||
1. API使いやすさ向上
|
|
||||||
2. 他言語からの移行しやすさ
|
|
||||||
3. 直感的な呼び出し
|
|
||||||
|
|
||||||
【デメリット】
|
|
||||||
1. 間違った関数を呼ぶリスク
|
|
||||||
2. デバッグ困難
|
|
||||||
3. Nyashの明示性哲学と矛盾
|
|
||||||
4. 初学者混乱
|
|
||||||
5. 型推論複雑化
|
|
||||||
|
|
||||||
【Nyashの設計思想との照合】
|
|
||||||
- 明示性重視: プログラマーが変数の宣言先を即座に特定可能
|
|
||||||
- 初学者フレンドリー: 学習コストが低い
|
|
||||||
- Everything is Box: 統一されたオブジェクトモデル
|
|
||||||
|
|
||||||
【質問】
|
|
||||||
1. Nyashの設計思想から見て、関数オーバーロードは採用すべきか?
|
|
||||||
2. 明示性 vs 利便性のトレードオフをどう判断すべきか?
|
|
||||||
3. 初学者向け言語として適切な選択は?
|
|
||||||
4. P2P通信APIにおける最良の設計は?
|
|
||||||
5. 他の現代的言語設計トレンドとの整合性は?
|
|
||||||
|
|
||||||
プログラミング言語設計の専門的視点から、Nyashの将来を決めるアドバイスをお願いします。
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
Nyash言語のweak参照実装で根本的な設計問題が発覚しました。専門的分析をお願いします。
|
|
||||||
|
|
||||||
【現在の問題】
|
|
||||||
InstanceBox構造が原因でweak参照が実装できません:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
pub struct InstanceBox {
|
|
||||||
pub fields: Arc<Mutex<HashMap<String, Box<dyn NyashBox>>>>, // 問題の核心
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
NyashValue::WeakBoxを作っても、Box<dyn NyashBox>にしか格納できず、弱参照情報が失われます。
|
|
||||||
|
|
||||||
【解決策の選択肢】
|
|
||||||
|
|
||||||
1. **根本解決**(理想だが影響大)
|
|
||||||
```rust
|
|
||||||
pub fields: Arc<Mutex<HashMap<String, NyashValue>>>, // 全面アーキテクチャ変更
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **暫定解決**(copilot提案)
|
|
||||||
```rust
|
|
||||||
pub struct InstanceBox {
|
|
||||||
pub fields: Arc<Mutex<HashMap<String, Box<dyn NyashBox>>>>, // 既存維持
|
|
||||||
pub weak_fields: Arc<Mutex<HashMap<String, Weak<Mutex<dyn NyashBox>>>>>, // 追加
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
【コンテキスト】
|
|
||||||
- NyashValue革命は完了済み(Arc<Mutex>過剰症候群解決)
|
|
||||||
- Everything is Box哲学必須
|
|
||||||
- 実用性重視(完璧より動くもの優先)
|
|
||||||
|
|
||||||
【質問】
|
|
||||||
1. 暫定解決策の技術的妥当性は?
|
|
||||||
2. パフォーマンス・保守性への影響は?
|
|
||||||
3. 根本解決は本当に必要か?
|
|
||||||
4. 段階的移行戦略の是非は?
|
|
||||||
|
|
||||||
実装可能性と設計の美しさのバランスを重視した分析をお願いします。
|
|
||||||
33
docs/development/README.md
Normal file
33
docs/development/README.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Nyash Development Documentation 🔧
|
||||||
|
|
||||||
|
開発者向けの進行中タスクと開発計画ドキュメントです。
|
||||||
|
|
||||||
|
## 📂 ディレクトリ構造
|
||||||
|
|
||||||
|
### current/
|
||||||
|
- `CURRENT_TASK.md` - 現在進行中のタスク
|
||||||
|
- アクティブな開発作業の詳細
|
||||||
|
- 最新の実装状況
|
||||||
|
|
||||||
|
### roadmap/
|
||||||
|
- **phases/** - フェーズ別開発計画
|
||||||
|
- phase-8/ - AST→MIR変換
|
||||||
|
- phase-9/ - VM/JIT実装
|
||||||
|
- phase-10/ - AOT最適化
|
||||||
|
- **native-plan/** - ネイティブビルド計画
|
||||||
|
- 実行バックエンド統合
|
||||||
|
- パフォーマンス目標
|
||||||
|
|
||||||
|
### proposals/
|
||||||
|
- RFC(Request for Comments)
|
||||||
|
- 新機能提案
|
||||||
|
- 設計ディスカッション
|
||||||
|
|
||||||
|
## 🎯 重要な参照先
|
||||||
|
- **進行状況**: `current/CURRENT_TASK.md`
|
||||||
|
- **開発計画**: `roadmap/phases/`
|
||||||
|
- **技術提案**: `proposals/`
|
||||||
|
|
||||||
|
## 📝 注意事項
|
||||||
|
このディレクトリの内容は開発中であり、頻繁に変更されます。
|
||||||
|
安定した仕様は`reference/`を参照してください。
|
||||||
53
docs/development/current/CURRENT_TASK.md
Normal file
53
docs/development/current/CURRENT_TASK.md
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# 🎯 CURRENT TASK - 2025年8月20日
|
||||||
|
|
||||||
|
## 📊 現在の状況
|
||||||
|
|
||||||
|
### ✅ 完了したタスク
|
||||||
|
1. **ドキュメント再編成** - 完全完了!
|
||||||
|
- 283ファイル → 4大カテゴリに整理
|
||||||
|
- Phaseファイルも統合済み
|
||||||
|
- 説明書/予定フォルダ削除済み
|
||||||
|
|
||||||
|
2. **プラグインBox基本実装** (Phase 9.78c)
|
||||||
|
- FileBoxプラグイン実装済み
|
||||||
|
- インタープリター経由の呼び出し成功
|
||||||
|
- 基本的な引数/戻り値サポート追加(ChatGPT5による)
|
||||||
|
|
||||||
|
### 🚧 現在の課題
|
||||||
|
1. **Bashコマンドエラー問題**
|
||||||
|
- docs整理で現在のディレクトリが削除された影響
|
||||||
|
- セッション再起動が必要かも
|
||||||
|
|
||||||
|
2. **E2Eテスト状況**(tests/e2e_plugin_filebox.rs)
|
||||||
|
- インタープリターテスト: ✅ 成功(FileBox.close()が"ok"を返す)
|
||||||
|
- デリゲーションテスト: ❓ 未実装の可能性
|
||||||
|
- VMテスト: ❌ 失敗(VMはまだプラグインBox未対応)
|
||||||
|
|
||||||
|
### 🎯 次のタスク (Phase 9.78b)
|
||||||
|
|
||||||
|
#### Step 3: BoxFactory dyn化(優先度: 高)
|
||||||
|
- 現在: `HashMap<String, Box<dyn Fn() -> Arc<dyn NyashBox>>>`
|
||||||
|
- 目標: `HashMap<String, Arc<dyn BoxFactory>>`
|
||||||
|
- 利点: プラグインBoxもVMで統一処理可能
|
||||||
|
|
||||||
|
#### Step 4: グローバル排除
|
||||||
|
- `get_global_registry()` → `runtime.registry`
|
||||||
|
- `get_global_loader_v2()` → `runtime.plugin_loader`
|
||||||
|
|
||||||
|
#### Step 5: SharedState分解
|
||||||
|
- 巨大なSharedState構造体を分割
|
||||||
|
- Box管理、メソッド管理、スコープ管理を分離
|
||||||
|
|
||||||
|
### 📝 メモ
|
||||||
|
- ChatGPT5がプラグインBoxメソッド呼び出しに引数/戻り値サポートを追加
|
||||||
|
- TLV (Type-Length-Value) エンコーディングで引数をプラグインに渡す実装
|
||||||
|
- Rustの借用チェッカーとの格闘の跡が見られる(複数回の修正)
|
||||||
|
|
||||||
|
### 🔧 推奨アクション
|
||||||
|
1. セッション再起動してBashコマンドを復活
|
||||||
|
2. ビルド実行: `cargo build --release -j32`
|
||||||
|
3. E2Eテスト実行: `cargo test e2e_plugin_filebox --features plugins -- --show-output`
|
||||||
|
4. VMプラグイン統合の実装開始(Phase 9.78b Step 3)
|
||||||
|
|
||||||
|
---
|
||||||
|
最終更新: 2025年8月20日 22:45
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user