💾 Archived View for dcreager.net › concatenative › basis-categories.gmi captured on 2024-08-25 at 00:24:07. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-03-21)

-=-=-=-=-=-=-

Categories of instructions in a concatenative basis

Brent Kerby describes several “bases” — sets of primitive instructions that are sufficient to make a concatenative language Turing complete, since all other instructions can be written in terms of your basis.

The Theory of Concatenative Combinators [Kerby]

In my Strange Loop talk, I call out that there are six “categories” that your primitive instructions need to cover to form a valid basis:

I also call out that there is a “natural” basis (though I didn't use that term in the talk), where there is a 1:1 correspondence between primitive instructions and their categories. (That is, each category is covered by exactly one primitive instruction, and each primitive instruction does _only_ what is required by its category and nothing else.)

Kerby also discusses “conservative” bases, where we remove “destroy” from the list, and “linear” bases where we remove “duplicate” and “destroy”.

[Strange Loop] Concatenative programming and stack-based languages

Kerby » Conservative Completeness

Kerby » Linear Completeness

Normal bases

‘cake’ and ‘k’

‘cat’, ‘drop’, ‘dup’, ‘i’, ‘swap’, and ‘unit’ [natural]

Linear bases

‘cons’ and ‘sap’

‘take’, ‘cat’, and ‘i’

‘i’, ‘cat’, ‘unit’, and ‘swap’ [natural]

..