🎯 革命的発見: プラグインC ABI = JIT→EXE変換の統一基盤 ## 主な変更点 - ArrayBoxプラグイン: get/set/push/size/is_empty実装 - MapBoxプラグイン: size/get/has実装(ROメソッドのみ) - Phase 10.1ドキュメント: プラグインBox統一化計画 - デモファイル3種: プラグイン動作確認用 ## 技術的詳細 - BID-FFI (Box ID Foreign Function Interface) 活用 - 既存のプラグインシステムでJIT/AOT統一可能 - スタティックリンクでオーバーヘッド解消 - "Everything is Box → Everything is Plugin → Everything is Executable" ## テスト済み - array_plugin_demo.nyash: 基本動作確認 ✅ - array_plugin_set_demo.nyash: set操作確認 ✅ - map_plugin_ro_demo.nyash: RO操作確認 ✅ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
21 lines
524 B
Plaintext
21 lines
524 B
Plaintext
// MapBox plugin demo (RO via plugin: size/get/has), set is VM path.
|
|
// Build plugins:
|
|
// (cd plugins/nyash-map-plugin && cargo build --release)
|
|
// Run:
|
|
// NYASH_CLI_VERBOSE=1 ./target/release/nyash --backend vm examples/map_plugin_ro_demo.nyash
|
|
|
|
static box Main {
|
|
main() {
|
|
local m
|
|
m = new MapBox()
|
|
// mutating ops (VM path)
|
|
m.set(1, 100)
|
|
m.set(2, 200)
|
|
me.console.log("size=", m.size())
|
|
me.console.log("get(1)=", m.get(1))
|
|
me.console.log("has(2)=", m.has(2))
|
|
return m.get(2)
|
|
}
|
|
}
|
|
|