Compiler: Difference between revisions
From Coderwiki
More actions
info |
merge in Compiled language |
||
| Line 3: | Line 3: | ||
A compiler generally converts the [[source code]] into [[intermediate representation]], and (possibly) finally into [[machine code]]. | A compiler generally converts the [[source code]] into [[intermediate representation]], and (possibly) finally into [[machine code]]. | ||
== Compiled languages == | |||
A '''compiled language''' is a type of [[programming language]] where, instead of stepping through each [[Computer instructuction|instruction]] of a [[program]] (like an [[interpreted language]]) the [[source code]] is converted into [[machine code]] by a compiler. | |||
=== Advantages of compiled languages === | |||
* Generally much [[Performance|faster execution time]] | |||
* Users do not need to install an [[interpreter]] to execute the [[program]], as compilers usually produce an [[executable file]] | |||
=== Disadvantages of compiled languages === | |||
* Compile times can be long, so [[rapid iteration]] becomes slower | |||
== Bytecode == | |||
For some [[Programming language|programming languages]], instead of directly [[Compiler|compiling]] to [[machine code]], the [[source code]] is instead converted to a format known as [[bytecode]]. | |||
This [[bytecode]] can't be directly executed by the [[Central processing unit|CPU]], but can be interpreted using an [[interpreter]], often known as a [[process virtual machine]]. | |||
Latest revision as of 07:45, 13 August 2025
A compiler is used in order to convert the source code of a compiled language into machine code or bytecode.
A compiler generally converts the source code into intermediate representation, and (possibly) finally into machine code.
Compiled languages
edit edit sourceA compiled language is a type of programming language where, instead of stepping through each instruction of a program (like an interpreted language) the source code is converted into machine code by a compiler.
Advantages of compiled languages
edit edit source- Generally much faster execution time
- Users do not need to install an interpreter to execute the program, as compilers usually produce an executable file
Disadvantages of compiled languages
edit edit source- Compile times can be long, so rapid iteration becomes slower
Bytecode
edit edit sourceFor some programming languages, instead of directly compiling to machine code, the source code is instead converted to a format known as bytecode.
This bytecode can't be directly executed by the CPU, but can be interpreted using an interpreter, often known as a process virtual machine.