Commit Graph

14 Commits

Author SHA1 Message Date
3e8b75f4de fix: Kilo/CHIP-8アプリエラー修正 - toInteger, substring, レガシーBox削除
## 修正内容
1. **toIntegerメソッド実装** (#125)
   - StringBoxにtoInteger()メソッド追加
   - box_trait::IntegerBoxを返すよう統一(レガシーboxes::IntegerBox削除)

2. **substringメソッド実装**
   - StringBoxにsubstring(start, end)メソッド追加
   - Kiloエディタで必要な文字列操作を完全サポート

3. **レガシーコード削除**
   - src/boxes/mod.rsから重複StringBox/IntegerBox/BoolBoxエクスポート削除
   - 全てbox_trait実装に統一

4. **プラグインドキュメント整理**
   - 古い仕様書に「理想案・未実装」「将来構想」明記
   - 実装ベースの正確な仕様書作成
   - migration-guide.md追加

## テスト結果
-  Kiloエディタ: 完全動作確認("Enhanced Kilo Editor test complete")
-  toInteger()の乗算: 正常動作
-  substring(): 正常動作

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 14:13:47 +09:00
8f82437c58 feat: Windows GUI development with egui - simple notepad example
- Fixed EguiBox Send+Sync trait bounds for thread safety
- Added missing Arc import for EguiBox implementation
- Simplified font setup in Windows notepad example
- Successfully built 4.5MB Windows GUI executable
- Nyash can now create native Windows desktop applications! 🎉
2025-08-20 08:03:36 +09:00
670615d1de feat: WASMビルド完全対応+finiシステム修正 🎉
## WASMビルド対応
- TimerBox、AudioBox等の問題のあるBoxをWASM環境では条件付きコンパイルで除外
- WebBox (WebDisplayBox, WebConsoleBox, WebCanvasBox) にas_anyメソッド追加
- プラグイン関連コードに#[cfg]ガードを追加
- web-sysフィーチャーを追加(Performance、MouseEvent等)
- projects/nyash-wasmのビルドが完全に通るように!

## finiシステム修正
- フィールド差し替え時の自動fini削除(Nyashの明示的哲学に従う)
- スコープ離脱時のみfini実行(meは除外)
- ドキュメント更新で正しいfiniルールを明記

## その他
- CLAUDE.mdにWASMビルド方法を追記(wasm-pack build --target web)
- 開発サーバー起動方法を記載(python3 -m http.server 8010)
- cargo testで全テスト成功を確認

これでNyashがブラウザで動作可能に!🐱

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 07:33:18 +09:00
9eb52982b5 fix: Phase 9.78e+: Fix birth constructor and builtin Box method inheritance
🌟 Major fixes:
- Fix birth constructor lookup (was searching for 'init/N', now 'birth/N')
- Fix builtin Box method inheritance via __builtin_content field
- Remove InstanceBox wrapping for builtin Boxes
- Update execute_builtin_birth_method to properly store builtin content
- Update method resolution to check __builtin_content for builtin methods

 All tests pass:
- Birth constructors work correctly
- User-to-user Box delegation works
- User-to-builtin Box delegation works (toString() properly inherited)
- Apps folder tested (chip8, kilo editor run successfully)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 02:19:59 +09:00
5582ad45c0 feat: Phase 9.78e complete - instance_v2 migration with legacy compatibility
- instance_v2 now includes legacy compatibility layer
- All interpreter code migrated to use instance_v2
- Added legacy field access methods (get_fields, set_field_legacy, etc.)
- Fixed type conversion issues (NyashValue vs SharedNyashBox)
- instance.rs still exists but no longer used in interpreter
- TODO: Remove instance.rs completely in next phase
- TODO: Implement proper SharedNyashBox -> NyashValue conversion

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 22:35:34 +09:00
519560b64b 🎉 FileBox v2 plugin system fully working with TLV encoding fix
Major achievements:
- Fixed TLV encoding format to match plugin expectations
  - Header: version(2 bytes) + argc(2 bytes)
  - Entry: tag(1) + reserved(1) + size(2) + data
- Removed duplicate implementation in method_dispatch.rs
- All FileBox methods working: open/read/write/close
- Successfully tested file I/O operations

This completes the v2 plugin system integration for FileBox.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 13:57:17 +09:00
806aece8ad refactor: Begin migration to nyash.toml v2 plugin system
- Rename legacy plugin files to *_legacy.rs for protection
- Comment out old plugin loader and Host VTable dependencies
- Add temporary stub for create_plugin_box during migration
- Fix doc comment placement in io_methods.rs
- Prepare for v2 plugin system with single FFI entry point
2025-08-19 05:05:21 +09:00
58f92c178d feat(phase-9.75g-0): Complete BID-FFI Day 5 - Plugin method calling system
## 🎉 Major Achievement
- BID-FFI FileBox plugin fully functional with Nyash integration
- Complete plugin-backed file I/O operations working
- Successful write/read operations via FFI interface

##  What Works
- Plugin loading from nyash.toml configuration
- FileBox plugin instantiation: `new FileBox(path)`
- Method calls: `f.write("text")`, `f.read()`
- Complete round-trip: Nyash → Plugin → File → Plugin → Nyash

## 🔧 Implementation Details
- Added PluginFileBox method dispatch in execute_method_call()
- Implemented execute_plugin_file_method() for read/write/exists/close
- Fixed "Cannot call method on non-instance type" error
- Plugin methods work via TLV encoding/FFI/decoding

## 🚨 Known Issue (Next Phase)
Current implementation uses hardcoded method names (read/write/exists/close).
This violates BID-FFI dynamic principles - methods should be discovered
from plugin metadata, not hardcoded in Nyash interpreter.

## 📊 Test Results
```
local f
f = new FileBox("test.txt")
f.write("Hello from Nyash via plugin\!")
print("READ=" + f.read())
# Output: READ=Hello from Nyash via plugin\!
```

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 11:44:59 +09:00
bec0e9bc92 revert: 古いプラグインシステム実装前の状態に巻き戻し
- ソースコードをcommit 3f7d71fの状態に復元(古いプラグインシステム実装前)
- docsフォルダは最新の状態を維持(BID-FFI設計ドキュメント含む)
- nyashバイナリの基本動作確認済み
- BID-FFIシステムをクリーンに再実装する準備完了

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 08:34:19 +09:00
2b2dcc5647 feat(phase-9.75f-1): Complete FileBox dynamic library implementation
- Implement C ABI plugin system with workspace configuration
- Create FileBox plugin with full read/write/exists/toString support
- Fix critical memory management issues (double free) with Arc
- Add comprehensive test suite for dynamic FileBox functionality
- Achieve 98% build time improvement for plugin (2.87s vs 2-3min)
- Maintain full backward compatibility with feature flags

FileBox now loads dynamically, drastically reducing build times while
maintaining all functionality. Next: Math/Time dynamic migration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-17 09:31:35 +09:00
bd20c91b67 feat(9.75f-1): Implement plugin loader and interpreter integration
- Add plugin_loader.rs with FileBoxProxy implementation
- Integrate dynamic FileBox into interpreter (execute_new, method calls)
- Add feature flag 'dynamic-file' support throughout
- Create test program test_dynamic_filebox.nyash
- Plugin builds in 2.86s (vs main build 2+ minutes\!)

Build time improvement confirmed:
- Plugin-only build: 2.86s 
- Main build: 2+ minutes (timeout)

Next: Complete testing once main build finishes
2025-08-17 04:23:09 +09:00
fa1a3ad644 feat(Phase 9.75j): Complete warning elimination - 106→0 warnings (100% improvement)
 Major code quality improvements:
• Fixed all unused variable and parameter warnings
• Added appropriate #[allow(dead_code)] annotations
• Renamed constants to follow Rust naming conventions
• Achieved completely warning-free codebase

🔧 Key changes:
• Parser expressions: Fixed arg_count and statement_count usage
• MIR modules: Added dead_code allows for future-use code
• Backend modules: Prefixed unused parameters with underscore
• Effect constants: Renamed 'read' to 'READ_ALIAS' for conventions

📊 Results:
• Before: 106 warnings (noisy build output)
• After: 0 warnings (clean build)
• Improvement: 100% warning reduction

🎯 This continues the bug fixing initiative "つづきのしゅうせいおねがいにゃ!"
from Phase 9.75i (birth() fixes, static methods, Copilot apps).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 17:39:04 +09:00
69f42c6f1e feat(refactor): Extract calls module from expressions (Step 3)
- Move method call and from delegation call logic to dedicated calls.rs module
- Extract execute_method_call, execute_from_call, and execute_from_parent_constructor (515+ lines moved)
- Fix import issues with ResultBox type resolution
- Remove duplicate functions from mod.rs
- Build passes successfully with comprehensive method call handling
2025-08-16 12:58:42 +09:00
b0ed2920fd refactor(interpreter): Step 1 - Setup expressions module structure
- Move expressions.rs to expressions/mod.rs
- Create empty module files: operators.rs, calls.rs, access.rs, builtins.rs
- Add module declarations to mod.rs
- Build passes successfully

Next: Step 2 - Extract operator functions
2025-08-16 12:41:19 +09:00