Thursday, October 30, 2025

The next new thing - Ahead-of-Time compilation, native AOT

The newest and coolest thing in compiler technology today is AOT — ahead-of-time compilation.

I just wrapped up a round of upgrades and refactors in the lastest release of my Xecrets Ez app at https://www.axantum.com/, which now uses AOT for the command-line backend on Windows.

Small footprint, fast startup, lower memory pressure. Great stuff!

Why didn’t we think of this before?

Well… we did.

In 1957, the first optimizing Fortran compiler was released. Back then it was simply called a compiler — it was the first of its kind — but yes, it was AOT. See https://web.stanford.edu/class/archive/cs/cs339/cs339.2002/fortran.pdf for an interesting article about it.

Then came P-code, bytecode, and IL-code: intermediate representations for no specific hardware, interpreted on the target machine by an interpreter.

The upside was clear — compile once, run anywhere, with smaller binaries.

The downside? Slow. And everyone wants speed, speed, and more speed.

So we started compiling the bytecode or IL on the target instead of interpreting it. Thus JIT, just-in-time compilation, was born.

But JIT had its own issues — startup latency, memory overhead, and complexity. So we needed to fix that too.

And someone said, “Hey, what if we just… compiled everything from the start?” Brilliant! We’ll call it AOT instead of JIT.

And here we are. The circle closes — for now. I’m already curious about what the next turn of the wheel of time will bring.

No comments:

Post a Comment