Compile time: Difference between revisions
ThomasJMarko (talk | contribs) mNo edit summary |
ThomasJMarko (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
{{Program execution}} |
{{Program execution}} |
||
In [[computer science]], '''compile time''' refers to either the operations performed by a [[compiler]] (the "compile-time operations"), [[programming language]] requirements that must be met by [[source code]] for it to be successfully compiled (the "compile-time requirements"), or properties of the program that can be reasoned about during compilation. Compile time refers to the time duration during which the statements or the time in which the programming code is converted to the machine under stable code (i.e binary code). |
In [[computer science]], '''compile time''' refers to either the operations performed by a [[compiler]] (the "compile-time operations"), [[programming language]] requirements that must be met by [[source code]] for it to be successfully compiled (the "compile-time requirements"), or properties of the program that can be reasoned about during compilation. Compile time refers to the time duration during which the statements or the time in which the programming code is converted to the machine under stable code (i.e binary code) and usually occurs before [[Run time (program lifecycle phase)|runtime]]. |
||
==Overview== |
==Overview== |
Revision as of 18:43, 16 February 2020
Program execution |
---|
General concepts |
Types of code |
Compilation strategies |
Notable runtimes |
|
Notable compilers & toolchains |
|
In computer science, compile time refers to either the operations performed by a compiler (the "compile-time operations"), programming language requirements that must be met by source code for it to be successfully compiled (the "compile-time requirements"), or properties of the program that can be reasoned about during compilation. Compile time refers to the time duration during which the statements or the time in which the programming code is converted to the machine under stable code (i.e binary code) and usually occurs before runtime.
Overview
The operations performed at compile time usually include syntax analysis, various kinds of semantic analysis (e.g., type checks and instantiation of template) and code generation.
Programming language definitions usually specify compile time requirements that source code must meet to be successfully compiled. For example, languages may stipulate that the amount of storage required by types and variables can be deduced.
Properties of a program that can be reasoned about at compile time include range-checks (e.g., proving that an array index will not exceed the array bounds), deadlock freedom in concurrent languages, or timings (e.g., proving that a sequence of code takes no more than an allocated amount of time).
Compile time occurs before link time (when the output of one or more compiled files are joined together) and runtime (when a program is executed). In some programming languages it may be necessary for some compilation and linking to occur at runtime. There is a trade-off between compile-time and link-time in that many compile time operations can be deferred to link-time without incurring extra run-time.
"Compile time" can also refer to the amount of time required for compilation.