Comptime in Ora: Compile-Time Work, Runtime Simplicity
· 6 min read
Smart contracts live in a harsher environment than normal software: execution is expensive, everything is observable, and complexity becomes attack surface. "Good compilation" isn't just about speed—it's about predictability. Smaller runtime code. Fewer branches. Fewer guards. Less that can go wrong.
Ora's comptime pipeline exists to enforce that. When an expression is provably constant, the compiler evaluates it during compilation, replaces it with a literal, and lets the rest of the pipeline operate on something simpler than what the developer wrote.
That sounds obvious. In practice, it's one of the places where many smart-contract toolchains accumulate accidental complexity.
