2270 Commits

Author SHA1 Message Date
7ca298058a Merge pull request #73 from moe-charm/copilot/fix-72
Phase 9.7: Box FFI/ABI + ExternCall Implementation - Universal Library Integration
2025-08-14 18:38:11 +09:00
b8bc41120e Complete Phase 9.7: Box FFI/ABI + ExternCall with working WASM demo
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:59:59 +00:00
2091462441 Implement Phase 9.7: ExternCall instruction and WASM runtime imports
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:56:39 +00:00
9b25330d94 docs: NyIR Core 26命令統一完了 - Universal Exchange Vision基盤確立
## 🌟 主要変更
- NyIR Core: 25命令 → 26命令(ExternCall追加)
- Universal Exchange Vision実現基盤完成
- Everything is Box哲学:外部ライブラリ統一対応

## 📋 完了した統一作業
-  docs/nyir/spec.md: 26命令正式仕様確定
-  docs/nyir/vision_universal_exchange.md: ChatGPT5ビジョン統合
-  docs/予定/native-plan/copilot_issues.txt: 実装計画全面更新
-  Extension戦略再定義: 言語固有機能に限定

## 🎯 26命令完全定義
**Tier-0 (8命令)**: Const, BinOp, Compare, Branch, Jump, Phi, Call, Return
**Tier-1 (13命令)**: NewBox, BoxFieldLoad, BoxFieldStore, BoxCall, **ExternCall**,
                   Safepoint, RefGet, RefSet, WeakNew, WeakLoad, WeakCheck, Send, Recv
**Tier-2 (5命令)**: TailCall, Adopt, Release, MemCopy, AtomicFence

## 🔥 ExternCall革命
外部ライブラリをBox統一APIで利用する革命的機能追加

## 📚 新規ドキュメント
- docs/nyir/: NyIR公開仕様フォルダ新設
- box_ffi_abi.md: Box FFI/ABI完全設計(ChatGPT5)
- phase_9_7実装仕様: GitHub Issue #72準備完了

## 🚀 次期タスク
Phase 9.7: Box FFI/ABI実装(Issue #72)
- MIR ExternCall命令実装
- WASM RuntimeImports統合
- Universal Library Integration実現

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 17:26:04 +09:00
5cebf4c1f7 Merge pull request #71 from moe-charm/copilot/fix-70
Fix SocketBox state consistency bug - isServer() method now works correctly after bind()
2025-08-14 17:18:35 +09:00
d5fae25dc9 Fixed SocketBox state consistency bug - isServer() now works correctly after bind()
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:17:04 +00:00
4548d5acbd SocketBox state sharing partially fixed - isServer works, listener Arc issue remains
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:12:30 +00:00
e3be02db47 Diagnosed Arc sharing issue in SocketBox cloning - complex race condition
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:03:48 +00:00
5730d2fa0f Identified root cause of SocketBox bug - local variable clone issue
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 07:51:06 +00:00
1bcd425edb Merge pull request #69 from moe-charm/copilot/fix-68
Fix WASM Jump/Branch instructions and HTTPServer listen() functionality
2025-08-14 16:21:36 +09:00
99858ecfaa Add demo showing Phase 9.51 fixes working together
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 07:16:40 +00:00
85a5ce053d Fix WASM Jump/Branch implementation and HTTPServer listen() functionality
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 07:14:45 +00:00
d1c82cfb28 Merge pull request #67 from moe-charm/copilot/fix-62
🌐 Phase 9.5: Complete HTTP Server Infrastructure for AOT Validation
2025-08-14 15:27:01 +09:00
2d3abcbfc0 Phase 9.5 HTTP Server Infrastructure Complete: Comprehensive demo and testing validation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 06:24:12 +00:00
004b6b7953 Complete HTTP server infrastructure integration and test basic functionality
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 06:20:45 +00:00
212b46825f Implement HTTP server infrastructure: SocketBox, HTTPServerBox, HTTPRequestBox, HTTPResponseBox
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 06:10:52 +00:00
19d4d0632f Initial analysis: Phase 9.5 HTTP Server implementation plan
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 05:59:08 +00:00
f4f0473ccf Merge pull request #66 from moe-charm/copilot/fix-65
Add string constant support to WASM backend
2025-08-14 14:45:16 +09:00
626572a012 Fix WASM import expectations and validate complete implementation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 05:35:17 +00:00
c1ae84ce61 Implement basic WASM string constant support
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 05:31:36 +00:00
0fd094dafb Merge pull request #63 from moe-charm/copilot/fix-61
🚀 Phase 9: Implement AOT WASM compilation with wasmtime precompilation
2025-08-14 13:59:03 +09:00
a5bcf95bdd Complete Week 1 AOT implementation with working CLI and .cwasm generation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 04:44:26 +00:00
db9bcd3b45 Implement AOT backend infrastructure with CLI integration
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 04:38:20 +00:00
8443635380 feat: Phase 9実用優先戦略・詳細設計ドキュメント完成
Phase 8完全完了記念!実用価値最大化でPhase 9開始準備完了:

📋 新規作成ドキュメント:
- phase9_aot_wasm_implementation.md: AOT WASM実装詳細設計
  * wasmtime compile統合実装
  * 単一バイナリ梱包戦略
  * 2-3週間実装ステップ
- phase9_5_http_server_validation.md: HTTPサーバー実用テスト設計
  * 並行処理・メモリ管理検証
  * AOT性能実証計画
  * 配布可能サーバーデモ

🔄 既存ドキュメント更新:
- phase9_jit_baseline_planning.md: 実用優先戦略変更通知
- phase10_aot_scaffolding.md: LLVM Direct AOT完全再設計
- CURRENT_TASK.md: Phase 8完了・Phase 9戦略開始

🎯 実装目標:
- nyash --compile-native app.nyash -o app.exe
- 配布可能実行ファイル生成(500倍高速化目標)
- Everything is Box哲学のネイティブ最適化基盤

🚀 期待効果:
- 「おもちゃ言語」からの卒業
- 短期間で確実な実用価値提供
- Phase 10 LLVM最適化への技術基盤確立

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 13:10:53 +09:00
890b58a19e docs: 実用優先戦略でPhase 9-10完全再設計
Phase 8.6+8.7完了受けて、実用価値最大化戦略に基づく設計変更:

📋 Phase 9-10再設計:
- Phase 9: JIT planning → AOT WASM実装(最優先・2-3週間)
- Phase 9.5: HTTPサーバー実用テスト追加(AOT検証・2週間)
- Phase 10: AOT exploration → LLVM Direct AOT(最高性能・4-6ヶ月)
- Cranelift JIT: Phase 12以降の将来オプションに変更

🎯 実用優先戦略の根拠:
- WASM既に動作済み(13.5倍高速化実証済み)
- AOT実装で即座配布価値提供
- Cranelift JITは重複投資(Rust開発環境改善効果限定)
- 時間効率:2-3ヶ月節約でLLVM集中投資

🚀 期待効果:
- `nyash --compile-native app.nyash -o app.exe` 実現
- 配布可能HTTPサーバーデモ(Phase 9.5)
- Everything is Box哲学のネイティブ最適化
- 1000倍高速化目標(Phase 10)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 13:00:44 +09:00
0e1b3c2c31 Merge pull request #60 from moe-charm/copilot/fix-59
Fix VM BoxCall implementation to return actual method results instead of void
2025-08-14 12:56:43 +09:00
87918b0b3e Complete Phase 8.7: VM BoxCall fix + comprehensive memory management testing
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 03:53:35 +00:00
bf51d3c71b Expand VM BoxCall support - add StringBox substring/concat and ArrayBox methods
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 03:46:06 +00:00
d26b365791 Fix VM BoxCall implementation - now returns actual method results
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 03:39:08 +00:00
3d04c7766d Merge pull request #58 from moe-charm/copilot/fix-57
Implement Phase 8.5: MIR 25-Instruction Hierarchical Architecture with Ownership Forest Verification
2025-08-14 11:55:40 +09:00
f5f85ef175 Complete Phase 8.5A: MIR 25-instruction hierarchical implementation with working tests and demo
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 02:46:08 +00:00
525747d2b3 Implement Phase 8.5A: Core 25-instruction MIR specification with ownership verification
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 02:39:04 +00:00
ee4228af5a docs(phase-8.5): Add comprehensive MIR 25-instruction specification
• Phase 8.5 complete specification (ChatGPT5 + AI conference decision)
• 25-instruction semantic layering (Tier-0/1/2 structure)
• Effect system (pure/mut/io/control) with optimization rules
• Verifier requirements (ownership forest, weak references, safety)
• Backend implementation guidance (Interpreter/VM/WASM/JIT)
• Two-phase lowering strategy for flexible backend support
• Test strategies (Golden MIR, behavior consistency, performance)

Addresses VM/WASM issues discovered in Phase 8.4 testing:
- VM BoxCall return value problem
- WASM String constant/BoxCall support
- Everything is Box philosophy perfect IR realization

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 11:14:24 +09:00
7d1cdb2935 Merge branch 'main' of github.com-moecharm:moe-charm/nyash 2025-08-14 11:08:14 +09:00
f3ab3d11c4 Merge pull request #56 from moe-charm/copilot/fix-55
Phase 8.4: Complete AST→MIR Lowering for Object-Oriented Features
2025-08-14 11:04:10 +09:00
19011dc389 Add demonstration script showing Phase 8.4 achievements
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 01:49:44 +00:00
cdeb4818a7 Phase 8.4: Complete AST→MIR Lowering - Basic object operations implemented
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 01:48:40 +00:00
c7365d3dc9 feat(merge): integrate Phase 8.3 WASM Box Operations + Benchmark System
🎉 Successful merge of Copilot and Claude implementations:

**Copilot Contributions (Phase 8.3):**
-  WASM Box Operations: RefNew/RefGet/RefSet complete implementation
-  Memory management: BoxLayout, MemoryManager with standard types
-  WASM codegen: Box allocation, field access, type-safe operations
-  Runtime support: malloc, heap management, type ID system

**Claude Contributions (Benchmark System):**
-  Comprehensive benchmark framework (src/benchmarks.rs)
-  CLI integration: --benchmark, --iterations, --output options
-  3-backend performance comparison (Interpreter/VM/WASM)
-  280x WASM speedup verification system
-  Golden dump testing infrastructure

**Unified Features:**
- 🔧 execute_wasm_mode: Supports both output file and stdout
- 🔧 CLI arguments: All options preserved and functional
- 🔧 Error handling: Improved MIR verification messages
- 🔧 Build system: All modules properly integrated

**Next Steps Ready:**
- 📊 MIR diet planning (35→20 instructions)
- 🚀 Phase 8.4: AOT WASM native compilation
- 🧪 Golden dump automation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 08:12:36 +09:00
eaf97401c7 Merge pull request #54 from moe-charm/copilot/fix-53
Phase 8.3: Implement WASM Box Operations - Complete "Everything is Box" in WebAssembly
2025-08-14 08:04:40 +09:00
a0a97620b8 Complete Phase 8.3 WASM Box Operations - Everything is Box in WASM
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-13 22:20:50 +00:00
8ec80a35c3 feat(benchmark): add comprehensive performance benchmarking system
🚀 Phase 8.2 PoC2 Achievement: 280x WASM performance boost proven\!

## New Features:
- Complete benchmark framework (src/benchmarks.rs)
- CLI integration: --benchmark --iterations options
- 3-backend comparison: Interpreter/VM/WASM
- Automated performance measurement & reporting

## Benchmark Results (100 iterations average):
- WASM: 0.17ms (280x faster than Interpreter\!)
- VM: 16.97ms (2.9x faster than Interpreter)
- Interpreter: 48.59ms (baseline)

## Added Files:
- benchmarks/bench_{light,medium,heavy}.nyash - Test cases
- benchmark_summary_20250814.md - Clean results
- wasm_demo/ - Browser execution environment

## Documentation Updates:
- docs/execution-backends.md - Added benchmark usage
- docs/CURRENT_TASK.md - Phase 8.3 Copilot coordination
- CLAUDE.md - Quick benchmark access

## Copilot Integration Ready:
- Phase 8.3 merge conflict avoidance strategy documented
- Benchmark framework ready for Box operation performance validation
- CLI integration preserved for future enhancements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 07:19:23 +09:00
2c485c9444 docs(phase8.3): update Issue #53 with current progress and Copilot guidance
- Update current state with Phase 8.2 PoC2/PoC3 completion
- Add comprehensive test cases for Copilot implementation
- Include implementation guidance and quality assurance checklist
- Add technical baseline info (CLI, browser test env, docs)
- Provide RefNew implementation example for reference

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 06:51:07 +09:00
697223c8cf docs: move execution-backends.md to docs root and add quick access
- Move docs/説明書/execution-backends.md → docs/execution-backends.md
- Add execution backend guide link to CLAUDE.md quick start section
- Update relative path in docs/説明書/README.md
- Improve developer access to VM/WASM execution options

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 06:46:57 +09:00
c42e3560a2 Merge pull request #52 from moe-charm/copilot/fix-51
Phase 8: MIR→WASM Codegen - Complete foundation and basic arithmetic operations
2025-08-14 06:00:31 +09:00
8a7532a77b 🎉 Phase 8.2 PoC1 COMPLETE: MIR→WASM basic arithmetic working end-to-end!
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-13 13:19:43 +00:00
3335f26812 Phase 8.2 PoC1 Progress: WASM codegen mostly working, debugging Return instruction issue
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-13 13:15:02 +00:00
8276eeeb64 Phase 8.1 Complete: WASM backend foundation implementation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-13 13:05:49 +00:00
a25777a31c Merge pull request #47 from moe-charm/copilot/fix-46
🐛 Fix VM missing ret instruction execution - Phase 7 async bug
2025-08-13 21:20:56 +09:00
28070ea2f2 Fix VM execution bug - include terminator instructions in execution loop
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-13 12:18:47 +00:00
42379a3694 docs: update Phase 7 planning and add correct Nyash philosophy test files
- Update CLAUDE.md with 32-thread build option
- Enhance phase7_async_mir.md with detailed implementation plan
- Add Obj class definition to phase6_ref_set_get.nyash
- Create phase6_ref_set_get_correct.nyash following Everything is Box philosophy
2025-08-13 21:06:37 +09:00