Category:Programming paradigm/Concatenative: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
m (formatting)
 
Line 4: Line 4:
This single data structure is probably a [[stack]]. A concatenative language is probably a ''stack-oriented language''. These languages tend to use reverse Polish notation with postfix operators. Programs push values on the data stack, then operate on those values. For example,
This single data structure is probably a [[stack]]. A concatenative language is probably a ''stack-oriented language''. These languages tend to use reverse Polish notation with postfix operators. Programs push values on the data stack, then operate on those values. For example,


* <tt>3 4 +</tt> might push 7.
* <code>3 4 +</code> might push 7.
* <tt>9 7 -</tt> might push 2.
* <code>9 7 -</code> might push 2.
* The concatenation <tt>3 4 + 9 7 -</tt> might push both 2 and 7.
* The concatenation <code>3 4 + 9 7 -</code> might push both 2 and 7.
* The concatenation <tt>3 4 + 9 7 - *</tt> might push 14.
* The concatenation <code>3 4 + 9 7 - *</code> might push 14.


The major difference from other programming paradigms is that concatenative languages have combinatory logic as the predominant computational approach compared to others which use Lambda calculus, or Turing machines.
The major difference from other programming paradigms is, that concatenative languages have combinatory logic as the predominant computational approach compared to others which use Lambda calculus, or Turing machines.


This approach is possible in other programming languages also. For example the tacit programming style of APL and point free style of haskell is similar to this.
This approach is possible in other programming languages also. For example the [[tacit programming]] style of [[APL]] and point free style of [[Haskell]] is similar to this.

Latest revision as of 06:54, 22 August 2023

Programming paradigm/Concatenative is a programming language feature.

Concatenative programming passes a single data structure from function to function. With a concatenative language, concatenation is function composition. The concatenation of two programs is a valid program that passes this single data structure from the first program to the second program.

This single data structure is probably a stack. A concatenative language is probably a stack-oriented language. These languages tend to use reverse Polish notation with postfix operators. Programs push values on the data stack, then operate on those values. For example,

  • 3 4 + might push 7.
  • 9 7 - might push 2.
  • The concatenation 3 4 + 9 7 - might push both 2 and 7.
  • The concatenation 3 4 + 9 7 - * might push 14.

The major difference from other programming paradigms is, that concatenative languages have combinatory logic as the predominant computational approach compared to others which use Lambda calculus, or Turing machines.

This approach is possible in other programming languages also. For example the tacit programming style of APL and point free style of Haskell is similar to this.

Subcategories

This category has the following 33 subcategories, out of 33 total.

8

A

B

C

D

  • Dc(3 C, 90 P)
  • Dt(11 P)

F

G

J

  • Joy(3 C, 90 P)

K

L

M

O

P

Q

R

S

T

V

  • V(3 C, 36 P)