Content deleted Content added
Diego Moya (talk | contribs) (edited with ProveIt) |
Diego Moya (talk | contribs) Example (edited with ProveIt) |
||
Line 3:
A '''concatenative programming language''' is a [[Point-free programming|point-free]] programming language in which all expressions denote [[Function (mathematics)|functions]] and the [[juxtaposition (mathematics)|juxtaposition]] of expressions denotes [[function composition]].<ref name="dobbscodetalk">{{cite web|url=http://drdobbs.com/blogs/architecture-and-design/228701299 |title=Christopher Diggins: What is a concatenative language |publisher=Drdobbs.com |date=2008-12-31 |accessdate=2013-07-01}}</ref> Concatenative programming replaces [[function application]], which is common in other programming styles, with [[function composition (computer science)|function composition]] as the default way to build [[subroutine]]s. Functions and procedures written in concatenative style typically don't represent the data structures they operate on with explicit names or [[identifier#In computer science|identifiers]]; instead, a function is defined as a [[pipeline (software)|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.<ref>{{cite web | url=http://concatenative.org/wiki/view/Concatenative%20language | title=Concatenative language | publisher=Concatenative.org | accessdate=13 September 2013}}</ref>
For example, a sequence of operations in an applicative language like the following:
<source lang="javascript">
y = foo(x)
z = bar(y)
w = baz(z)
</source>
...is written in a concatenative language as a sequence of functions, without parameters:<ref>{{cite web | url=http://concatenative.org/wiki/view/Concatenative%20language/Name%20code%20not%20values | title=Name code not values | publisher=Concatenative.org | accessdate=13 September 2013}}</ref>
<code>foo bar baz</code>
The combination of a compositional [[Semantics of programming languages|semantics]] with a [[Syntax of programming languages|syntax]] that mirrors such a semantics makes concatenative languages highly amenable to algebraic manipulation.<ref>[http://www.latrobe.edu.au/philosophy/phimvt/joy/j00rat.html Rationale for Joy, a functional language]{{dead link|date=July 2013}}</ref>
|