Compile time
This article needs additional citations for verification. (January 2023) |
| Program execution |
|---|
| General concepts |
| Types of code |
| Compilation strategies |
| Notable runtimes |
|
| Notable compilers & toolchains |
|
In computing, compile time is the period of time when a compiler processes source code into other code that is more readily executable – typically object code or byte code.[1] Compile time is a phase in the operational life cycle of a program as it transitions from development to execution. The length of time it takes to compile is usually referred to as compilation time although compile time might also be used.
Compile time can be subdivided by the phases of a compiler. Most compilers have at least the following phases: syntax analysis, semantic analysis, and code generation. Many compilers include one or more optimization phases. For example, each constant expressions might be evaluated via compile-time execution to produce a value that results in improved runtime performance.[2][3]
Properties of a program that can be determined 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). For statically-typed languages such as C++, Java or Rust, types are checked at compile time to ensure type safety.[4]
Compiling is typically part of a build process (at build time). A build may also include linking (at link time). Run time is the duration when the program is running.
Often, compilation occurs as a separate step before running a program. But with dynamic compilation, transformation to machine language happens as part of the process of running it – intertwining run time and compile time. Often this is split into two distinct processes: a build-time process that converts source code to an intermediate representation (IR) and a run-time process that converts the IR to machine code.
See also
- Ahead-of-time compilation – Computer code compilation strategy
- Just-in-time compilation – Compiling bytecode to machine code at runtime
- Type system – Computer science concept
References
- ^ "A History of Computer Programming Languages". Retrieved 2022-12-25.
- ^ Yongwei, Wu (October 7, 2024). "C++ Compile-Time Programming". accu.org. Retrieved 2025-04-26.
- ^ "Compile Time Evaluation". C3. Retrieved 2025-04-26.
- ^ "Data Types - The Rust Programming Language". doc.rust-lang.org. Retrieved 2025-04-26.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.