Files
hakorune/local_tests/test_plugin_filebox.nyash
Moe Charm 75868a5a96 feat(phase-9.75g-0): Implement BID-FFI Day 5 - FileBox plugin library and transparent switching (90% complete)
Day 5 achievements:
- Created independent FileBox plugin crate with C FFI exports
- Integrated plugin loading into Nyash interpreter startup
- Implemented transparent builtin/plugin Box switching via nyash.toml
- Successfully loaded plugin library (385KB .so) at runtime
- Confirmed PluginBox proxy creation for FileBox instances

Architecture changes:
- Added plugins/ directory with .gitignore for build artifacts
- Modified runner.rs to load plugins from nyash.toml on startup
- Updated objects.rs to use BoxFactoryRegistry for FileBox creation
- Fixed bid module visibility between lib.rs and main.rs

Remaining work (10%):
- Complete PluginBox proxy method implementations (toString, etc.)
- Test actual file operations through plugin interface
- Finalize error handling and edge cases

Build status: All tests passing, plugin loading confirmed
2025-08-18 00:33:01 +09:00

35 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Nyash FileBoxプラグイン透過的切り替えテスト
// nyash.tomlの設定によってビルトイン/プラグインが切り替わる
static box Main {
init { console, file, result }
main() {
me.console = new ConsoleBox()
me.console.log("🎯 FileBox Plugin Switching Test")
me.console.log("================================")
// FileBox作成透過的切り替え対象
me.file = new FileBox("test_plugin_output.txt")
me.console.log("📁 FileBox created: " + me.file.toString())
// 現在使用されているFileBox実装を確認
me.console.log("🔍 FileBox type: " + me.file.toString())
// 簡単なファイル操作テスト
local testPath
testPath = "test_plugin_output.txt"
me.console.log("📝 Testing file operations...")
// TODO: ファイル操作API呼び出し
// file.open(testPath)
// file.write("Hello from " + file.toString())
// file.close()
me.result = "Plugin switching test completed!"
me.console.log("✅ " + me.result)
return me.result
}
}