Files
hakorune/examples/aot_py_min_chain.nyash
Moe Charm c13d9c045e 📚 Phase 12: Nyashスクリプトプラグインシステム設計と埋め込みVM構想
## 主な成果
- Nyashスクリプトでプラグイン作成可能という革命的発見
- C ABI制約の分析と埋め込みVMによる解決策
- MIR/VM/JIT層での箱引数サポートの詳細分析

## ドキュメント作成
- Phase 12基本構想(README.md)
- Gemini/Codex先生の技術分析
- C ABIとの整合性問題と解決策
- 埋め込みVM実装ロードマップ
- 箱引数サポートの技術詳細

## 重要な洞察
- 制約は「リンク時にC ABI必要」のみ
- 埋め込みVMでMIRバイトコード実行により解決可能
- Nyashスクリプト→C ABIプラグイン変換が実現可能

Everything is Box → Everything is Plugin → Everything is Possible!
2025-08-30 22:52:16 +09:00

18 lines
514 B
Plaintext

// AOT Python minimal chain: import -> getattr -> call
// Build AOT (example):
// cargo build --release --features cranelift-jit
// ./target/release/nyash --compile-native examples/aot_py_min_chain.nyash -o app && ./app
static box Main {
main() {
local py, math, sqrt_fn, x, r
py = new PyRuntimeBox()
math = py.import("math")
sqrt_fn = py.getattr(math, "sqrt")
x = new IntegerBox(16)
r = py.call(sqrt_fn, x)
return r // expects 4.0 (autodecode may convert FloatBox→f64)
}
}