= Compilation
<Compilation> is the translation process performed by a <compiler>, which may include checking and transforming an <abstract syntax tree>. Translation can finish before execution, or happen during execution through <just-in-time compilation>. Reusing the translated representation can avoid repeated <parsing> and repeated <constant folding> when only the inputs change. This does not guarantee a speedup: translation itself costs work, and the choice of representation and execution mechanism matters.
\Image[/compiler-representation-pipeline.png]
{title=One possible <compilation> pipeline for `x*(2+3)-4`, with execution from an <abstract syntax tree>, a <stack machine> instruction sequence, or <machine code>}
{id=image-compiler-representation-pipeline}
Back to article page