πΎ Archived View for dcreager.net βΊ concatenative βΊ simpler-cons.gmi captured on 2024-02-05 at 09:32:57. Gemini links have been rewritten to link to archived content
β¬ οΈ Previous capture (2023-11-14)
-=-=-=-=-=-=-
2023-11-07
In Swanson, I'm currently treating stack values and quotations separately, similar to how CBPV and FMC have a clear distinction between values and computations. Concretely, that means that my original definition of βconsβ in the natural linear basis (shown below) won't work, since β[unit]β would be a stack value containing an instruction. I need a different definition of βconsβ, which uses only the instructions in the natural basis, and which only uses empty quotations (i.e. Sβ's βnilβ instruction).
The natural linear concatenative basis
Functional Machine Calculus (FMC)
cons β swap unit swap cat β [B] [A] cons β [B] [A] swap unit swap cat [B] β [A] swap unit swap cat [B] [A] β swap unit swap cat [A] [B] β unit swap cat [A] [[B]] β swap cat [[B]] [A] β cat [[B] A] β
Turns out that's a better definition not only because it doesn't depend on quoted programs; it's just simpler overall! Can we do the same with βsapβ?
A simpler definition of βsapβ
For reference, here is the original definition that used a quoted program:
cons β [unit] swap unit cat i cat β [B] [A] cons β [B] [A] [unit] swap unit cat i cat [B] β [A] [unit] swap unit cat i cat [B] [A] β [unit] swap unit cat i cat [B] [A] [unit] β swap unit cat i cat [B] [unit] [A] β unit cat i cat [B] [unit] [[A]] β cat i cat [B] [unit [A]] β i cat [B] β unit [A] cat [[B]] β [A] cat [[B]] [A] β cat [[B] A] β