World Library  
Flag as Inappropriate
Email this Article

Function-level programming

Article Id: WHEBN0000899026
Reproduction Date:

Title: Function-level programming  
Author: World Heritage Encyclopedia
Language: English
Subject: Concatenative programming language, FP (programming language), Functional programming, Programming paradigms, FL (programming language)
Collection: Programming Language Theory, Programming Paradigms
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Function-level programming

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:[1]

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.

Contents

  • Introduction 1
  • Contrast to functional programming 2
  • Example languages 3
  • See also 4
  • References 5

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 and, arguably, are often easier to understand and reason about.

Contrast to functional programming

When Backus studied and publicized his function-level style of programming, his message was mostly misunderstood,[2] giving boost to 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 of applicative programming.

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, FPr and J.

See also

References

  1. ^ http://www.stanford.edu/class/cs242/readings/backus.pdf
  2. ^ Hudak, Paul (1989). "Conception, Evolution, And Application Of Functional Programming Languages". ACM Computing Surveys, Vol. 21, No. 3
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.