Find the word definition

Wiktionary
metaprogramming

n. (context programming English) Writing of computer programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at runtime that would otherwise be done at compile time.

Wikipedia
Metaprogramming

Metaprogramming is the writing of computer programs with the ability to treat programs as their data. It means that a program could be designed to read, generate, analyse or transform other programs, and even modify itself while running. In some cases, this allows programmers to minimize the number of lines of code to express a solution (hence reducing development time), or it gives programs greater flexibility to efficiently handle new situations without recompilation.

The language in which the metaprogram is written is called the metalanguage. The language of the programs that are manipulated is called the object language. The ability of a programming language to be its own metalanguage is called reflection or reflexivity.

Reflection is a valuable language feature to facilitate metaprogramming. Having the programming language itself as a first-class data type (as in Lisp, Prolog, SNOBOL, or Rebol) is also very useful; this is known as homoiconicity. Generic programming invokes a metaprogramming facility within a language, in those languages supporting it.

Metaprogramming usually works in one of three ways. The first way is to expose the internals of the run-time engine to the programming code through application programming interfaces (APIs). The second approach is dynamic execution of expressions that contain programming commands, often composed from strings, but can also be from other methods using arguments or context. Thus, "programs can write programs." Although both approaches can be used in the same language, most languages tend to lean toward one or the other.

The third way is to step outside the language entirely. General purpose program transformation systems such as compilers, which accept language descriptions and can carry out arbitrary transformations on those languages, are direct implementations of general metaprogramming. This allows metaprogramming to be applied to virtually any target language without regard to whether that target language has any metaprogramming abilities of its own.

Metaprogramming (management)

Metaprogramming is the proposed name of a management technique invented by Charles Simonyi (who also developed Hungarian notation) for organizing the work of a team of programmers. In a 2002 news item 1, The Age noted:

"Simonyi, 54, introduced the concept of metaprogramming at Microsoft, turning it into what people sometimes referred to as a software factory. This was something on which he had written a thesis. The metaprogramming concept did not work out in practice...."

In the 1992 book Accidental Empires (ISBN 0-88730-855-4), Robert X. Cringely gave this description:

"Simonyi's dissertation was an attempt to describe a more efficient method of organizing programmers to write software... the metaprogrammer was the designer, decision maker, and communication controller in a software development group.... individual progammers were allowed to make no design decisions about the project. All they did was write the code as described by the metaprogrammer.... A programmer with a problem or a question would take it to the metaprogrammer, who could come up with an answer or transfer the question to another programmer..."

Category:Software project management

Usage examples of "metaprogramming".

One fragment of the metaprogramming part of his mind recognized that he was in shock, but did not care.

And because he's still basically a little kid, and not fully in control of his own metaprogramming, instead of adjusting his outlook so that he isn't bored anymore, he sneaks out through his bedroom gate (which big-Manni-ghost reprogrammed for him sometime ago so that it would forward to an underused public A-gate that he'd run a man-in-the-middle hack on, so he could use it as a proxy teleport server) then down to the underside of Red Plaza, where skinless things gibber and howl at their tormentors, broken angels are crucified on the pillars that hold up the sky, and gangs of semiferal children act out their psychotic fantasies on mouthless android replicas of parents and authorities.