Each of them is a specific key in of processor, optimised for its specific function.
A preprocessor, however, doesnt have anything to do with physical processors like the CPU or GPU.
Instead, its a programming term, specifically relating to compiled languages.
Contents
What is a compiler?
A compiler is a piece of software that compiles a specific programming language into machine code.
Some are designed to be interpreted on the fly when the code is being run.
This approach is very flexible making it easy to make minor changes.
Many other programming languages, however, need to be compiled to be able to be executed.
In small programs, this doesnt necessarily take long.
With larger programs though, compilation can take minutes or even hours.
So why would you want to use a language that needs compiling?
Well, its harder to reverse engineer.
Interpreted programming languages often have their code distributed as is, making it easy to steal.
Compiled software also tends to be smaller, as it has been optimised for execution.
So what does a preprocessor do?
A preprocessor is a utility that is run over code before it is compiled.
The preprocessors job is to set up the code exactly as intended.
It primarily does that by performing search and replace functions.
In C, for example, it is standard practice to use a number of standard libraries.
These libraries define a series of functions that provide standard functionality.
To import these libraries the #include keyword is used followed by a library name.
The preprocessor searches through the code for statements like #include and replaces them.
In the case of #include the preprocessor inserts the entire contents of the specified library.