Pages

Friday, December 06, 2013

Passive Code Generators

Passive code generators saves typing. They generate a given output from a set of inputs. The generated output is an independant source file. The origin of the file will be forgotten.

Passive code generators can be used for:

Creating new source files: While creating a new source file, some editors automatically add basic code, comments and other auto generated blocks to the file. This is done by using a passive code generator. They can be also used for generating source code control directives or copyright notices.

Performing conversions among programming languages: Passive code generators can be used for performing one time conversion of code from one programming language to another. The conversion need not be 100% accurate. We get to choose how much effort you put into the generator, compared with the energy we spend fixing up its output.

Producing lookup tables and other resources: Many of the earlier graphics systems were using precomputed tables, instead of calculating the trigonometric values, for sine and cosine values. These lookup tables were generated using passive code generators.


- summary of Code Generators, from The Pragmatic Programmer: from Journeyman to Master

No comments:

Post a Comment