Major milestone: - Set up apps/selfhost-compiler/ directory structure - Implement basic Nyash compiler in Nyash (CompilerBox) - Stage-1: Basic arithmetic parser (int/string/+/-/*/括弧/return) - JSON v0 output compatible with --ny-parser-pipe - Runner integration with NYASH_USE_NY_COMPILER=1 flag - Comprehensive smoke tests for PHI/Bridge/Stage-2 Technical updates: - Updated CLAUDE.md with Phase 15.3 status and MIR14 details - Statement separation policy: newline-based with minimal ASI - Fixed runaway ny-parser-pipe processes (CPU 94.9%) - Clarified MIR14 as canonical instruction set (not 13/18) - LoopForm strategy: PHI auto-generation during reverse lowering Collaborative development: - ChatGPT5 implementing compiler skeleton - Codex provided LoopForm PHI generation guidance - Claude maintaining documentation and coordination 🎉 セルフホスティングの歴史的一歩!自分自身をコンパイルする日が近いにゃ! Co-Authored-By: ChatGPT <noreply@openai.com>
27 lines
878 B
Bash
27 lines
878 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
ROOT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
|
BIN="$ROOT_DIR/target/release/nyash"
|
|
|
|
if [[ ! -x "$BIN" ]]; then
|
|
echo "[build] nyash (release) ..." >&2
|
|
(cd "$ROOT_DIR" && cargo build --release >/dev/null)
|
|
fi
|
|
|
|
TMP_DIR="$ROOT_DIR/tmp"
|
|
mkdir -p "$TMP_DIR"
|
|
|
|
printf 'return 1+2*3\n' > "$TMP_DIR/ny_parser_input.ny"
|
|
|
|
OUT=$(NYASH_USE_NY_COMPILER=1 NYASH_CLI_VERBOSE=1 "$BIN" --backend vm "$ROOT_DIR/apps/examples/string_p0.nyash" || true)
|
|
if echo "$OUT" | rg -q 'ny compiler MVP \(ny→json_v0\) path ON' && echo "$OUT" | rg -q '^Result:\s*0\b'; then
|
|
echo "✅ ny compiler MVP path OK (json_v0 emit + result 0)"
|
|
else
|
|
echo "WARN: ny compiler path not used; fallback executed (acceptable during MVP)"
|
|
echo "$OUT" | sed -n '1,120p'
|
|
fi
|
|
|
|
echo "All selfhost compiler smokes PASS" >&2
|