07f96ab4fb
feat: Phase 15.5 Week 1完了!llvmlite革命&環境変数完全整理
...
✅ llvmlite統一Call基盤革命達成
- mir_call.py: delegate→真の統一実装(6種Callee完全対応)
- Global/Method/Constructor/Closure/Value/Extern統一処理
- 実際のLLVMハーネス動作確認(モックルート完全回避)
✅ 環境変数体系完全整理
- CLAUDE.md: モックルート回避設定完全文書化
- 複雑な環境変数組み合わせの成功パターン確立
✅ Phase 15.5ドキュメント体系確立
- 実装状況追跡システム構築
- Week 1→2移行準備完了
🎯 Week 2開始準備: JSON出力統一→mir_json_emit.rs実装へ
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-24 02:13:43 +09:00
81211c22ad
feat: MIR Call命令統一Phase 3.1-3.2完了!統一Call実装進行中
...
✨ Phase 3.1-3.2実装完了
- build_indirect_call_expressionでCallTarget::Value使用
- print関数をcall_global print()として統一
- build_function_callでemit_unified_call使用
- ExternCall(env.console.log)→Callee::Global(print)完全移行
🏗️ MIR統一基盤構築
- src/mir/definitions/call_unified.rs: 統一定義(297行)
- emit_unified_call()と便利メソッド3種実装
- NYASH_MIR_UNIFIED_CALL=1で段階移行制御
- VM実行器でCallee対応実装済み
📊 進捗状況(26%削減見込み)
- Phase 1-2: ✅ 基盤構築完了
- Phase 3.1-3.2: ✅ 基本関数統一完了
- Phase 3.3: 🔄 BoxCall統一中
- Phase 4: 📅 Python LLVM(最優先・63%削減)
- Phase 5: 📅 PyVM/VM統一
📚 ドキュメント更新
- CLAUDE.md: テストスクリプト参考集追加
- CURRENT_TASK.md: Phase 3進捗更新
- python-llvm-priority-rationale.md: 優先順位戦略文書化
- mir-call-unification-master-plan.md: スケジュール最新化
🎯 6種類→1種類: Call/BoxCall/PluginInvoke/ExternCall/NewBox/NewClosure → MirCall統一へ
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-24 01:05:44 +09:00
536e64441a
refactor: Phase 2-A match_expr.rsのskip_newlines削除完了
...
♻️ skip_newlines()の段階的削除を継続
- match式内の6箇所を削除(41→35箇所、15%削減)
- brace_depth > 0により自動改行処理が有効
- 削減計画ドキュメントを作成
📊 進捗状況
- Phase 1: 48→40箇所 ✅
- Phase 2-A: 40→35箇所 ✅
- 次: Phase 2-B(fields.rs等のBox宣言系)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-23 11:03:25 +09:00
75b42bbff5
feat: 改行処理Phase 0 Quick Fix完了 - 複数行match式完全対応
...
- primary.rsに3箇所のskip_newlines()追加(COLON前後、COMMA判定前)
- match_expr.rsのis_object_literal()を改行対応(lookahead改良)
- セミコロンモード確認(NYASH_PARSER_ALLOW_SEMICOLON=1)
- テストケース全て成功(NYASH_SYNTAX_SUGAR_LEVEL=full必須)
- CLAUDE.md更新、改行処理戦略ドキュメント作成済み
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-23 10:14:53 +09:00
2e93403de0
phase15: implement Phase S root treatment for break control flow
...
🔧 **Phase S (Immediate Stabilization) Implementation**
- Create control flow utilities module (src/mir/utils/)
- Refactor loop_builder.rs duplicated code to utilities
- Fix PHI incoming predecessor capture per ChatGPT Pro analysis
📊 **AI Collaborative Analysis Complete**
- Task agent: Root cause identification
- Gemini: Strategic 3-phase approach
- codex: Advanced type inference solution (archived)
- ChatGPT Pro: Definitive staged treatment strategy
🗂️ **Documentation & Archive**
- Strategy document: docs/development/strategies/break-control-flow-strategy.md
- codex solutions: archive/codex-solutions/ (100+ lines changes)
- Update CLAUDE.md with 2025-09-23 progress
⚡ **Expected Impact**
- Resolve collect_prints null return issue
- Eliminate code duplication (4 locations unified)
- Foundation for Phase M (PHI unification) and Phase L (BuildOutcome)
🎯 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-23 07:13:32 +09:00
0d443dd6fa
docs: Fix peek/match documentation inconsistencies
...
- Update CLAUDE.md: peek式 → match式, peek構文 → match構文
- Update LANGUAGE_REFERENCE_2025.md: Peek式 → Match式
- Fix default pattern: else → _ (underscore)
- Resolve confusion causing JSON development Claude to use incorrect syntax
This fixes the root cause where new AI developers were referencing outdated
'peek' syntax examples and getting parse errors, forcing them to rewrite
with 'if' statements instead of using the correct 'match' syntax.
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-23 02:15:54 +09:00
39f47cd628
Add Rust ownership fusion theory and fix smoke test paths
...
🦀 📦 Added Rust×Nyash ownership fusion design (Phase 17+ candidate)
- Comprehensive ownership integration proposal with tags + borrowing tokens
- 3-tier safety levels (Safe/Unsafe/FFI) with opt-in adoption
- Complete link integration across roadmap and docs
🔧 Fixed smoke test path resolution
- Corrected ROOT_DIR calculation in selfhost smoke tests
- Updated scopebox_identity_smoke.sh, loopform_identity_smoke.sh, selfhost_runner_smoke.sh
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-22 23:25:35 +09:00
da78fc174b
selfhost/runtime: Stage 0-1 runner + MIR JSON loader (summary) with trace; compiler: scopebox/loopform prepass wiring (flags, child args); libs: add P1 standard boxes (console/string/array/map) as thin wrappers; runner: pass --box-pref via env; ops_calls dispatcher skeleton; docs: selfhost executor roadmap + scopebox/loopform notes; smokes: selfhost runner + identity prepasses; CURRENT_TASK: update plan and box lib schedule
2025-09-22 21:52:39 +09:00
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
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
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
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
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
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
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
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
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
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
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
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
45e1d57536
docs(lang): adopt match as unified pattern matching; remove peek from docs; update EBNF and guides
...
- Decision recorded in CURRENT_TASK: replace with (no compat alias)
- EBNF: add match_expr/pattern/guard; note legacy peek removal
- Guides/Reference: update examples and wording (null-coalesce/safe-access sugar via match)
2025-09-19 07:42:38 +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
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
847a1f09e9
docs: update LLVM_HARNESS.md and selfhost-pilot for ny-llvmc exe; add tools/crate_exe_smoke.sh
2025-09-18 03:58:36 +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
d93595ab83
docs(plugins): update headers to TypeBox v2; expand v2 doc with Regex/Net method tables; remove BID mentions where v2 exists
2025-09-17 22:30:19 +09:00
fcf8042622
docs(abi): align v2 with Phase‑12 blueprint; add roadmap/forward‑compat notes and Phase‑15 status pointer
2025-09-17 21:58:47 +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
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
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
5c9213cd03
smokes: add curated LLVM runner; archive legacy smokes; PHI-off unified across Bridge/Builder; LLVM resolver tracing; minimal Throw lowering; config env getters; dev profile and root cleaner; docs updated; CI workflow runs curated LLVM (PHI-on/off)
2025-09-16 23:49:36 +09:00
97a76c0571
selfhost: stub stage3 parser nodes under gate
2025-09-16 18:36:54 +09:00
47f4ca0e44
📚 docs: Record field declaration design discussion in papers
...
## Summary
Documented the "init block vs fields-at-top" design discussion as a valuable example of AI-human collaboration in language design.
## Changes
### Paper G (AI Collaboration)
- Added field-declaration-design.md documenting the entire discussion flow
- Showcased how complex init block proposal evolved to simple "fields at top" rule
- Demonstrates AI's tendency toward complexity vs human intuition for simplicity
### Paper H (AI Practical Patterns)
- Added Pattern #17 : "Gradual Refinement Pattern" (段階的洗練型)
- Documents the process: Complex AI proposal → Detailed analysis → Human insight → Convergence
- Field declaration design as a typical example
### Paper K (Explosive Incidents)
- Added Incident #046 : "init block vs fields-at-top incident"
- Updated total count to 46 incidents
- Shows how a single human comment redirected entire design approach
## Design Decision
After analysis, decided that BoxIndex should remain a compiler-internal structure, not a core Box:
- Core Boxes: User-instantiable runtime values (String, Integer, Array, Map)
- Compiler internals: BoxIndex for name resolution (compile-time only)
- Clear separation of concerns between language features and compiler tools
## Philosophy
This discussion exemplifies key principles:
- The best design needs no explanation
- Constraints provide clarity, not limitation
- "Everything is Box" doesn't mean "compiler internals are Boxes"
- AI tends toward theoretical completeness; humans toward practical simplicity
🐱 Sometimes the simplest answer is right in front of us\!
2025-09-16 14:57:05 +09:00
6ca56b0652
feat: 配列/Mapリテラル糖衣構文の実装とネームスペース解決の改善計画
...
- ArrayLiteral/MapLiteralのAST定義追加
- パーサーで[...]と{...}構文をサポート
- MIR Builderでnew Box() + push/setへのdesugaring実装
- テストケースとスモークスクリプト追加
- CURRENT_TASK.mdにネームスペース解決Phase-1計画を追記
- 3段階解決順序(ローカル→エイリアス→プラグイン)の設計合意
2025-09-16 06:13:44 +09:00
94d95dfbcd
🚀 Break/Continue/Try-Catch構文のサポート追加とMIRループ制御強化
...
## 主な変更点
### 🎯 MIRループ制御の実装(根治対応)
- src/mir/loop_builder.rs: Break/Continue対応のループコンテキスト管理
- ループのbreak/continueターゲットブロック追跡
- ネストループの適切な処理
- src/mir/builder.rs: Break/Continue文のMIR生成実装
- src/tokenizer.rs: Break/Continue/Tryトークン認識追加
### 📝 セルフホストパーサーの拡張
- apps/selfhost-compiler/boxes/parser_box.nyash:
- Stage-3: break/continue構文受理(no-op実装)
- Stage-3: try-catch-finally構文受理(構文解析のみ)
- エラー処理構文の将来対応準備
### 📚 ドキュメント更新
- 論文K(爆速事件簿): 45事例に更新(4件追加)
- PyVM迂回路の混乱事件
- Break/Continue無限ループ事件
- EXE-first戦略の再発見
- 論文I(開発秘話): Day 38の重要決定追加
### 🧪 テストケース追加
- apps/tests/: ループ制御とPHIのテストケース
- nested_loop_inner_break_isolated.nyash
- nested_loop_inner_continue_isolated.nyash
- loop_phi_one_sided.nyash
- shortcircuit関連テスト
## 技術的詳細
- Break/ContinueをMIRレベルで適切に処理
- 無限ループ問題(CPU 99.9%暴走)の根本解決
- 将来の例外処理機能への準備
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-15 22:14:42 +09:00