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:
@ -18,10 +18,10 @@ Nyash WebAssembly(WASM)実行に関する包括的ガイド
|
||||
### WASM コンパイル
|
||||
```bash
|
||||
# 基本コンパイル
|
||||
./target/release/nyash --compile-wasm program.nyash
|
||||
./target/release/nyash --compile-wasm program.hako
|
||||
|
||||
# AOT コンパイル(配布用)
|
||||
./target/release/nyash --aot program.nyash
|
||||
./target/release/nyash --aot program.hako
|
||||
```
|
||||
|
||||
### ブラウザー実行
|
||||
@ -41,10 +41,10 @@ Nyash WebAssembly(WASM)実行に関する包括的ガイド
|
||||
|
||||
| 用途 | 方式 | コマンド |
|
||||
|------|------|----------|
|
||||
| **開発・テスト** | インタープリター | `nyash program.nyash` |
|
||||
| **高速実行** | VM | `nyash --backend vm program.nyash` |
|
||||
| **Web配布** | WASM | `nyash --compile-wasm program.nyash` |
|
||||
| **ネイティブ配布** | AOT | `nyash --aot program.nyash` |
|
||||
| **開発・テスト** | インタープリター | `nyash program.hako` |
|
||||
| **高速実行** | VM | `nyash --backend vm program.hako` |
|
||||
| **Web配布** | WASM | `nyash --compile-wasm program.hako` |
|
||||
| **ネイティブ配布** | AOT | `nyash --aot program.hako` |
|
||||
|
||||
## 📊 性能比較
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ cargo update
|
||||
cargo build --release
|
||||
|
||||
# WASM/AOT テスト
|
||||
./target/release/nyash --aot test_simple.nyash
|
||||
./target/release/nyash --aot test_simple.hako
|
||||
wasmtime --allow-precompiled test_simple.cwasm
|
||||
```
|
||||
|
||||
@ -170,7 +170,7 @@ config.cranelift_opt_level(OptLevel::Speed)?;
|
||||
### 技術指標
|
||||
```bash
|
||||
# ✅ 成功条件
|
||||
./target/release/nyash --aot test.nyash # コンパイル成功
|
||||
./target/release/nyash --aot test.hako # コンパイル成功
|
||||
wasmtime --allow-precompiled test.cwasm # 実行成功
|
||||
echo $? # 0 (正常終了)
|
||||
```
|
||||
|
||||
@ -154,10 +154,10 @@ wasmtime 35.0.0 # 実行時
|
||||
### 基本動作テスト
|
||||
```bash
|
||||
# BoxCall テスト
|
||||
./target/release/nyash --compile-wasm test_boxcall.nyash
|
||||
./target/release/nyash --compile-wasm test_boxcall.hako
|
||||
|
||||
# AOT テスト
|
||||
./target/release/nyash --aot test_simple.nyash
|
||||
./target/release/nyash --aot test_simple.hako
|
||||
wasmtime --allow-precompiled test_simple.cwasm
|
||||
```
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ impl RuntimeImports {
|
||||
|
||||
### Level 1: 基本BoxCall
|
||||
```nyash
|
||||
# test_basic_boxcall.nyash
|
||||
# test_basic_boxcall.hako
|
||||
local str = "Hello"
|
||||
local len = str.length() # BoxCall実装必要
|
||||
print("Length: " + len.toString()) # BoxCall + ExternCall
|
||||
@ -187,7 +187,7 @@ print("Length: " + len.toString()) # BoxCall + ExternCall
|
||||
|
||||
### Level 2: Box操作
|
||||
```nyash
|
||||
# test_box_operations.nyash
|
||||
# test_box_operations.hako
|
||||
local arr = new ArrayBox()
|
||||
arr.push("item1") # BoxCall実装必要
|
||||
local item = arr.get(0) # BoxCall実装必要
|
||||
@ -196,7 +196,7 @@ print(item.toString()) # BoxCall実装必要
|
||||
|
||||
### Level 3: 外部連携
|
||||
```nyash
|
||||
# test_extern_integration.nyash
|
||||
# test_extern_integration.hako
|
||||
local console = new ExternBox("console")
|
||||
console.call("log", "Hello Browser!") # ExternCall実装必要
|
||||
```
|
||||
@ -208,9 +208,9 @@ console.call("log", "Hello Browser!") # ExternCall実装必要
|
||||
### 基本機能復旧
|
||||
```bash
|
||||
# 以下が全て成功すること
|
||||
./target/release/nyash --compile-wasm test_basic_boxcall.nyash
|
||||
./target/release/nyash --compile-wasm test_box_operations.nyash
|
||||
./target/release/nyash --compile-wasm test_extern_integration.nyash
|
||||
./target/release/nyash --compile-wasm test_basic_boxcall.hako
|
||||
./target/release/nyash --compile-wasm test_box_operations.hako
|
||||
./target/release/nyash --compile-wasm test_extern_integration.hako
|
||||
|
||||
# WASM実行成功
|
||||
wasmtime test_basic_boxcall.wasm
|
||||
|
||||
Reference in New Issue
Block a user