Higher-order programming: Difference between revisions

Content deleted Content added
No edit summary
Added Ada language to the list
 
(41 intermediate revisions by 29 users not shown)
Line 1:
{{Short description|Programming paradigm}}
'''Higher-order programming''' is a style of [[computer programming|programming]] that exploits the theoretical ability to use functions as values; it is usually instantiated with, or borrowed from, models of computation like the [[lambda calculus]] which make heavy use of [[higher-order function]]s.
{{one source|date=June 2019}}
{{more citations needed|date=June 2019}}
'''Higher-order programming''' is a style of [[computer programming]] that uses software components, like functions, modules or objects, as values. It is usually instantiated with, or borrowed from, models of computation such as [[lambda calculus]] which make heavy use of [[higher-order function]]s. A programming language can be considered higher-order if components, such as procedures or labels, can be used just like data. For example, these elements could be used in the same way as arguments or values.<ref>{{Cite report| author = Reynolds, John C. | title = Proceedings of the ACM annual conference on - ACM '72 | chapter = Definitional Interpreters for Higher-Order Programming Languages | year = 1972 | volume = 2 | pages = 717–740 | isbn = 9781450374927 | publisher = Association for Computing Machinery | chapter-url = https://www.classes.cs.uchicago.edu/archive/2007/fall/22100-1/papers/definterp.pdf | doi = 10.1145/800194.805852 | access-date = December 19, 2021 }}</ref>
 
For example, in higher-order programming, one can pass [[Functionfunction (programming)|functions]] as arguments to other functions and functions can be the [[return value]] of other functions (such as in [[Macromacro (computer science)|macros]] or for [[Interpreterinterpreter (computing)|interpretationinterpreting]]). This style of programming is mostly used in [[functional programming]], but it can also be very useful in 'regular' [[object-oriented programming]]. Prominent examplesA ofslightly languagesdifferent supportinginterpretation thisof arehigher-order [[Perl (programming language)|in Perl]],the [[Ozcontext (programmingof language)|Oz]]object-oriented , [[Python (programming language)|Python]],are [[Rubyhigher (programmingorder language)|Rubymessage]]s, [[Smalltalk]],which [[PHPlet (programmingmessages language)|PHP]],have [[ActionScript]],other [[JavaScript]], [[Lua (programming language)|Lua]], all the [[Lisp programming language]]s (suchmessages as [[Scheme (programming language)|Scheme]])arguments, [[Haskellrather (programmingthan language)|Haskell]], [[C Sharp (programming language)|C Sharp]] (via lambda expressions), [[F Sharp (programming language)|F Sharp]] and [[C (programming language)|C]] (via function pointers)functions.
 
Examples of languages supporting this are [[Ada (programming_language)|Ada]], [[Wolfram Language]], [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]], [[ECMAScript]] ([[ActionScript]], [[JavaScript]], [[JScript]]), [[F Sharp (programming language)|F#]], [[Haskell (programming language)|Haskell]], [[Lisp (programming language)|Lisp]] ([[Common Lisp]], [[Scheme (programming language)|Scheme]], [[Clojure]], others), [[Lua (programming language)|Lua]], [[Oz (programming language)|Oz]], [[Perl]], [[PHP]], [[Prolog]],<ref name=Naish1996>{{Cite report | title = Higher-order logic programming in Prolog | year = 1996 | author = Naish, Lee | publisher = Department of Computer Science, University of Melbourne |citeseerx = 10.1.1.35.4505}}</ref> [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Smalltalk]], [[Scala (programming language)|Scala]], [[ML (programming language)|ML]], and [[Erlang (programming language)|Erlang]].
==External links==
* [http://w3future.com/html/stories/hop.xml "Higher Order Programming"] by Sjoerd Visscher (Uses JavaScript)
 
==See also==
{{compu-prog-stub}}
*[[Prolog#Higher-order programming]]
*[[Higher-order logic programming]]
 
==References==
{{reflist}}
 
==External links==
* [http://w3future.com/html/stories/hop.xml "Higher Order Programming"] by Sjoerd Visscher (Uses JavaScript as example language)
 
[[Category:Programming paradigms]]
 
 
{{compu-prog-stub}}