Function-level programming

From Esolang
Jump to navigation Jump to search

In the function level style a program is built directly from the programs that are given at the outset, by combining them with program-forming operations. Thus instead of applying the given programs to objects to form a succession of objects culminating in the result object, the function level approach applies program-forming operations to the given programs to form a succession of programs culminating in the desired program. ~ J. Backus[1]

Function-level programming or the function-level style is a technique for programming in the functional paradigm. Instead of lambda binding, function-level programming emphasizes functions as first-class objects and program-forming operations, also called combiners or forms or abbreviated as PFOs.

The original language introducing function-level programming is FP. A variety of languages can be interpreted as function-level, from primitive Turing tarpits like combinatory logic or Unlambda to highly-structured typed languages like Cammy.

A function-level approach may also allow for user-defined and first-class PFOs. In the most extreme case, languages like Cammy or Kernel allow users to define arbitrary PFOs, and Kernel further ensures that PFOs are always first-class.

In terms of category theory, Backus advocates for an algebra of programs to admit the operations of a category with finite products and coproducts: composition, pairing, projection, case analysis, injection, and the implied units.[1]

References

  1. 1.0 1.1 J. Backus, 1981. Function level programs as mathematical objects. Functional Programming Languages & Computer Architecture (FPCA) 1981. https://dl.acm.org/doi/abs/10.1145/800223.806757 https://archive.alvb.in/msc/thesis/reading/backus-fp.pdf