Concatenative programming language

From Wikipedia, the free encyclopedia
Jump to: navigation, search

A concatenative programming language is a point-free programming language in which all expressions denote functions and the juxtaposition of expressions denotes function composition.[1] The combination of a compositional semantics with a syntax that mirrors such a semantics makes concatenative languages highly amenable to algebraic manipulation.[2]

Much of the original work on concatenative language theory was carried out by Manfred von Thun.

Properties[edit source | edit]

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.[3]
  • 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.[4]
  • Concatenative languages can be made well-suited to an implementation inspired by linear logic where no garbage is ever generated.[5]

Implementations[edit source | edit]

The first concatenative programming language was Forth, although Joy was the first language to call itself concatenative. Other concatenative languages are Cat, Enchilada, Factor, Onyx, PostScript, RPL, Staapl, Trith, XY, and Om.

Most existing concatenative languages are stack-based; this is not a requirement and other models have been proposed.[6][7][8] Concatenative languages are currently used for embedded, desktop, and web programming, as target languages, and for research purposes.

Most concatenative languages are dynamically typed. One exception is the statically typed Cat language.[9]

See also[edit source | edit]

References[edit source | edit]

  1. ^ "Christopher Diggins: What is a concatenative language". Drdobbs.com. 2008-12-31. Retrieved 2013-07-01. 
  2. ^ Rationale for Joy, a functional language[dead link]
  3. ^ Joy compared with other functional languages.
  4. ^ von Thun, Manfred: Mathematical foundations of Joy[dead link]
  5. ^ "Henry Baker: Linear Logic and Permutation Stacks — The Forth Shall Be First". Home.pipeline.com. Retrieved 2013-07-01. 
  6. ^ "The Concatenative Language XY". Nsl.com. Retrieved 2013-07-01. 
  7. ^ "The Enchilada Programming Language". Enchiladacode.nl. Retrieved 2013-07-01. 
  8. ^ "The Om Programming Language". Om-language.org. Retrieved 2013-07-01. 
  9. ^ "Cat Specification". Cat-language.com. Retrieved 2013-07-01. 

External links[edit source | edit]