World Library  
Flag as Inappropriate
Email this Article

Concatenative programming language

Article Id: WHEBN0000892957
Reproduction Date:

Title: Concatenative programming language  
Author: World Heritage Encyclopedia
Language: English
Subject: Forth (programming language), PostScript, Domain-specific language, Event-driven programming, Logic programming
Collection:
Publisher: World Heritage Encyclopedia
Publication
Date:
 

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.[1] Concatenative programming replaces function application, which is common in other programming styles, with function composition as the default way to build subroutines. Functions and procedures written in concatenative style are not value level, i.e. they typically don't represent the data structures they operate on with explicit names or identifiers; instead they are function level - a function is defined as a pipeline, a sequence of operations that take parameters from an implicit data structure on which all functions operate, and return the function results to that shared structure so that it will be used by the next operator.[2]

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, without parameters:[3]

foo bar baz

The combination of a compositional semantics with a syntax that mirrors such a semantics makes concatenative languages highly amenable to algebraic manipulation of programs;[4] although it may be difficult to write mathematical expressions directly in them.[5] Concatenative languages can be implemented in an efficient way with a stack machine, and are a common strategy to program virtual machines. [5]

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

Properties

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

Implementations

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, Kitten, and Om.

Most existing concatenative languages are stack-based; this is not a requirement and other models have been proposed.[9][10][11] 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.[12]

See also

References

  1. ^ "Christopher Diggins: What is a concatenative language". Drdobbs.com. 2008-12-31. Retrieved 2013-07-01. 
  2. ^ "Concatenative language". Concatenative.org. Retrieved 13 September 2013. 
  3. ^ "Name code not values". Concatenative.org. Retrieved 13 September 2013. 
  4. ^ "Rationale for Joy, a functional language". Archived from the original on 2011-01-15. 
  5. ^ a b "Why Concatenative Programming Matters". Retrieved 13 September 2013. 
  6. ^ Joy compared with other functional languages.
  7. ^ von Thun, Manfred: Mathematical foundations of Joy
  8. ^ "Henry Baker: Linear Logic and Permutation Stacks — The Forth Shall Be First". Home.pipeline.com. Retrieved 2013-07-01. 
  9. ^ "The Concatenative Language XY". Nsl.com. Retrieved 2013-07-01. 
  10. ^ "The Enchilada Programming Language". Enchiladacode.nl. Retrieved 2013-07-01. 
  11. ^ "The Om Programming Language". Om-language.org. Retrieved 2013-07-01. 
  12. ^ "Cat Specification". Cat-language.com. Retrieved 2013-07-01. 

External links

  • concatenative.org: A wiki about concatenative languages
  • Staapl: Forth on Scheme for Embedded Controllers
  • The Enchilada Programming Language
  • The Concatenative Language XY
  • The Om Programming Language
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.