š¾ Archived View for dcreager.net āŗ swanson āŗ bethel-stacks.gmi captured on 2024-08-25 at 00:36:09. Gemini links have been rewritten to link to archived content
ā¬ ļø Previous capture (2024-05-10)
-=-=-=-=-=-=-
2024-02-09 (last updated 2024-04-03)
I recently decided to go back to CPS for Swanson. At the same time, I decided to go with three stacks. But I really liked how the four-stack setup used a nice power of 2 for the number of stacks.
Continuation-passing Sā: The return
Porque no los dos?
So, Sā will go back to being CPS, where an āinvokeā instruction is terminal. One of the stacks is primarily intended to be used for continuation quotations, avoiding the juggling problem of a stack-based CPS language. One of the stacks is typically used for locals / enclosed values; the value enclosed in a quotation (if any) will be pushed onto this stack just before control transfers to the chosen quotation branch. But to go from three stacks to four, we'll have two āworkingā stacks. Each object/invocation will have a āpreferredā stack where it will typically be invoked from, and where it will place itself when passing itself back to its continuation. It will expect any āinputsā (and pass any āoutputsā to its continuation) on the other working stack.
Also, I'm definitely spinning my wheels here, making never-ending changes to the stack layout and set of primitive instructions. Maybe if I give this most recent design a snappier name it will stick. So let's call these āBethel stacksā, since I'm typing this at Sunday River.