cdiggins.com

December 1, 2007

Compositional Programming Languages (not Concatenative)

Filed under: Everything — cdiggins @ 6:07 pm

A compositional programming language is a programming language where the sequencing operator (i.e. the operation denoted by whitespace) is the function composition operation.

This is my proposed definition for a class of languages, which have been referred to, with increasing frequency, as concatenative languages.

Some examples of compositional programming languages (according to the definition I’ve proposed) are: PostScript, Forth, Joy, Factor, and Cat. While most stack-oriented languages are also compositional languages, compositional languages are not neccessarily stack-oriented. Some non-stack-oriented compositional programming languages include: Enchilada and XY. These two languages are both self-identified as being concatenative. The term “concatenative” is frequently used as a synonym for compositional languages, but the definition of “concatenative” is not widely agreed upon.

The term “concatenative programming language” clearly conveys the fact that concatenation (or sequencing or juxtaposition) of terms is fundamental in a given language, but not to what purpose. In languages like Haskell and ML the concatenation of terms is fundamental, and denotes function application. The question then remains, are Haskell and ML concatenative languages? We can concatenate expressions in these languages, to generate new valid expressions.

Proponents of the term “concatenative programming language” generally would exclude Haskell and ML, and restrict the term to include compositional programming languages. I feel that this dilutes the usefulness of the term “concatenative”, because it is assigned an arbitrary implicit meaning.

I conclude by suggesting that the term “concatenative” is a bit too easily misinterpreted to be an effictive description of a class of programming languages.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress