Skip to main content

Native Compiler Toolchain

● PARTIAL(The native AOT path is under development; Windows x86-64 is the end-to-end tested target)

The native toolchain is a separate path from the existing VIR-based interpreter, JIT, and Cranelift AOT paths. It lowers a supported subset of Adesh HIR into Machine IR, emits an ADOB object, and uses adeshlink to produce a native executable.

Planned for v0.4.0: The native compiler and linker improvements described here are planned for the AdeshLang v0.4.0 release. They are not part of the current v0.3.0 release. This does not mean every target or feature listed on this page will be production-ready in v0.4.0.

Pipeline​

Adesh source
│
▼
Frontend and HIR
├──► VIR ──► interpreter, bytecode, Cranelift JIT/AOT, and other backends
│
└──► partial native HIR lowering
│
▼
Machine IR ──► x86-64 codegen ──► ADOB object ──► adeshlink ──► executable

The native HIR lowerer currently handles integer literals and operations, comparisons, let/assignment, if/while/blocks, returns, calls to user functions, and print/println. Unsupported lowering cases are not a promise of full language support. The x86-64 backend covers an integer general-purpose register subset; it does not yet implement floating-point/SIMD instructions or atomics.

Current status​

ComponentStatus
HIR-to-Machine-IR loweringPartial; only a subset of statements and expressions is handled
x86-64 codegenSubstantial for integer GPR operations, control flow, calls, and stack arguments
AArch64 and RISC-V codegenProof-of-concept; four basic instruction forms per backend
ADOB v1.0Implemented; writer validates objects before encoding
Windows x86-64 PE linkingEnd-to-end tested by executing produced binaries
ELF linkingStatic executable emission only; not execution-tested
Mach-O linkingSkeletal; not yet suitable for normal macOS executables
Linker WASM outputStub implementation; separate from the compiler's WASM backend
Shared libraries and LTOUnsupported; --shared and --lto fail with errors

The x86-64 calling convention supports register arguments, stack arguments, and the Win64 shadow space. Aggregate-by-value arguments, structure returns, floating-point/vector argument registers, and variadic calls are not supported. Wide signatures also have a known parallel-move limitation.

# Emit an ADOB object from the supported native source subset.
adesh build main.adesh --emit-adob -o build/main.adob

# Validate and inspect it.
adesh adob validate build/main.adob
adesh adob inspect build/main.adob

# Link for the host target.
adeshlink build/main.adob -o build/main.exe

The final output format depends on the selected target and linker implementation. The Windows x86-64 PE path is the one verified by an end-to-end execution test. ELF output is currently static-only and has not been run-tested; Mach-O output is skeletal.

adesh build without --emit-adob still uses the existing Cranelift AOT path for executable builds. ADOB emission is an explicit native-toolchain path, not the default compiler backend.