Commit Graph

554 Commits

Author SHA1 Message Date
020990463d feat(papers): AI先生レビューを反映した論文改訂版
MIR13論文とNyash言語論文について、Gemini先生とCodex先生の
詳細レビューを受けて大幅改訂:

MIR13論文の改善:
- 「完全な」→「実用的な」に表現を適正化
- 57命令からの削減経緯を議論セクションに追加
- Python/Go/Rustとの絶対性能比較を追加
- BoxCallのオーバーヘッド分析を追加
- ランタイムシステムの役割を明記
- 関連研究に比較表とメッセージパッシング系譜を追加

Nyash言語論文の改善:
- マイクロベンチマーク追加(Python/Lua/Swift比較)
- HTTPサーバーベンチマーク追加
- メモリ管理モデル比較表追加
- 循環参照への対応方針(weak参照導入計画)を明記
- MIR13との相互作用を説明
- 関連研究の比較表で位置付けを明確化

また、AI先生方のレビュー記録をアーカイブに保存。
開発は2025-08-09開始、約1ヶ月での成果。

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 05:48:56 +09:00
b68b4a4c89 docs: codex-keep-two無限ループ暴走問題の調査記録
ChatGPTのstring_smoke.nyash実行が無限ループ(CPU 99.9%)に
陥る問題を調査。原因はarchive/codex-keep-two-loop.shの
while trueによる無限監視ループだったことを確認。

現在は安全な単発実行版(codex-keep-two.sh)に置き換え済み。

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-05 19:06: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
e05a385524 phase15: add Cranelift AOT design, LinkerBox spec, and smoke skeleton docs (handoff) 2025-09-05 05:49:26 +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
c45866073d cleanup: 不要なレガシーファイルを削除
- src/interpreter/method_dispatch.rs.legacy: 旧実装を削除
- tests/e2e_plugin_net.rs: archiveディレクトリに移動済み

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:16:48 +09:00
9a1db62238 feat: プラグインFFIとTypeBox/TLVテストの拡張
- plugin_ffi_common: デバッグ情報とコメント追加
- typebox_tlv_diff: 差分テストの詳細化

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:16:34 +09:00
c7a7ac61b7 test: E2Eテストの小規模な改善とクリーンアップ
- 各プラグインテストにTODOコメント追加
- integration_testsのasync関連調整
- MIRフェーズテストのコメント更新

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:16:13 +09:00
d601324b4e docs(p2p): P2PBoxにTODOコメントを追加
- 将来的な機能拡張の計画を記載

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:15:50 +09:00
20428dc6e7 refactor(plugin): プラグインローダーv2のコード整理
- 重複コードの削除
- エラーハンドリングの簡素化
- デバッグログの整理

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:15:32 +09:00
9f32b47041 fix(vm): VMリファクタリング - 小規模な改善
- execute_module_old_movedメソッドのプレースホルダー調整
- コメント整理とコード可読性向上

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:15:20 +09:00
c5637b4de5 docs: AGENTS.mdにCodex非同期ワークフローの実運用メモを追加
- codex-async-notify.shとcodex-keep-two.shの使い方
- プロセス制御と上限設定の詳細
- tmux通知の4行フォーマット説明
- 日本語メモで実際の運用方法を記載

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:15:07 +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
13907292e9 feat(tools): 自律型AI開発システムの実装完了 - Codex非同期実行とプロセス制御
- codex-async-notify.sh: tmux paste-buffer方式で安定化
- codex-keep-two.sh: 正確なプロセスカウント実装
- デフォルト2プロセス制限で暴走防止
- 日本語プロンプト「まだタスクがあれば次のタスクお願いします」で無限ループ実現
- count_running_codex_display()でcomm+argsによる正確な検出

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 20:14:00 +09:00
2ab30ee5d0 feat: Codex完了通知に実行中プロセス数を表示
- 通知メッセージに '(実行中: N)' を追加
- 現在のcodexプロセス数が一目で分かるように改善

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 15:49:45 +09:00
1e43063904 fix: Codex並列実行数をデフォルト2個に制限
- CODEX_MAX_CONCURRENTのデフォルト値を0(無制限)から2に変更
- 暴走防止のためのセーフガード

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 15:39:04 +09:00
69560e0bec feat: Codex非同期実行システムの改良版実装
- codex-async-notify.sh: 並行制御・重複回避・ログ管理機能追加
  - CODEX_MAX_CONCURRENT: 最大同時実行数制御
  - CODEX_DEDUP: 同一タスクの重複起動防止
  - 古いログの自動クリーンアップ機能
  - より堅牢なプロセス検出(pgrep/psフォールバック)

- codex-keep-two.sh: プロセスカウント改善
  - pgrep使用で正確なプロセス検出
  - 日本語メッセージでの状態表示

- AGENT.md: Codex Async Workflow ドキュメント更新

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 15:25:00 +09:00
02d36cc2cb feat: Windows native Egui demo success + Paper C unified strategy
🎉 MAJOR MILESTONE: First successful Windows native Egui application
- Fixed stack overflow in plugin initialization
- Windows Egui demo running with JIT host-bridge
- Complete plugin system validation

📚 Paper C: Unified revolution strategy
- Three-paper approach: MIR13 + BoxCall + Unified
- ChatGPT5's "one representation, two execution" concept
- Complete experimental benchmark planning

🛠️ Technical achievements:
- nyash.exe with Cranelift JIT on Windows
- nyash_egui_plugin.dll (4.39MB) successful build
- VM + JIT + host-bridge integration working
- apps/egui-hello/main.nyash: open→uiLabel→run→close pipeline

🔬 Research foundation:
- docs/papers/active/paper-c-unified-revolution/ complete structure
- Benchmark experiments ready for Load/Store elimination validation
- AI-collaborative development methodology documented

This represents Phase 15 self-hosting technical foundation completion.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 12:15:30 +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
7455c9ec97 Phase 12.7: Nyash文法革命とANCP 90%圧縮技法の発見 - 文法改革完了とFunctionBox実装 2025-09-03 20:03:45 +09:00
6d79d7d3ac grammar(P0): add peek expression, continue statement, and field type annotations acceptance; add sample apps and interpreter path\n\n- tokenizer: add keywords (peek, continue), tokens (=> as FatArrow, :: as DoubleColon), keep >> as Arrow\n- parser: implement peek as expression (literal patterns only, else required), add continue; accept field 'name: Type' (discard type P0)\n- interpreter: evaluate PeekExpr; add Continue control flow handling\n- apps: add peek-demo, loop-continue-demo, adjust field-decl demo; use ConsoleBox instead of env.console for interpreter backend\n- docs: CURRENT_TASK updated earlier for Phase 12.7 P0\n\nNOTE: peek arms currently single-expression (no block expr yet); VM/MIR path does not lower PeekExpr yet; use --backend interpreter for demos 2025-09-03 15:26:15 +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
51e8e7582a JIT host-bridge: add console.warn/error and LowerCore map get/has/set lowering; extern console methods arity widened 2025-09-03 06:14:03 +09:00
a6ce464f0f Extern registry slot+arity; extern trace; vtable Array/String tests 2025-09-03 06:07:02 +09:00
e8f61d878f JIT LowerCore: optionally route Array get/set and Map size to host-bridge symbols when NYASH_JIT_HOST_BRIDGE=1 2025-09-03 06:03:26 +09:00
294b45b9f4 Phase 12: extern registry + diagnostics, JIT host-bridge PoC by-slot, vtable Map.set + VT/PIC tracing, and tests 2025-09-03 05:56:57 +09:00
0722b410a1 Phase 12: add wasm_v2 scaffold (unified vtable slots), expand host by-slot (Map/String), STRICT extern diagnostics, identical-exec console.log test, and CLAUDE_WASM_TASK handoff 2025-09-03 05:41:33 +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
e2e25f6615 論文フォルダ整理: ChatGPT5提案による2本立て構造に再編成
- 論文A: MIR13命令とIR設計 (コンパイラ・PL実装者向け)
  - ArrayGet/Set → BoxCall統合による50%削減
  - IC/AOT/TypedArray最適化
  - Everything is Box哲学のMIR実装

- 論文B: Nyash言語と実行モデル (言語理論・分散システム向け)
  - init/fini対称性メモリ管理
  - P2P Intentモデル
  - 多層実行アーキテクチャ(Interpreter→VM→JIT→AOT→WASM)

既存のmir15-fullstack/unified-lifecycleはarchiveに移動
2025-09-03 03:06:24 +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
d52779dc10 jit: ops_ext delegation + M3 syntax scaffolding; unify BoxCall execution path 2025-09-02 17:12:51 +09:00
5a5e09b69a jit: split CraneliftBuilder to builder/cranelift.rs and hub-ify builder.rs; stabilize jit-direct (seal/fb TLS/end_function); prep for core.rs split (no behavior change) 2025-09-02 13:30:04 +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
05bf22cdf6 JIT lower/builder リファクタリング: モジュール分割による整理
## 🔧 builder.rs のモジュール分割
- noop.rs: NoopBuilder実装を独立モジュールへ
- object.rs: ObjectBuilderの実装を分離
- rt_shims.rs: ランタイムシムパス関連を整理

## 目的
- 2000行超のbuilder.rsを責務単位で分割
- 可読性とメンテナンス性の向上
- 各ビルダー実装の独立性を確保

ChatGPT5による大規模リファクタリング作業の一環

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 12:18:43 +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
eedfcedc61 Add string_bridge_full.nyash rich demo and enhance e2e script color/auto bin selection; keep VM/AOT flow intact 2025-08-31 00:22:55 +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