Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Metaprogramming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Programming paradigm}} {{About|the computer programming technique|the management technique|Charles Simonyi}} {{Multiple issues| {{More citations needed|date=August 2011}} {{Tone|date=February 2017}} }} '''Metaprogramming''' is a [[computer programming]] technique in which [[computer program]]s have the ability to treat other programs as their [[data]]. It means that a program can be designed to read, generate, analyse, or transform other programs, and even modify itself, while running.<ref>{{cite web |last1=Sondergaard |first1=Harald |date=2013 |url=https://handbook.unimelb.edu.au/view/2013/COMP90053 |title=Course on Program Analysis and Transformation |access-date=18 September 2014}}</ref><ref>{{cite book |last1=Czarnecki |first1=Krzysztof |author-link1=Krzysztof Czarnecki |last2=Eisenecker |first2=Ulrich W. |date=2000 |title=Generative Programming |publisher=Addison Wesley |isbn=0-201-30977-7}}</ref> In some cases, this allows programmers to minimize the number of lines of code to express a solution, in turn reducing development time.<ref>{{cite web|last1=Walker|first1=Max|title=The Art of Metaprogrmming in Java|url=https://newcircle.com/s/post/1267/the_art_of_metaprogramming_in_java_video_jaxconf|website=New Circle|access-date=28 January 2014}}</ref> It also allows programs more flexibility to efficiently handle new situations with no recompiling. Metaprogramming can be used to move computations from [[Runtime (program lifecycle phase)|runtime]] to [[compile time]], to generate code using [[Compile-time function execution|compile time computations]], and to enable [[self-modifying code]]. The ability of a [[programming language]] to be its own [[metalanguage]] allows [[reflective programming]], and is termed ''reflection''.<ref>{{cite web|last1=Krauss|first1=Aaron|title=Programming Concepts: Type Introspection and Reflection|url=https://thesocietea.org/2016/02/programming-concepts-type-introspection-and-reflection/|archive-url=https://web.archive.org/web/20160310192057/https://thesocietea.org/2016/02/programming-concepts-type-introspection-and-reflection/ |access-date=10 March 2016|archive-date=10 March 2016 }}</ref> Reflection is a valuable language feature to facilitate metaprogramming. Metaprogramming was popular in the 1970s and 1980s using list processing languages such as [[Lisp (programming language)|Lisp]]. [[Lisp machine]] hardware gained some notice in the 1980s, and enabled applications that could process code. They were often used for [[artificial intelligence]] applications.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)