A compiled programming language is a language whose programs are typically transformed ahead of time into low-level instructions that a processor can run directly. In this workflow a human-readable programming language source file is given to a compiler, which performs analysis and code generation to produce machine-level output such as machine code. The result of compilation is often packaged into an executable file or a library that can be loaded and executed without re-reading the original source.
How compilation works
Compilation is a multi-stage process. Typical phases include lexical analysis, parsing, semantic checking, optimization and code generation. A compiler reads a program and builds internal representations (abstract syntax trees, intermediate code) that it transforms and then lowers into instructions the target hardware understands. Some toolchains produce native machine code for a specific processor family; others produce intermediate bytecode for a virtual machine.
Characteristics and trade-offs
- Performance: Compiled code usually runs faster because the machine-level instructions are ready to execute without further translation.
- Portability: Native compilation targets a specific architecture; portability requires recompiling or producing architecture-independent bytecode.
- Build time: Programs must be compiled before execution, which adds a separate build step compared with some interpreted workflows.
- Tooling: Static analysis, optimization, link-time checks and ahead-of-time error detection are commonly available in compiled-language toolchains.
History and development
Compilation has been central to programming since the 1950s, when early compilers translated high-level constructs into assembly or machine instructions. Over decades the technology evolved: compilers became more sophisticated in optimization, supported multiple back ends and introduced concepts such as just-in-time compilation that blur the line between compiled and interpreted strategies.
Uses and examples
Compiled languages are widely used where performance or low-level control matters: systems software, device drivers, high-performance applications and many desktop programs. Some well-known languages are typically compiled, while others can be implemented either way. Examples often cited for compiled implementations include Java (compiled to bytecode then run by a VM), Lisp (many implementations compile to machine code or bytecode), and Python (commonly interpreted but also compiled to bytecode or native code by specialized compilers). The diversity of implementations means a language's classification can depend on how it is used in practice.
Distinctions and notable facts
Compiled and interpreted are convenient categories but not absolute: some environments compile ahead-of-time, others compile just-in-time, and some mix interpretation and compilation to gain flexibility and performance. Scripting languages are often associated with interpretation for ease of interactive use, while system-level languages are more commonly compiled. The choice between compilation models affects startup time, runtime speed, portability and developer workflow.
Understanding the compilation model a language uses helps developers choose tools and optimize performance. For further exploration of compilers, build systems and runtime trade-offs see language documentation and compiler project pages: language overview, compiler internals, executable formats, and implementation notes for Java, Lisp and Python.