From the Leri FAQ:

"Metaprogramming is becoming aware that you have been programmed already. That your beliefs and values are simply ideas that have been programmed into your brain and nervous system. It is taking charge of and RE-programming yourself! A most excellent experience."

Dr. John Lilly first coined the term metaprogramming in his seminal work, Programming and Metaprogramming the Human Biocomputer. Lilly was an avid explorer of altered states of consciousness, working with various combinations of isolation, LSD and ketamine explorations, and various mental disciplines. He proposed the notion that inasmuch as the brain can be considered the hardware of the mind, the linguistic models that the brain uses to interpret the world -- programs -- can be modified and refined at the discretion of the metaprogrammer. As the psychedelic explosion began to reverberate across America, Dr. Timothy Leary grabbed hold of the concept, proposing that specific, disciplined approaches to the psychedelic experience can be used to do such metaprogramming.

Since then, metaprogramming has become an umbrella term for any number of approaches to self-improvement/self-refinement. Altered states of consciousness are often, but not always, a factor in metaprogramming; similarly, although the psychedelic experience is often linked to metaprogramming, thanks to Dr. Leary's influence, it is by no means the only nor the "most important" method for metaprogramming. For example, yogic disciplines, various mystic practices and disciplines, shamanic traditions, meditation, and many other consciously directed forms of concentration are used and discussed on Leri with reference to willful and positive metaprogramming.

"Programming that does programming": New age "Modern C++ Design" beyond OO Extreme Programming -speak for compile time generation of code, especially in C++. The usual technique there for metaprogramming is template meta-programming (see also discussion of a ubiquitous UN*X tool).

But there really is nothing new about metaprogramming! lex and yacc write (C) programs; they're not a pass of cc, but if you use make you don't really care about that. The C preprocessor also generates code, but that's really simple stuff. If you really wanted to, you could preprocess your C program with a more powerful macro processor (like M4), but most people are sensible enough not to try this.

But there's more to computing than C/C++! A good macro assembler contains a macro language powerful enough to express loops (the big selling point of C++ templates). And it even gives an orthogonal syntax, which templates don't (of course, assembler syntax is simpler than C++ syntax...).

Common Lisp's defmacro is more like it: you learned as a CS undergraduate that let is really just lambda, and that (delay expr) is really just a memoized (lambda () expr). In Lisp, you write a defmacro which does the required translations on the source code, giving a new list.

Scheme goes all the way with hygienic macros and syntax-rules: using a magical syntax that appears to write the let->lambda translation by example, and giving precise safe semantics for the translation.

Computer science has a tendency to give a new name to every concept existing elsewhere. With C++, computer science eats itself: it gives a new name to what it already has! Metaprogramming is the 90's name for 60's macro processing.

Log in or registerto write something here or to contact authors.