Compile time
Encyclopedia
In computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

, compile time refers to either the operations performed by a compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 (the "compile-time operations"), programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 requirements that must be met by source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

 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
Link time
In computer science, link time refers to either the operations performed by a linker or programming language requirements that must be met by compiled source code for it to be successfully linked ....

 (when the output of one or more compiled files are joined together) and runtime (when a program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

 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.

See also

  • Link time
    Link time
    In computer science, link time refers to either the operations performed by a linker or programming language requirements that must be met by compiled source code for it to be successfully linked ....

  • Run time (program lifecycle phase)
  • Compiling
  • Just in time compiling
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK