Goal
Complete the native code generation milestone from MIR to runnable executables.
Current state
LLVM IR emission and Clang linking work for numeric recursive functions. tsnative check, emit-ir, build, and run work for the Fibonacci entry fixture using a minimal C startup wrapper.
Scope
- Add explicit target data layout and calling-convention handling.
- Support the documented print/output intrinsic and minimal startup/runtime ABI.
- Add native lowering for all supported MIR operations, control flow, and locals.
- Improve
build output selection and diagnostics for missing entry points, toolchain failures, and unsupported targets.
- Add native-vs-MIR output tests and symbol/section inspection.
Acceptance criteria
tsnative build app.ts creates a runnable native executable for the host target.
tsnative run app.ts matches MIR evaluator output and exit behavior.
tsnative emit-ir app.ts produces Clang-parseable LLVM IR.
- Unsupported native constructs fail with actionable diagnostics rather than silently changing semantics.
Dependency
M3.
Goal
Complete the native code generation milestone from MIR to runnable executables.
Current state
LLVM IR emission and Clang linking work for numeric recursive functions.
tsnative check,emit-ir,build, andrunwork for the Fibonacci entry fixture using a minimal C startup wrapper.Scope
buildoutput selection and diagnostics for missing entry points, toolchain failures, and unsupported targets.Acceptance criteria
tsnative build app.tscreates a runnable native executable for the host target.tsnative run app.tsmatches MIR evaluator output and exit behavior.tsnative emit-ir app.tsproduces Clang-parseable LLVM IR.Dependency
M3.