Concatenative Language

A valid program in a concatenative language can be split along any (atomically) syntactic boundary to produce two equally valid programs. Likewise, any two valid programs may be concatenated to form another valid program. Note that a 'valid program' in this sense only requires that it parse and possess meaningful semantics according to its standard interpreter or compiler, not that it avoids crashing horribly.

In short, concatenative languages behave in a way which looks imperative (like C or Perl), but can be reasoned about in a functional manner (like ML or Haskell).

Examples of concatenative languages:

Such languages usually have a parameter stack, to avoid named local variables, and often use PostfixNotation.

Concatenative languages mailing list: http://groups.yahoo.com/group/concatenative/

Concatenative language wiki: http://concatenative.org/wiki/


What advantages do concatenative languages have due to their concatenativity?

I would assume it would help if you wanted to perform CodeAlgebra, where CodeIsData.

It would also help for composition (i.e. in the DynamicStringsVsFunctional sense). A simple string-concatenation operator becomes a well-defined parametric composition.


There a relatively simple, they have only one operator: concat. Concat concatenates two programs together. They also have an empty program. So a concatenative languages forms algebraically a monoid. The rules of concatenation are - star is the concatenation operator, e is the empty program -:


What would you call scripting languages that have an "Include(mySourceFile);" operation? Although they have the option of doing it dynamically, a given program may not resort to that technique, and thus may be statically analyzable.

Huh? What does your question have to do with concatenative languages?

Beware of being mislead by the description above. It's very unclear. A far better is the one at http://en.wikipedia.org/wiki/Concatenative_programming_language, though it presumes some understanding of the subject.


CategoryProgrammingLanguage


EditText of this page (last edited January 7, 2014) or FindPage with title or text search