Files
hakorune/nyash_box.toml
Selfhosting Dev 13298126c8 fix(llvm): MapBox core-first implementation with plugin fallback by ChatGPT
Implemented elegant solution for MapBox as core box with plugin fallback:

1. Core-first Strategy:
   - Removed MapBox type_id from nyash_box.toml
   - MapBox now uses env.box.new fallback (core implementation)
   - Consistent with self-hosting goals

2. Plugin Fallback Option:
   - Added NYASH_LLVM_FORCE_PLUGIN_MAP=1 environment variable
   - Allows forcing MapBox to plugin path when needed
   - Preserves flexibility during transition

3. MIR Type Inference:
   - Added MapBox method type inference (size/has/get)
   - Ensures proper return type handling

4. Documentation:
   - Added core vs plugin box explanation in nyrt
   - Clarified the transition strategy

This aligns with Phase 15 goals where basic boxes will eventually
be implemented in Nyash itself for true self-hosting.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 23:09:16 +09:00

35 lines
524 B
TOML

# Central plugin type definitions
[CounterBox]
type_id = 7
[CounterBox.methods.inc]
returns = { type = "i64" }
[CounterBox.methods.get]
returns = { type = "i64" }
[MathBox]
type_id = 50
[MathBox.methods.sqrt]
returns = { type = "f64" }
[MathBox.methods.sin]
returns = { type = "f64" }
[MathBox.methods.cos]
returns = { type = "f64" }
[MathBox.methods.round]
returns = { type = "f64" }
[FileBox]
type_id = 6
[FileBox.methods.read]
returns = { type = "string" }
[FileBox.methods.exists]
returns = { type = "bool" }