šŸ’¾ Archived View for dcreager.net ā€ŗ swanson ā€ŗ bethel-stacks.gmi captured on 2024-05-10 at 10:38:28. Gemini links have been rewritten to link to archived content

View Raw

More Information

ā¬…ļø Previous capture (2024-03-21)

šŸš§ View Differences

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

Bethel stacks

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

Four stacks

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.