Skip to content

[M4] Finish native code generation and CLI workflow #2

Description

@xeondesk

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions