Compile Time

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 at compile time.

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, that the amount of storage required by types and variable 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 bound), 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.

Other articles related to "compile, time, times, compile time":

Template Metaprogramming
... The output of these templates include compile-time constants, data structures, and complete functions ... The use of templates can be thought of as compile-time execution ... support similar, if not more powerful compile-time facilities (such as Lisp macros), but those are outside the scope of this article ...
C Plus Plus - Language Features - Templates
... Templates may be parameterized by types, compile-time constants, and other templates ... C++ templates are implemented by instantiation at compile-time ... This is in contrast to run-time generics seen in other languages (e.g ...
Optimizing Compiler - Specific Techniques - Loop Optimizations
... such as j = 4*i + 1, it can be updated appropriately each time the loop variable is changed ... When two adjacent loops would iterate the same number of times (whether or not that number is known at compile time), their bodies can be combined as long as they make no reference to each other's ... Additionally, if the initial condition is known at compile-time and is known to be side-effect-free, the if guard can be skipped ...
Compile Time Function Execution - Example
... In earlier versions of C++, template metaprogramming is often used to compute values at compile time, such as template struct Factorial { enum { value. 1 return n * factorial(n - 1) } // computed at compile time const int y = factorial(0) // == 1 const int x = factorial(4) // == 24 This example specifies a valid D ... tells the compiler that the initializer for the variables must be computed at compile time ...

Famous quotes containing the words time and/or compile:

    Age: I go slower as time goes faster.
    Mason Cooley (b. 1927)

    If I were a maker of books I should compile a register, with comments, of different deaths. He who should teach people to die, would teach them to live.
    Michel de Montaigne (1533–1592)