Phase 20.12b: quick green + structural cleanup

- Deprecations: add warn-once for nyash.toml (runtime::deprecations); apply in plugin loader v2 (singletons/method_resolver)
- Child env + runner hygiene: unify Stage‑3/quiet/disable-fallback env in test/runner; expand LLVM noise filters
- Docs/branding: prefer  and hako.toml in README.md/README.ja.md and smokes README
- VM: implement Map.clear in MIR interpreter (boxes_map)
- Stage‑B: gate bundle/alias/require smokes behind SMOKES_ENABLE_STAGEB; fix include cwd and resolve() call even for require-only cases
- Core‑Direct: gate rc boundary canary behind SMOKES_ENABLE_CORE_DIRECT
- Smokes: inject Stage‑3 and disable selfhost fallback for LLVM runs; filter using/* logs
- Quick profile: 168/168 PASS locally

This commit accelerates Phase 20.33 (80/20) by stabilizing quick suite, reducing noise, and gating heavy/experimental paths for speed.
This commit is contained in:
nyash-codex
2025-11-02 17:50:06 +09:00
parent 0cd2342b05
commit dd6876e1c6
46 changed files with 323 additions and 209 deletions

View File

@ -1,4 +1,6 @@
# 🐱 Nyash Programming Language
# 🐱 Hakorune Programming Language (formerly Nyash)
> Note: the project binary and uservisible brand have been renamed to “Hakorune”.
> The legacy `nyash` binary is deprecated (use `hakorune`). Config prefers `hako.toml` (fallback: `nyash.toml`). In scripts and docs, prefer `$NYASH_BIN` which points to `target/release/hakorune` when available.
**A Seriously-Crafted Hobby Language**
**From Zero to Native Binary in 20 Days - The AI-Powered Language Revolution**
@ -57,12 +59,12 @@ ExternCall (env.*) and println normalization: `docs/reference/runtime/externcall
### Minimal ENV (VM vs LLVM harness)
- VM: no extra environment needed for typical runs.
- Example: `./target/release/nyash --backend vm apps/tests/ternary_basic.nyash`
- Example: `$NYASH_BIN --backend vm apps/tests/ternary_basic.nyash`
- LLVM harness: set three variables so the runner finds the harness and runtime.
- `NYASH_LLVM_USE_HARNESS=1`
- `NYASH_NY_LLVM_COMPILER=$NYASH_ROOT/target/release/ny-llvmc`
- `NYASH_EMIT_EXE_NYRT=$NYASH_ROOT/target/release`
- Example: `NYASH_LLVM_USE_HARNESS=1 NYASH_NY_LLVM_COMPILER=target/release/ny-llvmc NYASH_EMIT_EXE_NYRT=target/release ./target/release/nyash --backend llvm apps/ny-llvm-smoke/main.nyash`
- Example: `NYASH_LLVM_USE_HARNESS=1 NYASH_NY_LLVM_COMPILER=target/release/ny-llvmc NYASH_EMIT_EXE_NYRT=target/release $NYASH_BIN --backend llvm apps/ny-llvm-smoke/main.nyash`
### DebugHub Quick Guide
- Enable: `NYASH_DEBUG_ENABLE=1`
@ -210,7 +212,7 @@ Phase15 (SelfHosting): Legacy VM/Interpreter are featuregated
### 1. **Interpreter Mode** (Development)
```bash
./target/release/nyash program.nyash
$NYASH_BIN program.nyash
```
- Instant execution
- Full debug information
@ -219,11 +221,11 @@ Phase15 (SelfHosting): Legacy VM/Interpreter are featuregated
### 2. **VM Mode (PyVM default / Legacy optional)**
```bash
# Default: PyVM harness (requires python3)
./target/release/nyash --backend vm program.nyash
$NYASH_BIN --backend vm program.nyash
# Enable legacy Rust VM if needed
cargo build --release --features vm-legacy
./target/release/nyash --backend vm program.nyash
$NYASH_BIN --backend vm program.nyash
```
- Default (vm-legacy OFF): PyVM executes MIR(JSON) via `tools/pyvm_runner.py`
- Legacy VM: 13.5x over interpreter (historical); kept for comparison and plugin tests
@ -249,13 +251,13 @@ cargo build --release -p nyash-llvm-compiler && cargo build --release --features
NYASH_LLVM_USE_HARNESS=1 \
NYASH_NY_LLVM_COMPILER=target/release/ny-llvmc \
NYASH_EMIT_EXE_NYRT=target/release \
./target/release/nyash --backend llvm --emit-exe myapp program.nyash
$NYASH_BIN --backend llvm --emit-exe myapp program.nyash
./myapp
# Alternatively, emit an object file then link manually
NYASH_LLVM_USE_HARNESS=1 \
NYASH_NY_LLVM_COMPILER=target/release/ny-llvmc \
./target/release/nyash --backend llvm program.nyash \
$NYASH_BIN --backend llvm program.nyash \
-D NYASH_LLVM_OBJ_OUT=$PWD/nyash_llvm_temp.o
cc nyash_llvm_temp.o -L crates/nyrt/target/release -Wl,--whole-archive -lnyrt -Wl,--no-whole-archive -lpthread -ldl -lm -o myapp
./myapp
@ -268,7 +270,7 @@ tools/smoke_aot_vs_vm.sh examples/aot_min_string_len.nyash
### LLVM Backend Notes
- `NYASH_LLVM_OBJ_OUT`: Path to emit `.o` when running `--backend llvm`.
- Example: `NYASH_LLVM_OBJ_OUT=$PWD/nyash_llvm_temp.o ./target/release/nyash --backend llvm apps/ny-llvm-smoke/main.nyash`
- Example: `NYASH_LLVM_OBJ_OUT=$PWD/nyash_llvm_temp.o $NYASH_BIN --backend llvm apps/ny-llvm-smoke/main.nyash`
- Previously available `NYASH_LLVM_ALLOW_BY_NAME=1`: Removed - all plugin calls now use method_id by default.
- The LLVM backend only supports method_id-based plugin calls for better performance and type safety.
@ -284,11 +286,11 @@ The WASM/browser path is currently not maintained and is not part of CI. The old
## 🧰 OneCommand Build (MVP): `nyash --build`
Reads `nyash.toml`, builds plugins → core → emits AOT object → links an executable in one shot.
Reads `hako.toml` (compat: nyash.toml), builds plugins → core → emits AOT object → links an executable in one shot.
Basic (Cranelift AOT)
```bash
./target/release/nyash --build nyash.toml \
$NYASH_BIN --build hako.toml \
--app apps/egui-hello-plugin/main.nyash \
--out app_egui
```
@ -492,7 +494,7 @@ cargo build --release --features cranelift-jit
# Run your first program
echo 'print("Hello Nyash!")' > hello.nyash
./target/release/nyash hello.nyash
$NYASH_BIN hello.nyash
```
### Windows