Metaprogramming

Metaprogramming, and reflection (computational reflection ), describes the ability of programs to analyze themselves and change their behavior. The Reflection is the attenuated form of metaprogramming, which values ​​can be changed, but the structure remains fixed.

Metaprogramming arose from the desire to develop adaptive software systems that are easy to adapt to changing conditions either at run time or within the development phase.

It is the programming Programming: The program code is generated by other program code. In the simplest case, the output of the generating program itself is a program in the same or another programming language. Some programming languages ​​provide for metaprogramming separate mechanisms.

Classification

Metaprogramming can be classified according to various criteria:

After processing time:

  • Statically (at compile time)
  • Dynamically (at runtime )

Following languages:

  • Homogeneous ( meta-language is object language )
  • Heterogeneous ( otherwise )

After steps:

  • Multi-level (object language itself metalanguage )
  • Stage (otherwise )

Examples

The macro system of Lisp is the most powerful implementation of it, since the macros can be formed at the level of the parse tree by the special structure of the language. But even simpler scenarios are strictly for metaprogramming, such as the generation of JavaScript code to the browser by a server-side PHP script.

C metaprogramming refers to the technique of meta-programming within the C programming, so a technique to be generated in C code from other program code.

Other programming languages ​​that support metaprogramming are: Python, Ruby, Scheme, Smalltalk, Self, Snap! / BYOB.

Metaprogramming the human biocomputer

According to the neurophysiologist John Cunningham Lilly metaprogramming describes the transposition by meta programming of the human biocomputer.

566272
de