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:
nyash-codex
2025-11-06 15:41:52 +09:00
parent 2dc370223d
commit 77d4fd72b3
1658 changed files with 6288 additions and 2612 deletions

View File

@ -146,7 +146,7 @@ impl OptPass for DeadCodeElimPass {
```bash
# MIRからCへ変換
nyash --emit-c program.nyash -o program.c
nyash --emit-c program.hako -o program.c
# 最適化コンパイル
zig cc -O3 -flto -march=native \
@ -178,7 +178,7 @@ zig cc -O3 -fprofile-use program.c -o program_opt
## 5. 性能測定の例
```nyash
// benchmark.nyash
// benchmark.hako
static box Benchmark {
main() {
local start, end, result

View File

@ -89,27 +89,27 @@ Branch(cond, then, else) → {likely: Some(true)} // thenが高確率
Level 0: 開発モード
- MIR最適化なし
- デバッグ情報完全保持
- nyash program.nyash
- nyash program.hako
Level 1: 基本最適化(デフォルト)
- MIRカニカル化のみ
- Cエミッタ → gcc -O2
- nyash --release program.nyash
- nyash --release program.hako
Level 2: 高速化
- MIR全最適化パス
- Cエミッタ → zig cc -O3 -flto
- nyash --release --opt program.nyash
- nyash --release --opt program.hako
Level 3: プロファイルガイドPGO
- 実行プロファイル収集
- ホットパス特定
- nyash --release --pgo program.nyash
- nyash --release --pgo program.hako
Level 4: 特殊用途
- SIMD必要 → LLVM使用ただし依存が重い
- 起動速度重視 → Cranelift JIT推奨
- nyash --backend cranelift program.nyash
- nyash --backend cranelift program.hako
================================================================================
5. 実装計画