Files
hakorune/examples/array_plugin_set_demo.nyash
Moe Charm c954b1f520 feat(plugins): ArrayBox/MapBoxプラグイン実装とPhase 10.1計画
🎯 革命的発見: プラグイン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>
2025-08-29 04:37:30 +09:00

21 lines
558 B
Plaintext

// ArrayBox plugin demo (set)
// Build plugin:
// (cd plugins/nyash-array-plugin && cargo build --release)
// Run (plugin host auto-loads from nyash.toml):
// NYASH_CLI_VERBOSE=1 ./target/release/nyash --backend vm examples/array_plugin_set_demo.nyash
static box Main {
main() {
local a
a = new ArrayBox()
a.push(10)
a.push(20)
a.push(30)
me.console.log("before set, len=", a.length(), ", get(2)=", a.get(2))
a.set(2, 42)
me.console.log("after set, len=", a.length(), ", get(2)=", a.get(2))
return a.get(2)
}
}