Compiled language
A compiled language is a programming language whose implementations are typically compilers (translators that generate machine code from source code), and not interpreters (step-by-step executors of source code, where no pre-runtime translation takes place).
The term is somewhat vague; in principle any language can be implemented with a compiler or with an interpreter. A combination of both solutions is also common: a compiler can translate the source code into some intermediate form (often called bytecode), which is then passed to an interpreter which executes it.
Advantages and disadvantages
Programs compiled into native code at compile time tend to be quicker than those translated at run time, due to the overhead of the translation process. New technologies such as Just-in-time compilation, and general improvements in the translation process are starting to narrow this gap, though. The mixed solution using bytecode tends to have efficiency somewhere in between.
Low-level programming languages are typically compiled, especially when efficiency is the primary concern, rather than cross-platform support. For low level languages, there are more one-to-one correspondences between the programmed code and the hardware operations performed by machine code, making it easier for programmers to control CPU and memory usage in fine detail.
With some effort it is always possible to write compilers even for traditionally interpreted languages. For example, Common lisp can be compiled to Java bytecode, which is interpreted by the Java virtual machine; C code, which is compiled to native machine code; or compiled directly to native code. Programming languages that support multiple compilation targets give greater control to the developer to choose either execution speed or cross-platform compatibility.
Languages
Some languages that are commonly considered to be compiled:
- Ada
- ALGOL
- BASIC
- C
- C++
- Objective-C
- C# (to bytecode)
- CLEO
- COBOL
- Cobra
- Common Lisp
- Crystal
- Delphi
- eC
- D
- Eiffel
- Erlang(to bytecode)
- Factor (later versions)
- Forth
- Fortran
- Go
- Haskell
- Haxe (to bytecode or C++)
- IBM RPG
- Java (to bytecode)
- JOVIAL
- Julia
- G
- Lisp
- Lush
- Mercury
- ML
- Modula-2
- Modula-3
- Nim (to C, Objective-C, or C++)
- Open-URQ
- PureBasic
- Pascal
- PL/I
- Rust
- Scala (to bytecode)
- Seed7
- Swift
- Visual Basic
- Visual Foxpro
- Visual Prolog