Files
hakorune/tools/pyc/README.md
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

25 lines
989 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Nyash Python Compiler (Phase 10.7 Workbench)
目的: Parser(プラグイン) → Nyash側コンパイラ → Nyashソース → 既存AOT までの最短ルートを、Nyashだけで段階実装する作業場。
## 構成
- `pyc.nyash` — エントリ(最小パイプライン実行)
- `PyCompiler.nyash` — Nyash側コンパイラ本体C2で拡張
- `PyIR.nyash` — IR生成/整形のヘルパ(最小)
## 使い方(最小)
```bash
# 1) NYASH_PY_CODE に Python コードを入れるParserプラグインが拾う
NYASH_PY_CODE=$'def main():\n return 0' \
./target/release/nyash --backend vm tools/pyc/pyc.nyash
```
出力
- Parser JSONdump/counts/unsupported
- 生成された Nyash ソース(現状は最小: return 0
## 次の拡張
- Parser JSON → IR(JSON) への変換def/return最小
- IR → Nyash 生成If/Return/Assign へ拡張)
- All-or-Nothing 運用unsupported_nodes を見て Strict に弾くスイッチ)