Commit Graph

508 Commits

Author SHA1 Message Date
65cb504c7d macro: default to Nyash runner route for user macros (self-hosting first); docs note 2025-09-19 22:55:37 +09:00
c4dda4ce01 macro(loopform): add LoopNormalize behavior routing (identity for MVP); AST JSON Local support 2025-09-19 22:52:22 +09:00
9d40e9137a macro(ast-json): add Loop/Break/Continue to AST JSON v0; add loop_normalize_macro (MVP identity) and loopform smoke; docs update 2025-09-19 22:47:12 +09:00
da32455afc freeze: macro platform complete; default ON with profiles; env consolidation; docs + smokes\n\n- Profiles: --profile {lite|dev|ci|strict} (dev-like default for macros)\n- Macro paths: prefer NYASH_MACRO_PATHS (legacy envs deprecated with warnings)\n- Selfhost pre-expand: auto mode, PyVM-only, add smokes (array/map)\n- Docs: user-macros updated; new macro-profiles guide; AGENTS freeze note; CURRENT_TASK freeze\n- Compat: non-breaking; legacy envs print deprecation notices\n 2025-09-19 22:27:59 +09:00
811e3eb3f8 feat: comprehensive development progress
- Pattern matching implementation extended in match_expr.rs
- CLI configuration structured with categorized groups (task recommendation completed)
- Python LLVM builder split into function_lower.py (task recommendation completed)
- parse_box_declaration massive function refactored (task recommendation completed)
- Phase 16 Macro Revolution comprehensive planning and documentation
- Archive legacy phase documentation for clean structure
- HTTP message box improvements and performance optimizations
- MIR builder enhancements and control flow improvements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 15:11:57 +09:00
3c7a5de900 runner(cli): adopt CliConfig::as_groups across runner modules (dispatch/common/pipe_io/mir/bench). llvm-builder: extract ny_main wrapper to builders.entry; add optional env-gated function_lower delegation; keep default behavior unchanged 2025-09-19 14:29:02 +09:00
c8c77d89a6 parser(box): reuse shared postfix wrapper for block-first unified member to remove duplication; build green 2025-09-19 12:16:44 +09:00
5bb7f67c01 perf(typebox): reduce clones with Arc<str> for MethodSignature.name and TypeBox.methods keys; API kept stable. tools: add all-cases empty-PHI smoke runner. parser(box): extract birth_once cycle validation into helper 2025-09-19 12:13:43 +09:00
4f82edf901 llvm: gate empty PHI sanitize behind NYASH_LLVM_SANITIZE_EMPTY_PHI=1; docs: AGENTS.md note. perf: begin clone() reduction plan — TypeBox.name/type_parameters to Arc<str>, adjusted builders/registry; no behavior change 2025-09-19 11:54:28 +09:00
21d326333d P0: user_defined factory safe init stub; P1: HTTPResponseBox interior mutability via Mutex (thread-safe), implement set_status/header/body/append_body + to_http_string, manual Clone; build green 2025-09-19 11:23:56 +09:00
f64718d22a parser(box): extract block-first unified members into helper; preserve cache/poison and birth_once guard; integrate in parse_box_declaration; update CURRENT_TASK.md 2025-09-19 11:08:14 +09:00
d1669312d1 parser: refactor parse_box_declaration by extracting helpers (postfix handlers, init block, visibility); keep behavior; no semantic change 2025-09-19 10:59:48 +09:00
7dfd55bfdb pyvm: implement TypeOp(check) + strict match-guard smokes; parser: guard support in match; llvm: PHI wiring at block head + incoming normalization; docs: AGENTS LLVM/PHI + guard policy; add tests; plan: refactor parse_box_declaration + TODO triage + clone reduction + CLI split + LLVM builder split; update CURRENT_TASK.md 2025-09-19 10:52:57 +09:00
e55ce363c3 parser(match): MVP type patterns via AST If-chain; reserve scrutinee with gensym name; tighten Stage‑2 smoke to check output but tolerate with warning for now; keep build green 2025-09-19 08:55:18 +09:00
9142476484 parser(match): add MVP type patterns (IntegerBox(x)/StringBox(s)) via AST If-chain; keep literal-only path using PeekExpr; add smoke app (apps/tests/match_type_pattern_basic.nyash); build + stage-2 smokes green 2025-09-19 08:34:29 +09:00
f4e340da08 parser(match): split match parser to expr/match_expr.rs; keep MVP (literal | literal ... and default _) and reuse PeekExpr lowering
- Routing: expressions.rs -> expr_parse_match()
- Module: src/parser/expr/match_expr.rs (+OR pattern, comma/newline separators)
- No MIR changes; existing PeekExpr lower handles match result via decision tree
2025-09-19 08:12:40 +09:00
a6f28a8980 parser(match): introduce expression (replaces syntax); keep AST PeekExpr lowering
- Tokenizer: add MATCH keyword; remove PEEK
- Parser: parse  (MVP: literal patterns, block/expr arms); build PeekExpr AST for existing lowering
- Tests/Smokes: update peek samples to match; skip one return-value case pending richer arm parsing

Notes: MIR unchanged; existing PeekExpr lowerers continue to work.
2025-09-19 07:58:01 +09:00
52ab2957e6 refactor(optimizer, parser/box): prune legacy optimizer bodies; delegate public/private single-line fields
- optimizer: remove unreachable old bodies in normalize_legacy_instructions/normalize_ref_field_access and delegate to optimizer_passes only
- parser/box: route public/private single-line fields through members::fields (supports = init, => computed, {..}+postfix) and keep visibility vectors consistent
- box_def facade: silence dead_code warning for scaffold

Smokes:
- PyVM Stage-2 PASS
- Stage-2 short-circuit PASS
- PyVM collections PASS
(NOTE) using_e2e_smoke is optional and currently failing; unrelated to this change
2025-09-19 07:19:46 +09:00
2d870664d5 current_task: refresh notes; cleanup unified; LLVM(harness): finalize_phis ownership, ret simplified, uses-predeclare; method-postfix cleanup return: PHI head grouping final TODOs 2025-09-19 02:43:33 +09:00
5e818eeb7e stage3: unify to cleanup; MIR return-defer; docs+smokes updated; LLVM(harness): finalize_phis ownership, ret.py simplified, uses-predeclare; cleanup return override green; method-postfix cleanup return WIP (PHI head) 2025-09-19 02:07:38 +09:00
951a050592 selfhost: introduce using-based imports for compiler/parser/tools; keep includes temporarily. llvm: add PHI wiring JSON trace + unit/integration tests; fast test suite extended. runner: split selfhost helpers, small cleanups. 2025-09-18 13:35:38 +09:00
3fe908eb0d docs/runtime: externcall + println normalization; NyRT silent result flag; PyVM console warn/error/trace routing\nselfhost(M2): add MirEmitterBox (Return(Int)->const+ret) and --emit-mir switch; initial selfhost smoke\nrunner: child args/env hardening for selfhost (NYASH_NY_COMPILER_CHILD_ARGS under --; NYASH_JSON_ONLY=1, NYASH_VM_USE_PY=1, NYASH_DISABLE_PLUGINS=1); VM path strips using lines when NYASH_ENABLE_USING=1\nmeta: clarify PyVM/llvmlite as primary (vm/interpreter legacy OFF) in CURRENT_TASK.md; README links to externcall docs 2025-09-18 06:35:49 +09:00
df66ea3ecb cli: add --emit-exe (+ --emit-exe-nyrt/--emit-exe-libs) to build native exe via ny-llvmc; docs updated 2025-09-18 04:23:11 +09:00
5d51086530 python-plugin: RAII (PyOwned/PyBorrowed) + autodecode enum; crate: ny-llvmc --emit exe with NyRT link; tools: build_llvm.sh crate-exe path + crate_exe_smoke; CURRENT_TASK update 2025-09-18 03:57:25 +09:00
b420929f53 chore(legacy): remove unused legacy plugin loader and C-ABI nyash-file plugin; unify plugin headers to TypeBox v2 2025-09-17 22:32:38 +09:00
d992fa1d2d feat(llvm): wire nyash --emit-mir-json into build_llvm.sh crate path; add NYASH_LLVM_ONLY_OBJ gate; fix ny-llvmc bin name 2025-09-17 22:11:59 +09:00
8aa01668ff feat(plugins): migrate Python family to TypeBox v2; complete first‑party v2 set (Regex/Net/Path/Math/Time/File)\n\nfeat(smoke): add Net round‑trip sample and wire to plugin v2 smoke\n\nfeat(cli): add --emit-mir-json and runner emit+exit path\n\nchore(config): register Python v2 boxes in nyash.toml\n\nchore(loader): improve v2 diagnostics and ensure v2 shim dispatch\n\nchore(build): integrate ny-llvmc env gate in build_llvm.sh\n\nchore(tasks): update CURRENT_TASK with v2 Python/Net/emit flag 2025-09-17 22:01:29 +09:00
913ca8b731 runtime(plugin): unify to Nyash ABI v2 dispatch via shim; loader drops legacy nyash_plugin_invoke and records TypeBox invoke_id; all PluginBoxV2 invoke paths use v2 shim 2025-09-17 20:42:01 +09:00
4ea3ca2685 docs/ci: selfhost bootstrap/exe-first workflows; add ny-llvmc scaffolding + JSON v0 schema validation; plan: unify to Nyash ABI v2 (no backwards compat) 2025-09-17 20:33:19 +09:00
a5054a271b llvm(py): introduce BuildCtx + trace hub; refactor if-merge prepass + PHI wiring into module; unify logs; ctx-enable compare/ret/call/boxcall/externcall/typeop/newbox/safepoint; curated smoke option for if-merge; README updates; keep behavior stable 2025-09-17 16:11:01 +09:00
2720884a20 bridge/json_v0: split expr lowering; add Ternary/Peek lowering + AST; selfhost Peek JSON emit; add selfhost Peek smoke; warning cleanup in lowering/optimizer/verification
- Split expr lowering into ; route calls from stmt lowering
- Implement ternary/peek lowering (MIR13 PHI-off=Copy, PHI-on=Phi)
- Extend JSON v0 AST (ExprV0::{Ternary,Peek}, PeekArmV0)
- Selfhost parser_box: emit Peek JSON; add Stage-2 'Peek basic' smoke
- Reduce warnings: remove unused imports/vars in several modules
- current_task: update plan for legacy VM/Interpreter offboarding
2025-09-17 11:45:57 +09:00
d99b941218 docs: add MIR13 mode doc and set PHI-off as default; bridge lowering split (if/loop/try); llvmlite resolver stabilization; curated runner default PHI-off; refresh CURRENT_TASK.md 2025-09-17 10:58:12 +09:00
31f90012e0 refactor: extract helpers (builder_calls: math/env/me; json_v0_bridge: new_block/merge_values) — non-functional cleanup; cargo check + smokes green 2025-09-17 08:20:44 +09:00
a3282abdd9 json_v0_bridge: add new_block() helper; refactor block creation in logical/try/loop; allow(dead_code) wrappers to quieten unused warnings (no behavior change) 2025-09-17 08:16:26 +09:00
dd53d38c8f builder: widen AST wrapper adoption (Binary/Call/Method/Field) and loop helper usage; non-functional refactor with cargo check passing 2025-09-17 08:11:47 +09:00
e2379b35b3 ast: add MethodCallExpr/FieldAccessExpr wrappers; builder: adopt wrappers for method/field, and add loop helpers (create_loop_blocks/add_predecessor). No behavior change. 2025-09-17 08:10:21 +09:00
6b505b5435 builder: add loop helpers (create_loop_blocks/add_predecessor) and adopt in LoopBuilder; use BinaryExpr/CallExpr wrappers in expr lowering (no behavior change) 2025-09-17 07:59:41 +09:00
f3be8ea5f6 builder/exprs: use AssignStmt and ReturnStmt wrappers for clearer destructuring (no behavior change) 2025-09-17 07:57:29 +09:00
3f930a0057 builder/stmts: use CallExpr wrapper in build_print_statement for isType/asType pattern (no behavior change) 2025-09-17 07:54:45 +09:00
ff3acd41ee ast: add wrapper structs (AssignStmt/ReturnStmt/IfStmt, BinaryExpr/CallExpr) with TryFrom/From for non-breaking gradual refactors 2025-09-17 07:53:05 +09:00
e47ee65a40 mir(builder/loops): add in_loop()/depth() helpers; clean up Break lowering comment (no behavior change) 2025-09-17 07:50:15 +09:00
ee4224d7d2 llvm_py: extract setup_phi_placeholders() and keep snapshots in lower_block (no behavior change) 2025-09-17 07:45:50 +09:00
adbb0201a9 chore(fmt): add legacy stubs and strip trailing whitespace to unblock cargo fmt 2025-09-17 07:43:07 +09:00
fcf8ce1f3c mir: split build_module phases 2025-09-17 07:29:28 +09:00
7aea9a934f ast: extract utility helpers 2025-09-17 07:27:55 +09:00
f80f6b7796 docs: update CURRENT_TASK.md with logging helpers and next steps (runner trace + selfhost helpers) 2025-09-17 07:12:15 +09:00
c704ac4338 runner: add trace::cli_v macro and apply in common.rs; use cli_verbose() in more callsites; tidy prints 2025-09-17 06:58:02 +09:00
c553f2952d runner/env: centralize CLI/env getters; parser expr split (call/primary); verifier utils direct; optimizer: boxfield peephole; LLVM: branch cond normalize hook; add trace macro scaffolding; refactor common.rs verbose checks 2025-09-17 06:55:39 +09:00
9dc5c9afb9 refactor: split optimizer/verifier/parser modules (mainline); add runner trace/directives; add LLVM terminator/select scaffolds; extract AST Span; update CURRENT_TASK with remaining plan 2025-09-17 05:56:33 +09:00
154778fc57 mir: extract CSE into passes::cse and wire it in optimizer. Behavior preserved (count-only, no SSA rewrites). Build + PyVM Stage-2 smokes PASS. 2025-09-17 03:41:04 +09:00