Metaprogramming (synonym: generative programming): a style of programming in which, in some way, a program writes or modifies some code in some language. Compilers and self-modifying programs are two examples of metaprograms.
Quines are programs that generate themselves as output (without trivial "cheats" such as reading their own source code). The term was coined by Douglas R. Hofstadter, and is named after the famous twentieth-century philosopher Willard V. O. Quine.