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 application, which is common in other programming styles, with function composition as the default way to build subroutines.
For example, a sequence of operations in an applicative language like the following:
y = foo(x)
z = bar(y)
w = baz(z)
is written in a concatenative language as a sequence of functions:
x foo bar baz
Functions and procedures written in concatenative style are not value level, i.e. they typically do not represent the data structures they operate on with explicit names or identifiers. Instead they are function level a function is defined as a pipeline, or a sequence of operations that take parameters from an implicit data structure upon which all functions operate, and return the function results to that shared structure so that it will be used by the next operator.
The combination of compositional semantics with a syntax that mirrors such a semantic makes concatenative languages highly amenable to algebraic manipulation of programs; although it may be difficult to write mathematical expressions directly in them. Concatenative languages can be implemented efficiently with a stack machine, and are commonly present implicitly in virtual machines in the form of their instruction sets.
The properties of concatenative languages are the result of their compositional syntax and semantics:
The reduction of any expression is the simplification of one function to another function; it is never necessary to deal with the application of functions to objects.
Any subexpression can be replaced with a name that represents the same subexpression. This is referred to in the concatenative community as factoring and is used extensively to simplify programs into smaller parts.
The syntax and semantics of concatenative languages form the algebraic structure of a monoid.
Cette page est générée automatiquement et peut contenir des informations qui ne sont pas correctes, complètes, à jour ou pertinentes par rapport à votre recherche. Il en va de même pour toutes les autres pages de ce site. Veillez à vérifier les informations auprès des sources officielles de l'EPFL.
The Joy programming language in computer science is a purely functional programming language that was produced by Manfred von Thun of La Trobe University in Melbourne, Australia. Joy is based on composition of functions rather than lambda calculus. It has turned out to have many similarities to Forth, due not to design but to an independent evolution and convergence. It was also inspired by the function-level programming style of John Backus's FP.
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 application, which is common in other programming styles, with function composition as the default way to build subroutines. For example, a sequence of operations in an applicative language like the following: y = foo(x) z = bar(y) w = baz(z) is written in a concatenative language as a sequence of functions: x foo bar baz Functions and procedures written in concatenative style are not value level, i.