Selfhosting Dev
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
..
2025-09-07 07:36:15 +09:00
2025-09-06 06:24:08 +09:00
2025-08-28 12:09:09 +09:00
2025-09-07 07:28:53 +09:00
2025-09-01 23:44:34 +09:00
2025-08-30 23:47:08 +09:00
2025-09-06 06:24:08 +09:00
2025-09-06 22:08:58 +09:00
2025-09-08 01:08:59 +09:00
2025-09-05 05:49:26 +09:00
2025-09-07 07:36:15 +09:00
2025-09-01 23:44:34 +09:00
2025-09-02 09:26:09 +09:00
2025-09-05 15:18:13 +09:00
2025-08-29 23:11:21 +09:00
2025-09-08 01:08:59 +09:00
2025-09-01 23:44:34 +09:00
2025-09-06 06:24:08 +09:00
2025-08-30 07:47:21 +09:00
2025-08-26 06:44:13 +09:00
2025-09-06 06:24:08 +09:00
2025-09-05 05:16:21 +09:00
2025-09-05 05:16:21 +09:00
2025-08-24 01:58:41 +09:00
2025-08-26 01:42:18 +09:00
2025-09-01 23:44:34 +09:00
2025-09-07 20:59:18 +09:00
2025-09-07 20:23:39 +09:00
2025-09-04 12:15:30 +09:00
2025-09-08 01:08:59 +09:00
2025-09-06 06:24:08 +09:00
2025-09-10 23:24:02 +09:00
2025-09-04 11:34:15 +09:00
2025-08-31 03:03:04 +09:00
2025-09-04 11:34:15 +09:00
2025-09-07 07:36:15 +09:00
2025-09-05 13:29:17 +09:00
2025-09-05 13:29:17 +09:00
2025-09-05 13:29:17 +09:00
2025-09-07 20:23:39 +09:00
2025-09-05 13:29:17 +09:00
2025-09-07 07:36:15 +09:00
2025-09-05 05:16:21 +09:00
2025-09-04 11:34:15 +09:00
2025-08-23 16:33:32 +09:00
2025-09-06 06:24:08 +09:00
2025-08-30 22:52:16 +09:00
2025-09-02 03:41:51 +09:00
2025-08-29 02:05:39 +09:00
2025-09-06 06:24:08 +09:00
2025-09-05 05:16:21 +09:00
2025-08-26 05:49:23 +09:00
2025-09-07 07:36:15 +09:00
2025-09-07 07:36:15 +09:00
2025-09-07 07:36:15 +09:00
2025-09-07 07:36:15 +09:00
2025-09-08 01:08:59 +09:00
2025-09-08 01:08:59 +09:00
2025-08-24 00:05:12 +09:00