HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includi ...
, compile time (or compile-time) describes the time window during which a computer program is compiled. The term is used as an adjective to describe concepts related to the context of program compilation, as opposed to concepts related to the context of program execution ( runtime). For example, ''compile-time requirements'' are
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
requirements that must be met by
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the w ...
before compilation and ''compile-time properties'' are properties of the program that can be reasoned about during compilation. The actual length of time it takes to compile a program is usually referred to as ''compilation time''.


Compile time/Early binding vs Run time

The determination of execution model have been set during the compile time stage. Run time- the method of execution and allocation - have been set during the run time and are based on the run time dynamicity.


Overview

Most compilers have at least the following compiler phases (which therefore occur at compile-time): syntax analysis, semantic analysis, and code generation. During optimization phases, constant expressions in the source code can also be evaluated at compile-time using ''compile-time execution'', which reduces the constant expressions to a single value. This is not necessary for correctness, but improves program performance during runtime. 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 In concurrent computing, deadlock is any situation in which no member of some group of entities can proceed because each waits for another member, including itself, to take action, such as sending a message or, more commonly, releasing a loc ...
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 Capital punishment, also known as the death penalty, is the state-sanctioned practice of deliberately killing a person as a punishment for an actual or supposed crime, usually following an authorized, rule-governed process to conclude that t ...
). Although in the case of dynamic compilation, the final transformations into machine language happen 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 run-time cost.


See also

* Link time * Run time (program lifecycle phase) * Compiling * Type system * Dynamic compilation *
Just in time compilation In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is a way of executing computer code that involves compilation during execution of a program (at run time) rather than before execution. This may con ...
Compiler construction {{Comp-sci-stub