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,7 +19,7 @@ Everything you need to know about building Nyash for different platforms and con
cargo build --release -j32
# Run
./target/release/nyash program.nyash
./target/release/nyash program.hako
```
### Windows Cross-Compile from WSL
@ -38,7 +38,7 @@ cargo xwin build --target x86_64-pc-windows-msvc --release
| **Standard** | `cargo build --release` | Linux/macOS binary | Local development |
| **Windows Cross** | `cargo xwin build --target x86_64-pc-windows-msvc` | Windows .exe | Windows distribution |
| **WebAssembly** | `wasm-pack build --target web` | .wasm + JS | Browser deployment |
| **AOT Native** | `./tools/build_aot.sh program.nyash` | Standalone executable | High-performance deployment |
| **AOT Native** | `./tools/build_aot.sh program.hako` | Standalone executable | High-performance deployment |
| **Plugins** | `cargo build --release` (in plugin dir) | .so/.dll/.dylib | Extending Nyash |
## 🖥️ Platform-Specific Builds
@ -94,7 +94,7 @@ cargo build --release
```powershell
# Requires Cranelift + (clang または MSYS2/WSL の bash+cc)
cargo build --release --features cranelift-jit
powershell -ExecutionPolicy Bypass -File tools\build_aot.ps1 -Input examples\aot_min_string_len.nyash -Out app.exe
powershell -ExecutionPolicy Bypass -File tools\build_aot.ps1 -Input examples\aot_min_string_len.hako -Out app.exe
./app.exe
```
@ -120,8 +120,8 @@ wasm-pack build --target web
#### 2. Compile Nyash Code to WASM
```bash
# Compile .nyash to .wat (WebAssembly Text)
./target/release/nyash --compile-wasm program.nyash -o output.wat
# Compile .hako to .wat (WebAssembly Text)
./target/release/nyash --compile-wasm program.hako -o output.wat
# Convert to binary WASM (requires wabt)
wat2wasm output.wat -o output.wasm
@ -137,7 +137,7 @@ Compile Nyash programs to standalone native executables:
cargo build --release --features cranelift-jit
# Compile to native
./tools/build_aot.sh program.nyash -o app
./tools/build_aot.sh program.hako -o app
./app # Standalone executable!
```
@ -145,7 +145,7 @@ cargo build --release --features cranelift-jit
```powershell
# From PowerShell
cargo build --release --features cranelift-jit
powershell -ExecutionPolicy Bypass -File tools\build_aot.ps1 -Input program.nyash -Out app.exe
powershell -ExecutionPolicy Bypass -File tools\build_aot.ps1 -Input program.hako -Out app.exe
.\app.exe
```
@ -209,8 +209,8 @@ cp nyash.toml dist/
# 4. Copy plugin DLLs
cp plugins/*/target/x86_64-pc-windows-msvc/release/*.dll dist/plugins/
# 5. Add your .nyash files
cp your_app.nyash dist/
# 5. Add your .hako files
cp your_app.hako dist/
```
**Distribution structure:**
@ -218,7 +218,7 @@ cp your_app.nyash dist/
dist/
├── nyash.exe
├── nyash.toml
├── your_app.nyash
├── your_app.hako
└── plugins/
├── nyash_filebox_plugin.dll
├── nyash_array_plugin.dll