Files
hakorune/examples/py_eval_demo.nyash
Moe Charm d24149d0a1 feat: Phase 10.5 Python統合プラグインとAOTビルド対応
- Pythonプラグイン(PyRuntimeBox/PyObjectBox)を追加
  - eval, import, getattr, call, callKw, strメソッド実装
  - math.sqrtデモ等のサンプルコード追加
- AOTビルドサポート追加
  - libnyrtランタイムライブラリ
  - build_aot.shビルドスクリプト
- .gitignore改善
  - JSONLとDOTファイル除外
  - プラグインのビルド成果物除外
- 不要ファイル削除
  - nekocode-temp, zenn_articles
  - 一時的なログファイル類

Phase 10.1の新計画に基づいて、プラグインBox統一化を推進
2025-08-29 10:22:44 +09:00

17 lines
463 B
Plaintext

// Python plugin demo (Phase 10.5 scaffold)
// Requires: plugins/nyash-python-plugin built (release) and nyash.toml updated
// Run:
// NYASH_CLI_VERBOSE=1 ./target/release/nyash --backend vm examples/py_eval_demo.nyash
static box Main {
main() {
local py, obj
py = new PyRuntimeBox()
// Evaluate simple Python expression and print its string form
obj = py.eval("'hello' * 3")
me.console.log("py.eval.str=", obj.str())
return 0
}
}