Stage 1 Implementation (208 lines): - 6 callee types: Global/Method/Constructor/Extern/Closure/Value - CallEmitBox reuse: 60% of functionality already implemented - JSON generation only (C++ backend handles LLVM IR) Builder Integration: - Added MirCallInst import and delegation methods - 10 instructions complete: const, binop, compare, ret, branch, jump, copy, phi, loopform, mir_call Tests (333 lines): - Unit tests: 6 tests covering all callee types (288 lines) - Smoke test: Global function call verification (45 lines) Build Status: - Rust build: SUCCESS (0 errors) - Test execution: PENDING (Phase 33 environment setup required) Code Reduction: - Python mir_call.py: 641 lines - Hakorune mir_call.hako: 208 lines - Reduction: -67.5% (using existing CallEmitBox) Next Steps: - Stage 2-6: Complete implementation - CallEmitBox.make_mir_call_closure/value additions - C++ backend integration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Hakorune Lang Line — Rust-less Kernel (C ABI)
Scope
- This
lang/tree hosts the script-driven C ABI kernel artifacts for Phase 20.9+. - Goal: keep the runtime data plane callable without Rust on the hot path (Hakorune → LLVM → C ABI).
Principles
- Separation: do not mix Rust crates or cargo-specific layout under this tree.
- Ownership & ABI:
- Any
char*returned across the ABI is owned by the callee and must be freed viahako_mem_free(). - Do not mix CRT
free()across boundaries.
- Any
- Fail‑Fast: no silent fallbacks. Missing symbols must be observable via short diagnostics.
Layout (initial)
c-abi/— C shim(s) and headers for the minimal kernel surfaceREADME.md— responsibilities, build notes, platform caveatsinclude/— public headers (mirrored or thin wrappers)shims/— libc-backed shim(s) for canaries and local testing
Build & Link (dev)
- C shim: build a shared library to satisfy symbols for the LLVM line canaries.
- Link flags example:
- Linux:
-L$(pwd)/target/release -Wl,-rpath,$(pwd)/target/release -lhako_kernel_shim
- Linux:
Non‑Goals
- Plugin loader, HostBridge router, Box/Type system — kept in Rust.
Selfhost Launcher (AOT)
- Build:
lang/build/build_runner.sh→ produceslang/bin/hakorune - Requirements: LLVM 18 dev (
llvm-config-18) - Run:
lang/bin/hakorune
Notes
- The launcher is minimal and prints a stable line
[lang-launcher] hello. - This binary is a stepping stone towards a full selfhosted CLI built from Hakorune scripts.