đŸ Archived View for dcreager.net âș swanson âș stack-values-cannot-be-quotations.gmi captured on 2024-02-05 at 09:44:15. Gemini links have been rewritten to link to archived content
âŹ ïž Previous capture (2023-11-04)
-=-=-=-=-=-=-
2023-09-17
Thinking more about how to handle âstack valuesâ in Swanson, which we've already decided should be first-class.
As things currently stand, a stack value is isomorphic to a single-branch quotation that pushes the contents of the stack value onto the working stack.
In a non-linear stack language, those two things are not just isomorphic â they're actually the same thing in the language. There is no distinct stack value, there are only quotations. The âquoteâ primitive pops a value off the stack and creates a _quotation_ âcontainingâ the value.
In a linear language like Sâ, there needs to be a clear distinction between _values_, which absolutely must be handled or consumed (precisely once) at some point; and _actions_, which do not necessarily have to be executed. (In a linear language, every value must be consumed, but you (or your program) have agency to determine at run time how that consumption happens.)
That means that we _can't_ conflate stack values and quotations, and need them to be distinct in the underlying calculus.