Is there a distinction between composability and compositionality? [closed]

I was reading a blog post titled On Compositionality. In the post the author talks about how compositionality is important for software design and programming language design. However, it seems that the author's meaning of compositionality is very similar to that of composability which means that you can assemble complex structures out of simpler components. Is there any meaningful distinction between the two or are the two words interchangeable?


Wikipedia describes compositionality as:

In mathematics, semantics, and philosophy of language, the principle of compositionality is the principle that the meaning of a complex expression is determined by the meanings of its constituent expressions and the rules used to combine them

Similarly, in the case of denotational semantics of programming languages:

An important aspect of denotational semantics of programming languages is compositionality, by which the denotation of a program is constructed from denotations of its parts. For example, consider the expression "7 + 4". Compositionality in this case is to provide a meaning for "7 + 4" in terms of the meanings of "7", "4" and "+".

Note the emphasis on meaning here. If something can be broken down into atoms, then its meaning can be broken down into atoms of meaning, i.e., there is little to no emergent meaning. The whole is equal to the sum of its parts.

On the other hand composability talks about:

  1. Modularity - the ability to break things into smaller components
  2. Reuse - components can be reused in different contexts

While there is some overlap (in being able to reason about individual components separately), there is less emphasis on the meaning combining in the same way.

Some things may be composable but not necessarily compositional, such as text and images. For example, the characters (, ), ^ and _ don't mean much by themselves, and the combining rule of concatenation doesn't have much meaning by itself, but by concatenating these into (^_^), you get a smiling face. The whole is greater than the sum of its parts. Another good example of this is /r/photoshopbattles where the juxtaposition of two unrelated items often leads to a funny image.

Similarly, in software, it may be the case that two parts work fine in isolation but have unintended interactions when combined. This is why the article uses the term compositionality, and not composability, because it is talking about the emergent complexity in software.


The difference is as you say: compositional is a technical mathematical term for if two objects, when combined by some operation, preserve something about the two, ie some kind of homomorphism $f(a op b) = f(a) op f(b)$. 'Composable' just says that two things can be used together. As the former is a technical term, 'composable' should not be used for it.