Incremental compiler

From Wikipedia, the free encyclopedia

Generally a compiler for a programming language is a piece of software that reads in one or more program files in a source language and outputs one or more files containing machine code or some other low level language. Those files then go through additional processes to produce a running program. When a program compiled in that way is run, the compiler is no longer required. This is sometimes referred to as a 'batch compiler', because a batch of files can be compiled to form a complete program before anything starts running.

In contrast, an incremental compiler is part of a running program that uses that compiler. This allows new program items to be compiled at any time, either extending the previously compiled programs or replacing some parts of the program.

Because an incremental compiler is part of the runtime system, source code can be read in at any time, from the terminal, from a file, or possibly from a data-structure constructed by the running program, and translated into a machine code block or function (which may replace a previous function of the same name), and the newly compiled program fragment is then immediately available for use by the running system.

Because of the need for speed of compilation during interactive development and testing the compiled code is likely not to be as heavily optimised as code produced by a standard 'batch compiler', which reads in source code and produces object files that can subsequently be linked and run. However there are counterexamples to this rule.

[edit] Systems that use incremental compilation

[edit] See also