🎯 革命的発見: プラグイン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>
23 lines
515 B
Plaintext
23 lines
515 B
Plaintext
// ArrayBox plugin demo
|
|
// Requires: plugins/nyash-array-plugin built (release) and nyash.toml updated
|
|
// Run:
|
|
// NYASH_CLI_VERBOSE=1 ./target/release/nyash --backend vm examples/array_plugin_demo.nyash
|
|
|
|
static box Main {
|
|
main() {
|
|
local a, i
|
|
a = new ArrayBox()
|
|
// push integers 1..5
|
|
i = 1
|
|
loop (i <= 5) {
|
|
a.push(i)
|
|
i = i + 1
|
|
}
|
|
me.console.log("len=", a.length())
|
|
me.console.log("get(0)=", a.get(0))
|
|
me.console.log("get(4)=", a.get(4))
|
|
return a.length()
|
|
}
|
|
}
|
|
|