compiler

A program that translates source code a person wrote into a form a machine or runtime can execute, checking it for errors on the way.

In more detail

Some compilers, such as those for Go, C and Rust, produce machine code ahead of time, while the C# and Java compilers produce an intermediate form that a runtime compiles again as the program runs. Others translate into another source language, as the TypeScript compiler does with JavaScript. Because the compiler checks the whole program first, many mistakes are reported at build time instead of in production.

Examples

Go: go build runs the compiler; an unused import is a compile error
Java: javac turns .java files into class files full of bytecode, and the JIT compiler inside the JVM later produces native code.
javac Hello.java  # the Java compiler, silent on success
Python is run by an interpreter, although CPython quietly compiles source to bytecode first.
In React projects, compilers turn JSX and TypeScript into JavaScript, and the React Compiler inserts memoization automatically.

Related terms

Taught in

References

Certification courses