This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)(Learn how and when to remove this template message)
An incremental compiler is a kind of incremental computation applied to the field of compilation. Quite naturally, whereas ordinary compilers make so called clean build, that is, (re)build all program modules, incremental compiler recompiles only those portions of a program that have been modified.
In imperative programming and software development, an incremental compiler is one that when invoked, takes only the changes of a known set of source files and updates any corresponding output files (in the compiler's target language, often bytecode) that may already exist from previous compilations. By effectively building upon previously compiled output files, the incremental compiler avoids the wasteful recompiling of entire source files, where most of the code remains unchanged. For most incremental compilers, compiling a program with small changes to its source code is usually near instantaneous. It can be said that an incremental compiler reduces the granularity of a language's traditional compiling units while maintaining the language's semantics, such that the compiler can append and replace smaller parts.
Many programming tools take advantage of incremental compilers to provide developers with a much more interactive programming environment. It is not unusual that an incremental compiler is invoked for every change of a source file, such that the developer is almost immediately informed about any compilation errors that would arise as a result of his changes to the code. This scheme, in contrast with traditional compilation, shortens a programmer's development cycle significantly, because they would no longer have to wait for a long compile process before being informed of errors.
One downside to this type of incremental compiler is that it cannot easily optimize the code that it compiles, due to locality and the limited scope of what is changed. This is usually not a problem, because for optimization is usually only carried out on release, an incremental compiler would be used throughout development, and a standard batch compiler would be used on release.
In the interactive programming paradigm, e.g. in Poplog related literature, and  an interactive compiler refers to a compiler that is actually a part of the runtime system of the source language. The compiler can be invoked at runtime on some source code or data structure managed by the program, which then produces a new compiled program fragment containing machine code that is then immediately available for use by the runtime system. If the newly compiled fragment replaces a previous compiled procedure the old one will be garbage collected. This scheme allows for a degree of self-modifying code and requires metaprogramming language features. The ability to add, remove and delete code while running is known as hot swapping. Some interactive programming platforms mix the use of interpreted and compiled code to achieve the illusion that any changes to code are accessible by the program immediately.
List of incremental compilers
- Incremental compilers for imperative language compiling
- The PECAN Programming Environment Generator was an incremental compiler, developed by Steven P. Reiss in the early 1980s.
- GNU Compiler Collection has branched off its development with the IncrementalCompiler project, concentrating in providing C/C++ with a fast incremental compiler
- The Eclipse platform has a Java incremental compiler included as a part of the Java Development Tools project
- The IBM VisualAge C++ compiler 4.0 is an incremental compiler for C++
- Embarcadero Delphi, previously Borland Delphi
- The .NET Compiler Platform (codename Roslyn) is an open source incremental compiler for C# and Visual Basic .NET, and is the default compiler from Visual Studio 2015 onwards
- Incremental compilers in interactive programming environments and runtime systems
- Poplog (its core language POP-11 and its predecessor POP-2)
- Some versions of Lisp:
- Some versions of Scheme:
- Most versions of Prolog:
- Versions of ML:
- Ceylon of Red-Hat
- , teaching primer to Poplog
- The Smith, Sloman and Gibson 1992 paper below (now available online)
- "Steven P. Reiss Home Page". Brown University. 9 June 2011. Archived from the original on 10 February 2013. Retrieved 8 August 2014.
- Popple, James (1987). Incremental Compilation and its Implementation in the PECAN Programming Environment Generator (PDF) (Honours thesis). Australian National University. Archived from the original on 22 June 2011. Retrieved 8 March 2013. Also available at Google Books.
- , the announcement made beginning the IncrementalCompiler branch of GCC
- , a description of the JDT Core Component
- Dr. Dobb's Journal about making an incremental C++ compiler
- R. Smith, A. Sloman and J. Gibson, POPLOG's two-level virtual machine support for interactive languages, in Research Directions in Cognitive Science Volume 5: Artificial Intelligence, Eds. D. Sleeman and N. Bernsen, Lawrence Erlbaum, 1992, pp 203–231