HOME

TheInfoList



OR:

In computer science, function-level programming refers to one of the two contrasting
programming paradigm Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms. Some paradigms are concerned mainly with implications for the execution model of the language, suc ...
s identified by
John Backus John Warner Backus (December 3, 1924 – March 17, 2007) was an American computer scientist. He directed the team that invented and implemented FORTRAN, the first widely used high-level programming language, and was the inventor of the Backu ...
in his work on programs as mathematical objects, the other being
value-level programming Value-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 function-level programming. Backus originally used the term object-level ...
. In his 1977
Turing Award The ACM A. M. Turing Award is an annual prize given by the Association for Computing Machinery (ACM) for contributions of lasting and major technical importance to computer science. It is generally recognized as the highest distinction in comput ...
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 A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
to specifically support the function-level programming style. A ''function-level'' program is variable-free (cf. ''point-free'' programming), since
program variable In computer programming, a variable is an abstract storage location paired with an associated symbolic name, which contains some known or unknown quantity of information referred to as a '' value''; or in simpler terms, a variable is a named con ...
s, 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 In mathematics, a space is a set (sometimes called a universe) with some added structure. While modern mathematics uses many types of spaces, such as Euclidean spaces, linear spaces, topological spaces, Hilbert spaces, or probability spaces ...
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 function In computer science and computer programming, a function f is said to be strict if, when applied to a non-terminating expression, it also fails to terminate. A strict function in the denotational semantics of programming languages is a function ''f ...
s 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 In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
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 function In mathematics and computer science, a higher-order function (HOF) is a function that does at least one of the following: * takes one or more functions as arguments (i.e. a procedural parameter, which is a parameter of a procedure that is its ...
s (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 In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running, or continue to run forever. Alan Turing proved in 1936 that a g ...
, 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 Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection ( if/then/else) and repetition ( ...
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 A concatenative programming language is a point-free computer programming language in which all expressions denote functions, and the juxtaposition of expressions denotes function composition. Concatenative programming replaces function appl ...
*
Functional programming In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
,
declarative programming In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow. Many languages that ap ...
(compare) * Tacit programming *
Value-level programming Value-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 function-level programming. Backus originally used the term object-level ...
,
imperative programming In computer science, imperative programming is a programming paradigm of software that uses statements that change a program's state. In much the same way that the imperative mood in natural languages expresses commands, an imperative program ...
(contrast)


References


External links


Function Level Programs As Mathematical Objects
from John Backus * From Function Level Semantics to Program Transformation and Optimizatio
SpringerLink
see point 1.2 and 1.3
Closed applicative languages, FP and FL
in John W. Backus (Publications) or the origina
Programming Language Semantics and Closed Applicative Languages
* Instance variables,
way out
of the variable abstinence {{DEFAULTSORT:Function-Level Programming Programming paradigms Programming language theory