# Builder functions

Ben Koska, Nov 4, 2026

Builder functions run while your code compiles and emit MLIR of their own, so the hardware-specific part of a program is written once, in Emma.

## Code that writes code

A builder function is called by the compiler, not by your program. What it returns is the MLIR that ends up in the binary.

## Hardware-specific without the fork

Because the builder sees the target, one source file can produce different code for different hardware without a second code path to maintain.
