ArticleslgStudy

mathematics

Function-level programming

Function-level programming is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Function-level programming rather than just read about it. In short: In computer science, function-level programming refers to one of the two contrasting programming paradigms identified by John Backus in his work on programs as mathematical objects, the other being value-level programming. In his 1977 Turing Award lecture, Backus set forth what he considered to be the need to switch to a different philosophy in programming language design: Programming languages appear to be in troub…

Key takeaways

  • Function-level programming belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Function-level programming to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Function-level programming from memory before moving on to harder problems.

Reference excerpt

In computer science, function-level programming refers to one of the two contrasting programming paradigms identified by John Backus in his work on programs as mathematical objects, the other being value-level programming. In his 1977 Turing Award lecture, Backus set forth what he considered to be the need to switch to a different philosophy in programming language design:

Programming languages appear to be in trouble. Each successive language incorporates, with a little cleaning up, all the features of its predecessors plus a few more. [...] Each new language claims new and fashionable features... but the plain fact is that few languages make programming sufficiently cheaper or more reliable to justify the cost of producing and learning to use them. He designed FP to be the first programming language to specifically support the function-level programming style. A function-level program is variable-free (cf. point-free programming), since program variables, which are essential in value-level definitions, are not needed in function-level programs.

Introduction In the function-level style of programming, a program is built directly from programs that are given at the outset, by combining them with program-forming operations or functionals. Thus, in contrast with the value-level approach that applies the given programs to values to form a succession of values culminating in the desired result value, the function-level approach applies program-forming operations to the given programs to form a succession of programs culminating in the desired result program. As a result, the function-level approach to programming invites study of the space of programs under program-forming operations, looking to derive useful algebraic properties of these program-forming operations. The function-level approach offers the possibility of making the set of programs a mathematical space by emphasizing the algebraic properties of the program-forming operations over the space of programs. Another potential advantage of the function-level view is the ability to use only strict functions and thereby have bottom-up semantics, which are the simplest kind of all. Yet another is the existence of function-level definitions that are not the lifted (that is, lifted from a lower value-level to a higher function-level) image of any existing value-level one: these (often terse) function-level definitions represent a more powerful style of programming not available at the value-level.

Contrast to functional programming When Backus studied and publicized his function-level style of programming, his message was mostly misunderstood as supporting the traditional functional programming style languages instead of his own FP and its successor FL. Backus calls functional programming applicative programming; his function-level programming is a particular, constrained type. A key distinction from functional languages is that Backus' language has the following hierarchy of types:

atoms functions, which take atoms to atoms Higher-order functions (which he calls "functional forms"), which take one or two functions to functions ...and the only way to generate new functions is to use one of the functional forms, which are fixed: you cannot build your own functional form (at least not within FP; you can within FFP (Formal FP)). This restriction means that functions in FP are a module (generated by the built-in functions) over the algebra of functional forms, and are thus algebraically tractable. For instance, the general question of equality of two functions is equivalent to the halting problem, and is undecidable, but equality of two functions in FP is just equality in the algebra, and thus (Backus imagines) easier. Even today, many users of lambda style languages often misinterpret Backus' function-level approach as a restrictive variant of the lambda style, which is a de facto value-level style. In fact, Backus would not have disagreed with the 'restrictive' accusation: he argued that it was precisely due to such restrictions that a well-formed mathematical space could arise, in a manner analogous to the way structured programming limits programming to a restricted version of all the control-flow possibilities available in plain, unrestricted unstructured programs. The value-free style of FP is closely related to the equational logic of a cartesian-closed category.

Example languages

The canonical function-level programming language is FP. Others include FL, and J.

See also Concatenative programming language Functional programming, declarative programming (compare) Tacit programming Value-level programming, imperative programming (contrast)

References

External links Function Level Programs As Mathematical Objects from John Backus From Function Level Semantics to Program Transformation and Optimization SpringerLink see point 1.2 and 1.3 Closed applicative languages, FP and FL, in John W. Backus (Publications) or the original Programming Language Semantics and Closed Applicative Languages Instance variables, a way out of the variable abstinence

Worked examples

Example 1 — a first encounter with Function-level programming

Start with the simplest possible case. Write down what Function-level programming claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Function-level programming before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Function-level programming ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Function-level programming

In research
Function-level programming appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Function-level programming in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Function-level programming is common in secondary-school and first-year university syllabi. It links to neighbouring topics Programming language theory, Programming paradigms, so understanding it makes those chapters shorter.
In everyday life
Look for Function-level programming outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Function-level programming” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Function-level programming in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Function-level programming means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Function-level programming out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Function-level programming in simple terms?

In computer science, function-level programming refers to one of the two contrasting programming paradigms identified by John Backus in his work on programs as mathematical objects, the other being value-level programming. In his 1977 Turing Award lecture, Backus set forth what he considered to be…

Why does Function-level programming matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Function-level programming?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Function-level programming.

Tags

  • Programming language theory
  • Programming paradigms

Keep exploring