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

@ -19,11 +19,11 @@ cd nyash/nyash-rust
cargo build
# 実行
./target/debug/nyash your_program.nyash
./target/debug/nyash your_program.hako
```
### **2. はじめてのNyashプログラム**
`hello.nyash`を作成:
`hello.hako`を作成:
```nyash
print("Hello, Nyash World!")
print("Everything is Box! 🎉")
@ -31,7 +31,7 @@ print("Everything is Box! 🎉")
実行:
```bash
./target/debug/nyash hello.nyash
./target/debug/nyash hello.hako
```
出力:
@ -244,10 +244,10 @@ VMバックエンドの命令統計を有効化すると、性能分析に役立
```bash
# 人間向け表示
nyash --backend vm --vm-stats hello.nyash
nyash --backend vm --vm-stats hello.hako
# JSON出力ツール連携向け
nyash --backend vm --vm-stats --vm-stats-json hello.nyash
nyash --backend vm --vm-stats --vm-stats-json hello.hako
```
環境変数での制御も可能です(`NYASH_VM_STATS`, `NYASH_VM_STATS_JSON`)。
@ -422,24 +422,24 @@ debuggingDemo()
### **プロジェクト構造**
```
my_nyash_project/
├── main.nyash # メインプログラム
├── main.hako # メインプログラム
├── utils/
│ ├── math.nyash # 数学ユーティリティ
│ ├── string.nyash # 文字列ユーティリティ
│ └── debug.nyash # デバッグ関数
│ ├── math.hako # 数学ユーティリティ
│ ├── string.hako # 文字列ユーティリティ
│ └── debug.hako # デバッグ関数
└── models/
├── person.nyash # Personクラス
└── calculator.nyash # Calculatorクラス
├── person.hako # Personクラス
└── calculator.hako # Calculatorクラス
```
### **main.nyash**
### **main.hako**
```nyash
# 📦 Module System Example
include "utils/math.nyash"
include "utils/string.nyash"
include "models/person.nyash"
include "models/calculator.nyash"
include "utils/math.hako"
include "utils/string.hako"
include "models/person.hako"
include "models/calculator.hako"
function main() {
print("🚀 Multi-module Nyash Application")
@ -523,7 +523,7 @@ loop(i < 1000) {
### **学習順序**
1.**基本構文** - このガイドで完了
2. **並行処理** - `test_async_*.nyash`を参考に
2. **並行処理** - `test_async_*.hako`を参考に
3. **Static Box応用** - ユーティリティクラス作成
4. **デバッグ技法** - DebugBox完全活用
5. **アプリケーション開発** - 実践的なプロジェクト
@ -531,10 +531,10 @@ loop(i < 1000) {
### **サンプルプログラム**
```bash
# 実装済みサンプル
./target/debug/nyash test_local_init.nyash # 初期化付き変数
./target/debug/nyash app_dice_rpg.nyash # RPGバトルゲーム
./target/debug/nyash app_statistics.nyash # 統計計算
./target/debug/nyash test_async_parallel.nyash # 並行処理
./target/debug/nyash test_local_init.hako # 初期化付き変数
./target/debug/nyash app_dice_rpg.hako # RPGバトルゲーム
./target/debug/nyash app_statistics.hako # 統計計算
./target/debug/nyash test_async_parallel.hako # 並行処理
```
### **リファレンス**