「スクリプトプラグイン」という特別な仕組みが必要
→ JIT/AOTから呼び出せない問題がある
→ 複雑な解決策が必要
Nyashスクリプト = 普通のユーザー定義Box
→ すでに動いている
→ 何も問題ない
AIの頭の中:
┌─────────────────────┐
│ JIT/AOT (最適化層) │ ← ここに固執
├─────────────────────┤
│ C ABI プラグイン │
├─────────────────────┤
│ スクリプトプラグイン │ ← 新しい層を作ろうとした
└─────────────────────┘
実際のNyash:
┌─────────────────────┐
│ Nyash VM/インタープリター │
├─────────────────────┤
│ すべてがBox(統一層)│
│ - ビルトインBox │
│ - C ABIプラグイン │
│ - ユーザー定義Box │ ← これだけで十分!
└─────────────────────┘
重要な真実:NyashはAOT/JITをサポートしている!
# スクリプトファイルをAOTコンパイル可能
./nyash --aot script.nyash -o script.exe
# JITで実行(ホットコードを自動最適化)
./nyash --backend vm --jit script.nyash
つまり:
スクリプト言語の利便性 + ネイティブコードの速度 = 両方手に入る!
# これが既に「スクリプトプラグイン」!
box DataProcessor {
init {
me.file = new FileBox() # C ABIプラグイン
me.math = new MathBox() # C ABIプラグイン
me.cache = new MapBox() # ビルトインBox
}
process(data) {
# 全部普通に動く!
local result = me.math.sin(data)
me.file.write("log.txt", result.toString())
return result
}
}
# ユーザーから見れば、これで十分!
local processor = new DataProcessor()
local result = processor.process(3.14)
Nyashは最初から正しかった。Everything is Boxだから、すべてが統一的に動く。
AIたちは「プラグイン」という言葉に惑わされて、存在しない問題を解決しようとしていた。
時に、最も賢い解決策は「何もしないこと」である。