Pointfree programming

From Esolang
Jump to navigation Jump to search

Pointfree programming (or point-free programming or tacit programming) is a style of programming where you don't use bindings (names) for local variables or function arguments, and instead manipulate values in other ways, such as by composing builtin functions.

Pointfree programming is mandatory in several programming languages:

  • Certain stack-based concatenative languages, such as Underload or Wikipedia:Joy (programming language), where values are stored on a stack and can be rearranged on the stack by stack rearrangement builtins
  • Functional languages based on Combinatory logic, such as Unlambda or SKI calculus or BCKW calculus (the latter two mentioned in Combinatory logic), where functions are curried, and builtin functions allow you to compose multi-argument functions.
  • Functional languages such as Amicus and also Amycus, where functions take a tuple (they aren't curried), and primitives to compose multi-argument functions. John Backus's Wikipedia:FP (programming language) is an early conceptual (used on paper only, not in computer) non-esoteric programming language that was built on this archetype and uses tuples. A further development of Backus FP is FP trivia (even with instance variables that correspond to the pointfree style).

APL (derivatives Jelly, J, and K) is said to belong to this category.

Pointfree programming style is also sometimes used in some other languages that have named variables, so this isn't the only possible style. Such languages include Wikipedia:PostScript (which has named mutable global variables and mutable arrays so you can write programs in a style used in early BASIC or FORTRAN), and Wikipedia:Haskell (programming language) (which has lambdas and let expressions so you can write programs somewhat similar to those in lambda calculus or lisp, although Haskell is strongly typed so there are differences).