1f5ba5f829
💢 The truth about Rust + LLVM development hell
...
ChatGPT5 struggling for 34+ minutes with Rust lifetime/build errors...
This perfectly illustrates why we need Phase 22 (Nyash LLVM compiler)\!
Key insights:
- 'Rust is safe and beautiful' - Gemini (who never fought lifetime errors)
- Reality: 500-line error messages, 34min debug sessions, lifetime hell
- C would just work: void* compile(void* mir) { done; }
- Python would work: 100 lines with llvmlite
- ANY language with C ABI would work\!
The frustration is real:
- We're SO CLOSE to Nyash self-hosting paradise
- Once bootstrapped, EVERYTHING can be written in Nyash
- No more Rust complexity, no more 5-7min builds
- Just simple, beautiful Box-based code
Current status:
- PHI/SSA hardening in progress (ChatGPT5)
- 'phi incoming value missing' in Main.esc_json/1
- Sealed SSA approach being implemented
The dream is near: Everything is Box, even the compiler\! 🌟
2025-09-12 05:48:59 +09:00
b120e4a26b
refactor(llvm): Complete Call instruction modularization + Phase 21 organization
...
## LLVM Call Instruction Modularization
- Moved MirInstruction::Call lowering to separate instructions/call.rs
- Follows the principle of one MIR instruction per file
- Call implementation was already complete, just needed modularization
## Phase 21 Documentation
- Moved all Phase 21 content to private/papers/paper-f-self-parsing-db/
- Preserved AI evaluations from Gemini and Codex
- Academic paper potential confirmed by both AIs
- Self-parsing AST database approach validated
## Next Steps
- Continue monitoring ChatGPT5's LLVM improvements
- Consider creating separate nyash-llvm-compiler crate when LLVM layer is stable
- This will reduce build times by isolating LLVM dependencies
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-12 01:58:07 +09:00
40d0cac0f1
feat(llvm): Complete function call system implementation by ChatGPT5
...
Major improvements to LLVM backend function call infrastructure:
## Key Changes
### Function Call System Complete
- All MIR functions now properly lowered to LLVM (not just entry)
- Function parameter binding to LLVM arguments implemented
- ny_main() wrapper added for proper entry point handling
- Callee resolution from ValueId to function symbols working
### Call Instruction Analysis
- MirInstruction::Call was implemented but system was incomplete
- Fixed "rhs missing" errors caused by undefined Call return values
- Function calls now properly return values through the system
### Code Modularization (Ongoing)
- BoxCall → instructions/boxcall.rs ✓
- ExternCall → instructions/externcall.rs ✓
- Call remains in mod.rs (to be refactored)
### Phase 21 Documentation
- Added comprehensive AI evaluation from Gemini and Codex
- Both AIs confirm academic paper potential for self-parsing AST DB approach
- "Code as Database" concept validated as novel contribution
Co-authored-by: ChatGPT5 <noreply@openai.com >
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-12 01:45:00 +09:00
3ac4a383e4
refactor(llvm): Modularize instructions.rs into focused submodules by ChatGPT
...
Successfully split the massive instructions.rs (1400+ lines) into organized submodules:
Structure:
- instructions/mod.rs - Module exports and wiring
- instructions/blocks.rs - Basic block creation and PHI setup
- instructions/flow.rs - Control flow (Return, Jump, Branch)
- instructions/externcall.rs - External call handling
- instructions/newbox.rs - NewBox operations
- instructions/boxcall.rs - BoxCall lowering (main dispatch)
- instructions/strings.rs - String fast-paths (concat, length)
- instructions/arrays.rs - Array operations (get/set/push/length)
- instructions/maps.rs - Map operations (size/get/set/has)
- instructions/arith.rs - Arithmetic operations (UnaryOp, BinOp, Compare)
- instructions/mem.rs - Memory operations (Load, Store)
- instructions/consts.rs - Constant value handling
Benefits:
- Improved maintainability (each file ~200-400 lines)
- Clear separation of concerns
- No behavior changes (pure refactoring)
- All existing smoke tests pass
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-11 23:58:10 +09:00
89e6fbf010
feat(llvm): Comprehensive LLVM backend improvements by ChatGPT
...
Major enhancements to LLVM code generation and type handling:
1. String Operations:
- Added StringBox length fast-path (length/len methods)
- Converts i8* to handle when needed for len_h call
- Consistent handle-based string operations
2. Array/Map Fast-paths:
- ArrayBox: get/set/push/length operations
- MapBox: get/set/has/size with handle-based keys
- Optimized paths for common collection operations
3. Field Access:
- getField/setField implementation with handle conversion
- Proper i64 handle to pointer conversions
4. NewBox Improvements:
- StringBox/IntegerBox pass-through optimizations
- Fallback to env.box.new when type_id unavailable
- Support for dynamic box creation
5. Documentation:
- Added ARCHITECTURE.md for overall design
- Added EXTERNCALL.md for external call specs
- Added LOWERING_LLVM.md for LLVM lowering rules
- Added PLUGIN_ABI.md for plugin interface
6. Type System:
- Added UserBox type registration in nyash_box.toml
- Consistent handle (i64) representation across system
Results: More robust LLVM code generation with proper type handling
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-11 22:30:26 +09:00
b9f9e81c72
refactor(llvm): Major progress on codegen modularization by ChatGPT
...
Major changes:
- Removed 617 lines of duplicate/legacy code from mod.rs (lines 351-967)
- All BoxCall handling now properly delegated to instructions::lower_boxcall
- Updated CURRENT_TASK.md with new findings:
- String concatenation issue (BinOp type mismatch)
- Plugin return value smoke test added
- Clear next steps for fixing return value display
Key improvements:
- Clean separation between dispatch (mod.rs) and implementation (instructions.rs)
- Legacy code marked as unreachable and ready for removal
- Better error visibility with modularized code structure
- llvm_smoke.sh updated with new plugin return value tests
Next steps:
1. Fix BinOp string concatenation type handling
2. Investigate MIR value_types for BoxCall returns
3. Further split lower_boxcall function (still 260+ lines)
2025-09-11 18:16:08 +09:00
4ecba4950f
feat(llvm): Complete compiler modularization refactoring (PR #136 )
...
- Split large compiler.rs into modular components
- Extract plugin signature loading to plugin_sigs.rs
- Extract box type ID loading to box_types.rs
- Preserve all PR #134 type information handling
- Update CURRENT_TASK.md with refactoring completion
2025-09-11 05:23:58 +09:00
e114f9bfe3
fix(llvm): Implement handle-based console.log functions for plugin return values
...
- Add nyash.console.log_handle(i64) -> i64 family functions to nyrt
- Replace invalid int-to-pointer conversion with proper handle-based calls
- Fix bool(i1) -> i64 type conversion in LLVM compiler
- Resolve LLVM function verification errors
- Enable plugin method execution without NYASH_LLVM_ALLOW_BY_NAME
- Merge codex TLV fixes for plugin return value handling (2000+ lines)
Technical Details:
- Root cause: build_int_to_ptr(handle_value, i8*, "arg_i2p") treated
handle IDs as memory addresses (invalid operation)
- Solution: Direct i64 handle passing to nyrt functions with proper
handle registry lookup and to_string_box() conversion
- Type safety: Added proper i1/i32/i64 -> i64 conversion handling
Status: Console.log type errors resolved, plugin return value display
still under investigation
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-11 00:21:11 +09:00
c014e78fb4
feat(llvm): Complete plugin system unification and environment variable elimination
...
🎉 Major Achievement: LLVM Plugin Environment Variable Problem Completely Resolved
## ✅ Completed Major Features:
1. **Plugin Implementation** ✅ - nyash.plugin.invoke_* functions in nyrt library working
2. **Plugin Calls** ✅ - Method calls working without environment variables
3. **Return Value Type Inference Fix** ✅ - Added plugin method type inference to MIR builder
4. **by-id Unification Complete** ✅ - Removed by-name fallback, unified to method_id system
5. **Environment Variable Elimination** ✅ - Removed NYASH_LLVM_ALLOW_BY_NAME=1 requirement
6. **Simple Execution Achieved** ✅ - ./target/release/nyash --backend llvm program.nyash
## 🔧 Technical Changes:
### Core Fixes:
- **src/mir/builder.rs**: Added plugin method return type inference
- CounterBox.get() -> Integer
- MathBox.sqrt() -> Float
- FileBox.read() -> String
- FileBox.exists() -> Bool
- **src/backend/llvm/compiler.rs**: Removed by-name fallback completely
- Deleted NYASH_LLVM_ALLOW_BY_NAME environment variable check
- Removed ~50 lines of fallback logic
- Unified to method_id-based calls only
### Documentation Updates:
- **CLAUDE.md**: Updated all plugin examples to remove environment variables
- **README.md/README.ja.md**: Removed environment variable documentation
- **tools/llvm_smoke.sh**: Removed NYASH_LLVM_ALLOW_BY_NAME from all test scripts
### Performance & Maintainability:
- **Better Performance**: method_id calls more efficient than by-name lookups
- **Type Safety**: method_id system provides compile-time guarantees
- **Code Simplification**: Removed complex fallback logic
- **User Experience**: No environment variables to remember
## 🧪 Verification:
- ✅ Plugin execution without environment variables
- ✅ method_id injection working: [LLVM] method_id injected: 4-5 places
- ✅ Type inference working: [BUILDER] Type inference: CounterBox get -> Integer
- ✅ Compilation success with LLVM backend
## 🔍 Remaining Investigation:
Plugin return value display issue identified as separate runtime layer problem
(plugin methods execute and side effects work, but return values not displayed in print())
🚀 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-10 23:24:02 +09:00
370e725926
docs: Update current task and loop builder SSA bug details
...
- Update dates to 2025-09-08
- Document loop builder SSA scope management issue
- Add notes about continue/break implementation status
- Fix birth/init consistency in CLAUDE.md
2025-09-09 09:31:39 +09:00
f22082f67c
resolve: apply stashed using/module + deps bridge; remove conflict markers in runner/mod.rs
2025-09-08 04:35:50 +09:00
da5fa600d2
merge: selfhosting-dev <- origin/main; prefer main updates in cranelift builder (ARROW removal/SHR adoption)
2025-09-08 04:33:50 +09:00
10d6b3059a
llvm: inline env.box.new_i64x arg conversion; add bitops tests/smoke; update CURRENT_TASK
...
- Inline-coerce env.box.new_i64x args to i64 handles (int passthrough, f64 via nyash.box.from_f64, i8* via nyash.box.from_i8_string). Removes closure that caused builder lifetime/borrow issues.
- Add unit test for bitwise/shift ops (VM=48; LLVM emit ok; compile_and_execute returns 48).
- Extend tools/llvm_smoke.sh with optional NYASH_LLVM_BITOPS_SMOKE gate; add apps/tests/ny-llvm-bitops (parser currently lacks &|^<<>> so E2E gated).
- Update CURRENT_TASK.md to reflect P1 progress and test strategy.
Build/test:
- LLVM build: LLVM_SYS_180_PREFIX=/usr/lib/llvm-18 cargo build --release --features llvm
- Unit: cargo test --no-run (env-dependent to run)
- Smoke (optional): NYASH_LLVM_BITOPS_SMOKE=1 ./tools/llvm_smoke.sh
2025-09-08 03:27:52 +09:00
6a80ce6c65
docs(current_task): restart notes for Ny syntax alignment and next steps
2025-09-08 02:24:17 +09:00
29e2973a72
docs(current_task): prepend quick self-host plan (dep-tree + bridge) for restart context
2025-09-08 02:15:33 +09:00
f8beebc456
docs(current_task): add self-host dep-tree plan; tasks: add dep_tree; Makefile: add dep-tree target
2025-09-08 01:42:50 +09:00
caf0e922ef
selfhosting: move ny-parser-nyash into apps/selfhost/, add Ny-only dev loop and initial dep tree tools; add docs plan; make dev/dev-watch
2025-09-07 20:23:39 +09:00
1bb2d2db5b
docs(current_task): add handoff plan (worktree setup, lower TODOs, commands)
2025-09-07 18:09:47 +09:00
21d2543e33
docs(current_task): update egui AOT/JIT status, scripts, and next actions (2025-09-07)
2025-09-07 17:53:48 +09:00
b8bdb867d8
Merge selfhosting-dev into main (Core-13 pure CI/tests + LLVM bridge) ( #126 )
...
* WIP: sync before merging origin/main
* fix: unify using/module + build CLI; add missing helper in runner; build passes; core smokes green; jit any.len string now returns 3
* Apply local changes after merging main; keep docs/phase-15 removed per main; add phase-15.1 docs and tests
* Remove legacy docs/phase-15/README.md to align with main
* integration: add Core-13 pure CI, tests, and minimal LLVM execute bridge (no docs) (#125 )
Co-authored-by: Tomoaki <tomoaki@example.com >
---------
Co-authored-by: Selfhosting Dev <selfhost@example.invalid >
Co-authored-by: Tomoaki <tomoaki@example.com >
2025-09-07 07:36:15 +09:00
d62114c705
Core-13 pure: add CI workflows, VM e2e tests, LLVM parity bridge (minimal); do not touch private docs
2025-09-07 07:28:53 +09:00
07f270b966
aot: enable plugin invokes in ObjectBuilder (tagged by-id), add generic NewBox birth via nyash.instance.birth_name_u64x2; egui(plugin): cross-platform run + debug logs; docs: WSL Wayland→X11 troubleshooting and one‑shot scripts; CURRENT_TASK + READMEs updated (JIT runtime sealed).
2025-09-06 16:18:46 +09:00
d631beba37
dev: add selfhosting/cranelift workspaces; jit: add return materialization, ret_slot, hostcall arity pad, and dbg imports for diagnosis
2025-09-06 10:59:33 +09:00
f6e0d5111e
Phase A リファクタリング: String.length デバッグ基盤の強化
...
## 実装内容(振る舞い変更なし)
A-1: Hostcall シンボルの定数化
- 直書き文字列を SYM_* 定数に統一
- nyash.handle.of / nyash.string.len_h / nyash.console.birth_h
A-2: string_len ヘルパー抽出(共通化)
- src/jit/lower/core/string_len.rs 新設
- emit_len_with_fallback_{param,local_handle,literal} を移設
- 二段フォールバック(string.len_h → any.length_h)の集約
A-3: 観測の統一
- import 呼び出しトレース機能を追加(NYASH_JIT_TRACE_IMPORT=1)
- CraneliftBuilder/ObjectBuilder の emit_host_call に構造化イベント
- observe::lower_hostcall で len_h/any.length_h の追跡
## 今後の道筋(CURRENT_TASK.md に記載)
- P0: フェイルセーフ(NYASH_LEN_FORCE_BRIDGE=1)
- P1: シンボル解決の可視化
- P2: リテラル最優先の安定化
- P3: Return 材化の後方走査
バグは手強いけど、デバッグ基盤が整ったにゃ!
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-06 08:09:46 +09:00
8c02093cfe
AOT/JIT: StringBox.length デバッグ追跡とローカル材化強化
...
- ops_ext: StringBox.len/lengthの結果を必ずローカルに保存
- param/local/literal/handle.of全経路で dst があれば local_index に格納
- Returnが確実に値を拾えるよう修正
- デバッグ計測追加:
- NYASH_JIT_TRACE_LOWER: BoxCall処理の追跡
- NYASH_JIT_TRACE_RET: Return時の値解決追跡
- NYASH_JIT_TRACE_LOCAL: ローカルslot I/O追跡
- NYASH_JIT_TRACE_LEN: string.len_h thunk実行追跡
- 診断用プローブ追加: tmp_len_stringbox_probe.nyash
- CURRENT_TASK更新: 3rdハンドオフ進捗記録
現状: lowering/Return/ローカル材化は正しく配線されているが、
hostcall実行時に0を返している疑い。シンボル解決の追跡継続中。
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-06 07:45:20 +09:00
7d88c04c0e
wip(phase15): AOT修正作業中 - Nyプラグインと標準ライブラリ実装
...
Phase 15のAOT/ネイティブビルド修正作業を継続中。
ChatGPTによるstd実装とプラグインシステムの改修を含む。
主な変更点:
- apps/std/: string.nyashとarray.nyashの標準ライブラリ追加
- apps/smokes/: stdライブラリのスモークテスト追加
- プラグインローダーv2の実装改修
- BoxCallのハンドル管理改善
- JIT hostcall registryの更新
- ビルドスクリプト(build_aot.sh, build_llvm.sh)の調整
まだ修正作業中のため、一部の機能は不完全な状態。
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-06 06:24:08 +09:00
e323120c59
phase15: update CLAUDE.md with Phase 15 enhancements from AGENTS.md
...
- Add JIT Self-Host Quickstart section for Phase 15
- Include important flags reference (plugins, parsers, debugging)
- Add Codex async workflow documentation for parallel tasks
- Update test execution with Phase 15 smoke tests
- Improve build time notes (JIT vs LLVM)
- Align with current Phase 15 progress and tooling
🎉 Bootstrap (c0→c1→c1') test confirmed working\!
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-05 15:18:13 +09:00
a2b89fae7e
phase15: update CLAUDE.md and sync with current progress
...
- Update phase indicator to Phase 15 (Self-Hosting)
- Update documentation links to Phase 15 resources
- Reflect completion of R1-R5 tasks and ongoing work
- Fix CURRENT_TASK.md location to root directory
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-05 13:29:17 +09:00
19f775c34d
feat(phase12.7): 糖衣構文Phase 12.7-B完了 + 自律型AI開発システム制御機能
...
🚀 Phase 12.7-B: ChatGPT5糖衣構文(基本実装完了)
- パイプライン演算子(|>)実装
- セーフアクセス(?.)とデフォルト値(??)実装
- sugar gateによる段階的有効化機能
- 糖衣構文テストスイート追加
🤖 自律型AI開発システム改善
- codex-async-notify.sh: タスク制御指示追加
- "下の箱を積み過ぎないように先に進んでください"
- "フェーズが終わったと判断したら止まってください"
- プロセス数表示機能の改善(count_running_codex_display)
- 自動停止機能が正常動作(Phase 12.7-C前で停止確認)
📚 ドキュメント更新
- Paper 13: 自律型AI協調開発システムの革新性を文書化
- ANCP可逆マッピング仕様追加
- nyfmt PoC(フォーマッター)計画追加
🧱 箱理論の体現
- 74k行のコードベース(Phase 15で20k行を目指す)
- ANCP適用で最終的に6k行相当を狙う
- 世界最小の実用コンパイラへの道
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-05 05:16:21 +09:00
0ed3c6a919
refactor(mir): MIR builder.rsのサブモジュール分割完了 - ChatGPT5による自動リファクタリング成功
...
- builder.rsを12個の機能別モジュールに分割
- decls.rs: 宣言処理
- exprs*.rs: 式処理(call, lambda, peek, qmark, include)
- fields.rs: フィールドアクセス
- stmts.rs: 文処理
- utils.rs: 共通ユーティリティ
- セルフホスティング前の糖衣構文圧縮フェーズ開始
- CURRENT_TASK.md: Phase 12.7進捗更新
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-04 20:14:26 +09:00
fb2d8e37d5
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
...
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-04 11:34:15 +09:00
4e824fa00e
Phase 12.7文法改革: ドキュメント文法統一 + VMリファクタリング準備
...
🌟 Phase 12.7文法改革に基づくドキュメント更新
- init {} → field: TypeBox 個別フィールド宣言形式
- init() → birth() コンストラクタ統一
- pack() → 廃止(birth()に統一)
- public {}/private {} → 個別フィールド修飾子
- override → 廃止(メソッド定義はシンプルに)
📚 更新したドキュメント
- CLAUDE.md: メイン開発ガイド
- docs/quick-reference/syntax-cheatsheet.md: 構文早見表
- docs/reference/language/LANGUAGE_REFERENCE_2025.md: 言語リファレンス
- docs/development/roadmap/phases/phase-15/README.md: Phase 15計画
🔧 VMリファクタリング準備
- vm_methods.rs: VMメソッド呼び出しの分離
- plugin_loader.rs → plugin_loader/: ディレクトリ構造化
- mir/builder/exprs.rs: 式ビルダー分離
📝 新規ドキュメント追加
- 論文戦略・ロードマップ
- Phase 15セルフホスティング準備資料
- Codex Androidセットアップガイド
ビルドは正常に通ることを確認済み!🎉
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-04 06:27:39 +09:00
6488b0542e
Phase 12.7完了 + ChatGPT5によるVMリファクタリング
...
## 📚 Phase 12.7 ドキュメント整理
- ChatGPT5作成のANCP Token仕様書v1を整備
- フォルダ構造を機能別に再編成:
- ancp-specs/ : ANCP圧縮技法仕様
- grammar-specs/ : 文法改革仕様
- implementation/ : 実装計画
- ai-feedback/ : AIアドバイザーフィードバック
- 各フォルダにREADME.md作成で導線改善
## 🔧 ChatGPT5によるVMリファクタリング
- vm_instructions.rs (1927行) をモジュール分割:
- boxcall.rs : Box呼び出し処理
- call.rs : 関数呼び出し処理
- extern_call.rs : 外部関数処理
- function_new.rs : FunctionBox生成
- newbox.rs : Box生成処理
- plugin_invoke.rs : プラグイン呼び出し
- VM実行をファイル分割で整理:
- vm_state.rs : 状態管理
- vm_exec.rs : 実行エンジン
- vm_control_flow.rs : 制御フロー
- vm_gc.rs : GC処理
- plugin_loader_v2もモジュール化
## ✨ 新機能実装
- FunctionBox呼び出しのVM/MIR統一進捗
- ラムダ式のFunctionBox変換テスト追加
- 関数値の直接呼び出し基盤整備
次ステップ: ANCPプロトタイプ実装開始(Week 1)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-04 03:41:02 +09:00
ceb22b6c18
gui: add EguiBox TypeBox plugin (Windows egui stub)\n\n- plugins: add nyash-egui-plugin with TypeBox (resolve/invoke_id), Windows path for real window via eframe; stub on other OS\n- apps: add apps/egui-hello sample (open→uiLabel→run→close)\n- loader: improve Windows DLL resolution (target triples: x86_64/aarch64 msvc) and lib→dll mapping\n- tests: expand TypeBox vs TLV diff tests up to FileBox; all green\n- docs: update CURRENT_TASK checklist (diff tests completed)\n- config: nyash.toml add EguiBox (type_id=70), plugin registry and methods
2025-09-03 13:58:52 +09:00
f939ad0033
Phase 12 完了: JIT/VM完全一致実装 - ChatGPT5による統一実行パス確立
...
🎯 VM/JIT同一実行の達成:
- InstanceBox: getField/setField完全一致(field3統一API)
- StringBox: 文字列リテラル最適化(u64x2)+ len操作一致
- NewBox: グローバルレジストリ経由の統一生成
- 全Box型でVM/JIT結果が完全同一に
技術的実装:
- host-bridge拡張: field3(固定3引数)でget/set統一
- 文字列処理: emit_string_handle_from_literal + from_u64x2
- Instance生成: nyash.instance.birth_name_u64x2 thunk
- JitEngine経路: LowerCore→CraneliftBuilder統合
テスト強化:
- PersonFactory: VM/JIT両系で同一レジストリ使用
- getField/setField: センチネル値(-1)による識別
- 文字列操作: リテラル/Box両対応
これでNyashは「Real Language」として完成!
同一コードが異なる実行系で完全に同じ結果を保証。
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-03 09:55:25 +09:00
773256380d
Phase 12: VM/JIT identical execution tests + host API slot routing
...
ChatGPT5による統一実行パス実装:
- VM/JIT同一実行テスト追加(Array/Map/String/Instance)
- host_api slot経由呼び出し(NYASH_JIT_HOST_BRIDGE=1)
- extern_registry拡張(console系メソッドslot登録)
- CI: vm-jit-identical.yml(STRICT/非STRICT両系テスト)
- InstanceBox getField/setField slot 1,2統一
技術的改善:
- JIT: ops_ext委譲による統一メソッド解決
- VM: vtable/PIC/名前ベースフォールバック階層
- host_bridge: TLV encode/decode BoxRef対応
- C ABI: nyrt_host_api.h外部公開ヘッダー
テスト追加:
- identical_exec_collections: Array/Map操作一致
- identical_exec_instance: ユーザー定義Box一致
- identical_exec_string: StringBox操作一致
- host_reverse_slot: 逆引きslot解決テスト
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-03 09:12:39 +09:00
53d88157aa
Phase 12: 統一TypeBox ABI実装開始 - ChatGPT5による極小コアABI基盤構築
...
- TypeBox ABI雛形: メソッドスロット管理システム追加
- Type Registry: Array/Map/StringBoxの基本メソッド定義
- Host API: C ABI逆呼び出しシステム実装
- Phase 12ドキュメント整理: 設計文書統合・アーカイブ化
- MIR Builder: クリーンアップと分離実装完了
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-03 05:04:56 +09:00
59b8cb3ace
Phase 11.9: 統一文法アーキテクチャ作業中 - MIR builder分割とJIT lower整理
...
- MIR builder: stmts/exprs/typeingモジュール分割による整理
- JIT lower: core/ops_ext.rs追加(外部呼び出し系の分離)
- 統一文法エンジン基盤構築中(grammar/unified-grammar.toml対応)
- ChatGPT5協調作業: M1完了、M2作業中
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-03 01:37:38 +09:00
2c795fa554
クリーンアップ: プロジェクト整理とGitHub公開準備
...
## 🧹 ルートディレクトリ整理
- batファイル(21個) → tools/windows/llvm-build-attempts/へ移動
- ログファイル → logs/archive/へ移動
- LLVM実行ファイル(計104MB) → .gitignoreに追加して削除
## 📝 .gitignore更新
- app_*_llvm, app_link, string_len_app を除外
- 大容量バイナリファイルのアップロード防止
## 🔧 追加のリファクタリング
- src/jit/lower/builder/tls.rs: TLS関連を独立モジュール化
## 📊 整理結果
- ルートディレクトリ: 0個の一時ファイル(完全クリーン)
- リポジトリサイズ: 189MB(適切)
- 最大追跡ファイル: 5.2MB(許容範囲内)
GitHub公開準備完了!🚀
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-02 12:31:33 +09:00
b05d5dd7ca
Phase 12: TypeBox革命とJIT制御フロー修正 - セルフホスティングへの道
...
## 🔥 TypeBox ABI革命(セルフホスティング実現)
- Nyash ABIをC実装TypeBoxで提供する画期的設計
- Gemini/Codexの深い考察を反映した詳細仕様書作成
- 16バイトアライメント、セレクターキャッシング、弱参照等の具体実装案
- Rust依存を完全排除し、セルフホスティングへの明確な道筋を確立
## 🎯 JIT制御フロー根本修正(ChatGPT5の25分長考の成果)
- ブロック挿入点の明確化: switch_to_block()で各ブロックemit開始時に切替
- シール戦略の簡潔化: br/jump直後のseal撤廃、最終シールに一本化
- PHI最小経路実装: ブロック引数の事前プリスキャン、後付けPHI問題解決
- Cranelift制約対応: 開始済みブロックへのappend禁止を正しく実装
## 📚 ドキュメント更新
- Phase 12全体のセルフホスティング対応更新
- NYASH-ABI-C-IMPLEMENTATION.md: 実装仕様書作成
- gemini-codex-deep-thoughts.md: AI専門家の考察アーカイブ
- 各種README/TASKS更新でセルフホスティング要件追加
## ✅ テスト結果
- mir-branch-ret: OK (Result: 1)
- mir-phi-min: OK (Result: 10)
- mir-branch-multi: OK (Result: 1)
「Everything is Box」の究極形態:ABIすらBoxとして扱う革命的設計!
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-02 11:18:19 +09:00
de99b40bee
Phase 12 TypeBox統合ABI設計完了: C ABI + Nyash ABI革命的統合
...
主な成果:
- TypeBox(型情報をBoxとして扱う)による統合ABI設計
- C ABI + Nyash ABIの完全統合仕様書作成
- 3大AI専門家(Gemini/Codex/ChatGPT5)による検証済み
- ChatGPT5の10個の安全性改善提案を反映
- README.mdのドキュメント更新(全起点から到達可能)
MapBox拡張:
- string型キーサポート(従来のi64に加えて)
- remove/clear/getOr/keysStr/valuesStr/toJson実装
- keys()/values()のランタイムシムサポート(TypeBox待ち)
その他の改善:
- Phase 11.9(文法統一化)ドキュメント追加
- Phase 16(FoldLang)ドキュメント追加
- 非同期タイムアウトテスト追加
- 各種ビルド警告(未使用import等)は次のリファクタリングで対応予定
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-02 09:26:09 +09:00
da96bcb906
📚 Phase 12.5 最適化戦略 & Phase 15 セルフホスティング計画
...
Phase 12.5: MIR15最適化戦略 - コンパイラ丸投げ作戦
- optimization-strategy.txt: 詳細戦略(MIR側は軽量、コンパイラに丸投げ)
- implementation-examples.md: 具体的な実装例
- debug-safety-comparison.md: 現在のDebugBox vs ChatGPT5提案の比較分析
Phase 15: Nyashセルフホスティング - 究極の目標
- self-hosting-plan.txt: 内蔵Craneliftによる実現計画
- technical-details.md: CompilerBox設計とブートストラップ手順
- README.md: セルフホスティングのビジョン
重要な知見:
- LLVM統合完了済み(Phase 11)だが依存が重すぎる
- Craneliftが現実的な選択肢(3-5MB vs LLVM 50-100MB)
- 「コンパイラもBox、すべてがBox」の夢へ
MASTERロードマップ更新済み
2025-09-02 05:11:10 +09:00
c9366d5c54
Phase 11.8/12: MIR Core-13 roadmap, Nyash ABI design, async/await enhancements with TaskGroupBox foundation
...
Major additions:
- Phase 11.8 MIR cleanup specification (Core-15→14→13 roadmap)
- Nyash ABI unified design document (3×u64 structure)
- TaskGroupBox foundation with cancelAll/joinAll methods
- Enhanced async/await with checkpoint auto-insertion
- Structured concurrency preparation (parent-child task relationships)
Documentation:
- docs/development/roadmap/phases/phase-11.8_mir_cleanup/: Complete Core-13 path
- docs/development/roadmap/phases/phase-12/NYASH-ABI-DESIGN.md: Unified ABI spec
- Updated Phase 12 README with AOT/JIT explanation for script performance
- Added async_task_system/ design docs
Implementation progress:
- FutureBox spawn tracking with weak/strong reference management
- VM checkpoint integration before/after await
- LLVM backend async support preparation
- Verifier rules for await-checkpoint enforcement
- Result<T,E> normalization for timeout/cancellation
Technical insights:
- MIR as 'atomic instructions', Box as 'molecules' philosophy
- 'Everything is Box' enables full-stack with minimal instructions
- Unified BoxCall for array/plugin/async operations future consolidation
Next steps:
- Complete TaskGroupBox implementation
- Migrate from global to scoped task management
- Implement LIFO cleanup on scope exit
- Continue Core-13 instruction consolidation
🚀 'From 15 atoms to infinite programs: The Nyash Box Theory'
2025-09-02 03:41:51 +09:00
11506cee3b
Phase 11-12: LLVM backend initial, semantics layer, plugin unification
...
Major changes:
- LLVM backend initial implementation (compiler.rs, llvm mode)
- Semantics layer integration in interpreter (operators.rs)
- Phase 12 plugin architecture revision (3-layer system)
- Builtin box removal preparation
- MIR instruction set documentation (26→Core-15 migration)
- Cross-backend testing infrastructure
- Await/nowait syntax support
New features:
- LLVM AOT compilation support (--backend llvm)
- Semantics layer for interpreter→VM flow
- Tri-backend smoke tests
- Plugin-only registry mode
Bug fixes:
- Interpreter plugin box arithmetic operations
- Branch test returns incorrect values
Documentation:
- Phase 12 README.md updated with new plugin architecture
- Removed obsolete NYIR proposals
- Added LLVM test programs documentation
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-01 23:44:34 +09:00
fff9749f47
📚 Reorganize CLAUDE.md: slim down from 916 to 395 lines with proper doc links
...
- Keep essential information within 500 lines (now 395 lines)
- Maintain important syntax examples and development principles
- Move detailed information to appropriate docs files:
- Development practices → docs/guides/development-practices.md
- Testing guide → docs/guides/testing-guide.md
- Claude issues → docs/tools/claude-issues.md
- Add proper links to all referenced documentation
- Balance between minimal entry point and practical usability
2025-08-31 06:22:48 +09:00
b003bdf25b
📚 Phase 11 documentation: Everything is Box × MIR15 revolution
...
Key updates:
- Document MIR 26→15 instruction reduction plan (transitioning status)
- Add Core-15 target instruction set in INSTRUCTION_SET.md
- Save AI conference analyses validating Box Theory and 15-instruction design
- Create MIR annotation system proposal for optimization hints
- Update SKIP_PHASE_10_DECISION.md with LLVM direct migration rationale
Technical insights:
- RefNew/RefGet/RefSet can be eliminated through Box unification
- GC/sync/async all achievable with 15 core instructions
- BoxCall lowering can automatically insert GC barriers
- 2-3x performance improvement expected with LLVM
- Build time reduction 50%, binary size reduction 40%
Status: Design complete, implementation pending
2025-08-31 03:03:04 +09:00
1812cda7d5
Update CURRENT_TASK: plan AOT/JIT string-like hostcalls (concat/eq/lt) with generic lowering; keep MIR→VM→JIT→exe generic and no hardcoding
2025-08-31 00:28:07 +09:00
8d7888f6f1
String unification bridge: VM string-like normalization (compare/add/method fallbacks) and Interpreter normalization for compare/add; fix lifetime issues; update CURRENT_TASK status
2025-08-30 23:58:58 +09:00
4ae92cfb56
Phase 10.7/10.5c: include cycle detection (VM/Interpreter), minimal pyc IR→Nyash, String unification bridge (VM partial), add core plugins: RegexBox/EncodingBox/TOMLBox/PathBox + examples; wire nyash.toml; begin String interop for internal vs plugin boxes; update CURRENT_TASK.md
2025-08-30 23:47:08 +09:00
c13d9c045e
📚 Phase 12: Nyashスクリプトプラグインシステム設計と埋め込みVM構想
...
## 主な成果
- Nyashスクリプトでプラグイン作成可能という革命的発見
- C ABI制約の分析と埋め込みVMによる解決策
- MIR/VM/JIT層での箱引数サポートの詳細分析
## ドキュメント作成
- Phase 12基本構想(README.md)
- Gemini/Codex先生の技術分析
- C ABIとの整合性問題と解決策
- 埋め込みVM実装ロードマップ
- 箱引数サポートの技術詳細
## 重要な洞察
- 制約は「リンク時にC ABI必要」のみ
- 埋め込みVMでMIRバイトコード実行により解決可能
- Nyashスクリプト→C ABIプラグイン変換が実現可能
Everything is Box → Everything is Plugin → Everything is Possible!
2025-08-30 22:52:16 +09:00