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

@ -3,14 +3,14 @@ set -euo pipefail
# Nyash self-hosting dev loop helper
# Goals:
# - Avoid repeated Rust builds; iterate on .nyash scripts only
# - Avoid repeated Rust builds; iterate on .hako scripts only
# - One-time ensure binary exists; then run with VM (default) or MIR
# - Optional watch mode that re-runs on file changes (uses entr/inotifywait if available)
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
BIN="$ROOT_DIR/target/release/nyash"
SCRIPT="apps/selfhost-minimal/main.nyash"
SCRIPT="apps/selfhost-minimal/main.hako"
BACKEND="vm"
WATCH=0
LOAD_STD=0
@ -19,10 +19,10 @@ EXTRA_ARGS=()
usage() {
cat <<EOF
Usage: tools/dev_selfhost_loop.sh [options] [script.nyash] [-- ARGS]
Usage: tools/dev_selfhost_loop.sh [options] [script.hako] [-- ARGS]
Options:
--watch Re-run on file changes (apps/**/*.nyash)
--watch Re-run on file changes (apps/**/*.hako)
--backend <mode> interpreter|mir|vm (default: vm)
--std Load Ny std scripts from nyash.toml ([ny_plugins])
-v, --verbose Verbose CLI output
@ -30,7 +30,7 @@ Options:
Examples:
# One-off run (VM), minimal selfhost sample
tools/dev_selfhost_loop.sh apps/selfhost-minimal/main.nyash
tools/dev_selfhost_loop.sh apps/selfhost-minimal/main.hako
# Watch mode with Ny std libs loaded
tools/dev_selfhost_loop.sh --watch --std lang/src/compiler/entry/compiler_stageb.hako
@ -46,7 +46,7 @@ while [[ $# -gt 0 ]]; do
-v|--verbose) VERBOSE=1; shift ;;
-h|--help) usage; exit 0 ;;
--) shift; EXTRA_ARGS=("${@}"); break ;;
*.nyash) SCRIPT="$1"; shift ;;
*.hako) SCRIPT="$1"; shift ;;
*) EXTRA_ARGS+=("$1"); shift ;;
esac
done
@ -76,7 +76,7 @@ fi
# Watch mode
echo "[dev] watch mode ON (backend=$BACKEND, std=$LOAD_STD)"
FILES_CMD="rg --files --glob 'apps/**/*.nyash'"
FILES_CMD="rg --files --glob 'apps/**/*.hako'"
if command -v entr >/dev/null 2>&1; then
# Use entr for reliable cross-platform watching
@ -90,7 +90,7 @@ if command -v inotifywait >/dev/null 2>&1; then
echo "[dev] using 'inotifywait' for file watching"
while true; do
run_once || true
# Block until any .nyash under apps changes
# Block until any .hako under apps changes
inotifywait -qq -r -e close_write,create,delete,move "$ROOT_DIR/apps" || true
done
exit 0