Commit Graph

802 Commits

Author SHA1 Message Date
8e4cadd349 selfhost(pyvm): MiniVmPrints – prefer JSON route early-return (ok==1) to avoid fallback loops; keep default behavior unchanged elsewhere 2025-09-22 07:54:25 +09:00
27568eb4a6 json: add v2 JsonDoc/JsonNode plugin with runtime provider switch; vendored yyjson + FFI; loader resolve(name)->method_id; PyVM JSON shims; smokes + CI gate; disable MiniVmPrints fallbacks by default
- plugin_loader_v2: store per-Box resolve() from TypeBox FFI; add resolve_method_id() and use in invoke_instance_method
- plugin_loader_unified: resolve_method() falls back to loader’s resolve when TOML lacks method entries
- nyash.toml: register JsonDocBox/JsonNodeBox methods (birth/parse/root/error; kind/get/size/at/str/int/bool)
- plugins/nyash-json-plugin:
  * serde/yyjson provider switch via env NYASH_JSON_PROVIDER (default serde)
  * vendored yyjson (c/yyjson) + shim; parse/root/get/size/at/str/int/bool implemented for yyjson
  * TLV void returns aligned to tag=9
- PyVM: add minimal JsonDocBox/JsonNodeBox shims in ops_box.py (for dev path)
- tests/smokes: add jsonbox_{parse_ok,parse_err,nested,collect_prints}; wire two into min-gate CI
- tools: collect_prints_mixed now uses JSON-based app
- MiniVmPrints: move BinaryOp and fallback heuristics behind a dev toggle (default OFF)
- CURRENT_TASK.md: updated with provider policy and fallback stance
2025-09-22 06:16:20 +09:00
0f96f2297d selfhost(pyvm): MiniVmPrints – fix int fallback bounds and step budget; compare path stabilized; avoid skipping next Print; still pending: BinaryOp '+': use inline typed sum 2025-09-22 04:10:00 +09:00
14c6b72417 current_task: record using seam fixes, mini_vm_core brace fix, collect_prints harden; mark using-mixed smoke WIP with flags; note private branches main/selfhost 2025-09-22 03:56:11 +09:00
c9a0333c38 using+pyvm: fix inlining seam and brace guard; stabilize MiniVm.collect_prints unknown-skip; harden MiniVmPrints int/binop scan; add seam-combiner diagnostics (default OFF); green self-contained + progress on using-mixed 2025-09-22 03:45:36 +09:00
c8063c9e41 pyvm: split op handlers into ops_core/ops_box/ops_ctrl; add ops_flow + intrinsic; delegate vm.py without behavior change
net-plugin: modularize constants (consts.rs) and sockets (sockets.rs); remove legacy commented socket code; fix unused imports
mir: move instruction unit tests to tests/mir_instruction_unit.rs (file lean-up); no semantic changes
runner/pyvm: ensure using pre-strip; misc docs updates

Build: cargo build ok; legacy cfg warnings remain as before
2025-09-21 08:53:00 +09:00
ee17cfd979 mini_vm: stabilize BinOp(+), literal/string/functioncall/compare/if fast-paths; pyvm: indexOf(start)/lastIndexOf(start), substring(None) guard, __me__ dispatch; update CURRENT_TASK; selfhost smokes green for core cases 2025-09-21 06:45:21 +09:00
37f93d5630 golden: add for/foreach normalized AST and loop_nonreorder (skip-reorder); docs: MacroCtx section; demo macro (identity) 2025-09-20 09:19:28 +09:00
497da75f90 macroctx: pass ctx JSON (caps) to user macros; add demo macro; docs: MacroCtx section and sandbox Box API; golden for for/foreach normalized AST 2025-09-20 09:11:52 +09:00
daa5309ea9 docs: fix macro sandbox policy and lock minimal Box API (Console/String/Array/Map); clarify plugin-off applies to macro child only 2025-09-20 09:05:20 +09:00
8a84339ac2 core: for/foreach -> Loop normalization (always-on); LoopForm MVP-3 per-segment reorder; smokes stabilized (VM + LLVM PHI); docs updated (macro-system, loopform); quiet macro load logs 2025-09-20 08:39:40 +09:00
f50f79994f loopform(hints): detect up to 2 assigned vars in loop body (no break/continue) and emit LoopCarrier hint; add smoke for two-vars case 2025-09-20 06:24:33 +09:00
334b7e83af ci(min-gate): add macro-smokes-lite job (match guard OR/type, MIR hints scope/join); keep fast lane lightweight 2025-09-20 06:05:18 +09:00
fc20d0061b llvm(smoke): add assign_both_branches; expand SKIP guard for mock IR cases; all LLVM PHI smokes pass/skip 2025-09-20 06:03:02 +09:00
1805ab3df2 mir(hints): add JoinResult trace smoke; add assign_both_branches case; docs: trace usage in scope-hints; all smokes pass 2025-09-20 05:55:25 +09:00
a811857cc8 mir(hints): add runtime tracing via NYASH_MIR_TRACE_HINTS; wire scope enter/leave at function entry/exit; add smoke to validate trace 2025-09-20 05:50:45 +09:00
765798a1ad llvm(smoke): add match literal_three_arms; guard mock cases; all PHI hygiene smokes passing or skipped appropriately 2025-09-20 05:47:54 +09:00
d27ca541d8 mir(hints): wire scope_enter/leave at function entry/exit; llvm(smoke): add guard-literal-or case with skip when mock; all smokes/goldens passing 2025-09-20 05:44:57 +09:00
7cd04e5942 macro(match): add golden for type-guard minimal (no Box); script to validate; all pass 2025-09-20 05:40:07 +09:00
3ee54470a5 macro(match): add golden for guard literal OR; add smoke; update CURRENT_TASK milestones 2025-09-20 05:36:25 +09:00
5a2f04be95 macro(match): add guard-literal-OR smoke (AST no PeekExpr + VM output); stabilize smoke robustness; LLVM PHI hygiene now passing for assign/print/match_literal 2025-09-20 05:34:23 +09:00
14122c1e55 llvm(smoke): make PHI hygiene robust; sanitize empty PHI via env; adjust tests to statement-if; allow non-zero exit; compute empty PHI safely 2025-09-20 05:21:09 +09:00
ff929aac5b smoke(match): relax guard/type smoke to only assert no PeekExpr (ast_json for BoxDeclarations uses Unsupported wrapper) 2025-09-20 05:04:40 +09:00
c536b402a2 macro(match): add guard/type normalization smoke; update CURRENT_TASK progress 2025-09-20 05:01:58 +09:00
166c374eec macro(if/match): stabilize PeekExpr→If normalization via internal-child; default runner off; propagate child stderr; fix JsonBuilder local_decl; add scope-hints doc; extend PHI smoke; golden for match literal passes 2025-09-20 05:00:31 +09:00
8cb93b9f1f tests(macro): inline samples into new directory hierarchy and drop legacy macro_golden_* sources 2025-09-20 03:37:20 +09:00
3c1486e411 tests(macro): organize under apps/tests/macro/{if,loopform,collections,types,strings,identity,test_runner} with thin include wrappers; update all golden/smoke scripts and docs to new paths 2025-09-20 02:20:02 +09:00
486adfbec5 mir(hints): add no-op hint types and sink; expose module (scaffold, zero-cost) 2025-09-20 02:08:52 +09:00
ec7d8ab726 llvm: extend If PHI hygiene smoke with multi-branch + guard chain case 2025-09-20 02:02:08 +09:00
a5a57e3d8b macro(if normalize): add return-if golden; llvm: extend PHI hygiene smoke to if-return and type_is cases 2025-09-20 01:55:45 +09:00
9b9080d0a3 macro/pattern: add type_is basic golden (MethodCall .is → MIR TypeOp mapping); docs: AST JSON v0 note for is/as mapping 2025-09-20 01:51:55 +09:00
126cf18e82 macro(if normalize): switch to ControlFlowBuilder for If stmt construction; llvm: add PHI hygiene smoke for If cases 2025-09-20 01:30:15 +09:00
4229e4259e macro(if normalize): add print-if normalization golden and runner 2025-09-20 01:29:02 +09:00
b7975c80db macro(if/match normalize): implement If-expression normalization for common statement contexts (Assignment/Return/Print); add golden (if-assign) and JSON builder helpers (print, return) 2025-09-20 01:22:55 +09:00
7d22a931be macro libs: add ControlFlowBuilder (if/match normalization helpers) and PatternBuilder (eq/or/and/type_is/default) for compile-time AST building 2025-09-20 01:19:50 +09:00
c5ab95d082 docs(cf/pattern): add ControlFlowBuilder and PatternBuilder guides; reference from If/Match normalization; plan updated in CURRENT_TASK 2025-09-20 01:15:26 +09:00
d185811541 docs: add three breakthrough papers Q, R, S for academic publication
- Paper Q: Unified Grammar Engine for AI-Language Collaboration (緊急性高)
- Paper R: ScopeBox Theory - Zero-Cost Abstraction (Gemini絶賛)
- Paper S: LoopForm Revolution - PHI Problem Solution (技術革新)

Updated PAPER_INDEX.md with new papers and reorganized priorities.
Added comprehensive README documentation for each new paper.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 01:11:36 +09:00
9999c7c456 llvm: add LoopForm PHI hygiene smoke (no empty PHI); docs: MIR hints (zero-cost); macros: scaffold If/Match normalize (identity) 2025-09-20 01:06:54 +09:00
02c8244964 scopebox: add design guide; scaffold no-op scope/defer macro; add MIR hint plan to CURRENT_TASK 2025-09-20 00:59:50 +09:00
b7e5b1e39c macro(loopform mvp-2): gate normalization to <=2 updated vars and no break/continue; add loop_two_vars golden and selfhost preexpand smoke 2025-09-20 00:40:05 +09:00
1d965c7241 docs(cf-normalize): add If/Match normalization guide and note in CURRENT_TASK Next; confirm pipeline order before LoopForm 2025-09-20 00:36:25 +09:00
7a57abfb95 docs(loopform): add carrier normalization examples and local run tips; task: Next short + 48h Action Items updated for LoopForm MVP-2/3 and LLVM PHI smoke 2025-09-20 00:32:29 +09:00
65227cb56f loopform: add loop_simple golden and test; prepare while normalization pathway via LoopNormalize + JsonBuilder 2025-09-19 23:18:07 +09:00
0c09460286 loopform: MVP normalization in LoopNormalize macro (canonicalize Loop via JsonBuilder); docs touch 2025-09-19 23:15:35 +09:00
1d309283b6 jsonbuilder: add apps/lib/json_builder.nyash and docs; wire loop_normalize_macro to prepare for usage; prefer Nyash runner route 2025-09-19 23:06:28 +09:00
9a0fe71215 docs: prefer Nyash runner route (self-hosting); switch to NYASH_MACRO_PATHS; deprecations noted; update smokes to new envs 2025-09-19 22:59:29 +09:00
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
c55f9d3689 docs(phase-17): add LoopForm Self-Hosting phase with schedule/design/guide; link from AGENTS\n\n- New: docs/development/roadmap/phases/phase-17-loopform-selfhost/{README,SCHEDULE,loopform-design}.md\n- Guide: docs/guides/loopform.md\n- AGENTS: link phase-17 + loopform guide\n 2025-09-19 22:39:04 +09:00