phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
@ -11,7 +11,7 @@ PyVMは**一般的なプログラム実行には使用しないでください**
|
||||
#### 1. JSON v0ブリッジ機能
|
||||
```bash
|
||||
# セルフホスティング実行(PyVM自動使用)
|
||||
NYASH_SELFHOST_EXEC=1 ./target/release/nyash program.nyash
|
||||
NYASH_SELFHOST_EXEC=1 ./target/release/nyash program.hako
|
||||
```
|
||||
- **用途**: Rust→Python連携でMIR JSON生成
|
||||
- **重要性**: Phase 15.3コンパイラMVP開発に必須
|
||||
@ -20,7 +20,7 @@ NYASH_SELFHOST_EXEC=1 ./target/release/nyash program.nyash
|
||||
#### 2. using処理共通パイプライン
|
||||
```bash
|
||||
# using前処理(PyVM内部使用)
|
||||
./target/release/nyash --enable-using program_with_using.nyash
|
||||
./target/release/nyash --enable-using program_with_using.hako
|
||||
```
|
||||
- **用途**: `strip_using_and_register`統一処理
|
||||
- **重要性**: Rust VM・LLVMとの共通前処理基盤
|
||||
@ -29,7 +29,7 @@ NYASH_SELFHOST_EXEC=1 ./target/release/nyash program.nyash
|
||||
#### 3. サンドボックス実行環境
|
||||
```bash
|
||||
# 開発者の明示的使用(上級者のみ)
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash program.nyash
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash program.hako
|
||||
```
|
||||
- **用途**: 安全なコード実行制御、実験的検証
|
||||
- **対象**: 開発者・研究者の明示的使用のみ
|
||||
@ -39,31 +39,31 @@ NYASH_VM_USE_PY=1 ./target/release/nyash program.nyash
|
||||
#### 1. 一般的なプログラム実行
|
||||
```bash
|
||||
# ❌ 使わないでください
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash my_application.nyash
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash my_application.hako
|
||||
|
||||
# ✅ 代わりにこれを使用
|
||||
./target/release/nyash my_application.nyash # Rust VM
|
||||
./target/release/nyash --backend llvm my_application.nyash # LLVM
|
||||
./target/release/nyash my_application.hako # Rust VM
|
||||
./target/release/nyash --backend llvm my_application.hako # LLVM
|
||||
```
|
||||
|
||||
#### 2. 性能比較・ベンチマーク
|
||||
```bash
|
||||
# ❌ 意味のない比較
|
||||
time NYASH_VM_USE_PY=1 ./target/release/nyash program.nyash
|
||||
time NYASH_VM_USE_PY=1 ./target/release/nyash program.hako
|
||||
|
||||
# ✅ 意味のある比較
|
||||
time ./target/release/nyash program.nyash # Rust VM
|
||||
time ./target/release/nyash --backend llvm program.nyash # LLVM
|
||||
time ./target/release/nyash program.hako # Rust VM
|
||||
time ./target/release/nyash --backend llvm program.hako # LLVM
|
||||
```
|
||||
|
||||
#### 3. 新機能開発・テスト
|
||||
```bash
|
||||
# ❌ PyVMでの新機能テスト
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash new_feature.nyash
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash new_feature.hako
|
||||
|
||||
# ✅ 2本柱での新機能テスト
|
||||
./target/release/nyash new_feature.nyash # Rust VM開発
|
||||
./target/release/nyash --backend llvm new_feature.nyash # LLVM検証
|
||||
./target/release/nyash new_feature.hako # Rust VM開発
|
||||
./target/release/nyash --backend llvm new_feature.hako # LLVM検証
|
||||
```
|
||||
|
||||
## 🎯 **Phase 15推奨実行方法**
|
||||
@ -71,31 +71,31 @@ NYASH_VM_USE_PY=1 ./target/release/nyash new_feature.nyash
|
||||
### **開発・デバッグ・一般用途**
|
||||
```bash
|
||||
# 基本実行(最も推奨)
|
||||
./target/release/nyash program.nyash
|
||||
./target/release/nyash program.hako
|
||||
|
||||
# 詳細診断
|
||||
NYASH_CLI_VERBOSE=1 ./target/release/nyash program.nyash
|
||||
NYASH_CLI_VERBOSE=1 ./target/release/nyash program.hako
|
||||
|
||||
# プラグインエラー対策
|
||||
NYASH_DISABLE_PLUGINS=1 ./target/release/nyash program.nyash
|
||||
NYASH_DISABLE_PLUGINS=1 ./target/release/nyash program.hako
|
||||
```
|
||||
|
||||
### **本番・最適化・配布用途**
|
||||
```bash
|
||||
# LLVM最適化実行
|
||||
./target/release/nyash --backend llvm program.nyash
|
||||
./target/release/nyash --backend llvm program.hako
|
||||
|
||||
# LLVM詳細診断
|
||||
NYASH_CLI_VERBOSE=1 ./target/release/nyash --backend llvm program.nyash
|
||||
NYASH_CLI_VERBOSE=1 ./target/release/nyash --backend llvm program.hako
|
||||
```
|
||||
|
||||
### **セルフホスティング開発用途**
|
||||
```bash
|
||||
# JSON v0ブリッジ(PyVM自動使用)
|
||||
NYASH_SELFHOST_EXEC=1 ./target/release/nyash program.nyash
|
||||
NYASH_SELFHOST_EXEC=1 ./target/release/nyash program.hako
|
||||
|
||||
# using処理テスト
|
||||
./target/release/nyash --enable-using program_with_using.nyash
|
||||
./target/release/nyash --enable-using program_with_using.hako
|
||||
```
|
||||
|
||||
## 📊 **技術的根拠**
|
||||
@ -121,12 +121,12 @@ NYASH_SELFHOST_EXEC=1 ./target/release/nyash program.nyash
|
||||
```bash
|
||||
# ❌ 間違い
|
||||
echo "Performance test:"
|
||||
time NYASH_VM_USE_PY=1 ./target/release/nyash benchmark.nyash
|
||||
time NYASH_VM_USE_PY=1 ./target/release/nyash benchmark.hako
|
||||
|
||||
# ✅ 正しい
|
||||
echo "Performance test:"
|
||||
time ./target/release/nyash benchmark.nyash # Rust VM
|
||||
time ./target/release/nyash --backend llvm benchmark.nyash # LLVM
|
||||
time ./target/release/nyash benchmark.hako # Rust VM
|
||||
time ./target/release/nyash --backend llvm benchmark.hako # LLVM
|
||||
```
|
||||
|
||||
### **誤用例2: デフォルトとしてのPyVM使用**
|
||||
@ -136,16 +136,16 @@ export NYASH_VM_USE_PY=1 # グローバル設定として使用
|
||||
|
||||
# ✅ 正しい
|
||||
# デフォルトはRust VM、特殊用途のみ個別指定
|
||||
NYASH_SELFHOST_EXEC=1 ./target/release/nyash selfhost_script.nyash
|
||||
NYASH_SELFHOST_EXEC=1 ./target/release/nyash selfhost_script.hako
|
||||
```
|
||||
|
||||
### **誤用例3: 学習・練習でのPyVM使用**
|
||||
```bash
|
||||
# ❌ 間違い(学習者向け)
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash hello_world.nyash
|
||||
NYASH_VM_USE_PY=1 ./target/release/nyash hello_world.hako
|
||||
|
||||
# ✅ 正しい(学習者向け)
|
||||
./target/release/nyash hello_world.nyash # シンプルで高品質なRust VM
|
||||
./target/release/nyash hello_world.hako # シンプルで高品質なRust VM
|
||||
```
|
||||
|
||||
## 💡 **まとめ**
|
||||
|
||||
Reference in New Issue
Block a user