Higher-order programming explained

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 functions. 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.[1]

For example, in higher-order programming, one can pass functions as arguments to other functions and functions can be the return value of other functions (such as in macros or for interpreting). This style of programming is mostly used in functional programming, but it can also be very useful in object-oriented programming. A slightly different interpretation of higher-order programming in the context of object-oriented programming are higher order messages, which let messages have other messages as arguments, rather than functions.

Examples of languages supporting this are Ada, Wolfram Language, C#, Java, ECMAScript (ActionScript, JavaScript, JScript), F#, Haskell, Lisp (Common Lisp, Scheme, Clojure, others), Lua, Oz, Perl, PHP, Prolog,[2] Python, Ruby, Smalltalk, Scala, ML, and Erlang.

See also

External links

Notes and References

  1. Reynolds, John C. . Proceedings of the ACM annual conference on - ACM '72 . Definitional Interpreters for Higher-Order Programming Languages . 1972 . 2 . 717–740 . 9781450374927 . Association for Computing Machinery . https://www.classes.cs.uchicago.edu/archive/2007/fall/22100-1/papers/definterp.pdf . 10.1145/800194.805852 . December 19, 2021 .
  2. Higher-order logic programming in Prolog . 1996 . Naish, Lee . Department of Computer Science, University of Melbourne . 10.1.1.35.4505.