Re:Introducing command And commandfor In HTML
by fuzztester on Friday March 07, 2025 @06:33PM
(#43295978)
I stopped understanding continuations before I even started.
[ Parent
| on HN ]
Re:Introducing command And commandfor In HTML
by fc417fc802 on Saturday March 08, 2025 @03:25AM
(#43298543)
I can't quite tell if you're serious. Continuations are fun, so I'll post this on the off chance it helps someone.
They are perplexing until they aren't. Model stack frames as independent state. When you return from a function the stack frame can stick around. Now later, place your stack pointer back in the frame that you returned from earlier.
Add a convention for passing arguments when you update the stack pointer as above. Now you have continuations.
Re:Introducing command And commandfor In HTML
by bryanrasmussen on Saturday March 08, 2025 @06:00AM
(#43299224)
so you can place your stack pointer back in the frame that you returned from earlier? that's probably the point at which they stopped understanding continuations before even starting.
Re:Introducing command And commandfor In HTML
by cyco130 on Saturday March 08, 2025 @08:09AM
(#43299967)
That’s the tricky part. There’s no stack anymore. Activation records of functions are heap-allocated and can stick around as long as necessary.
Re:Introducing command And commandfor In HTML
by fc417fc802 on Saturday March 08, 2025 @09:23AM
(#43300462)
To be fair it's still a stack (the data structure). It just isn't contiguous in memory anymore.
Of course modern LLVM already breaks it up into chunks anyway (given certain flags at least) so it likely isn't contiguous regardless.
Re:Introducing command And commandfor In HTML
by bryanrasmussen on Sunday March 09, 2025 @01:51AM
(#43306873)
I was explaining the joke? Since the person I was replying to seemed to wonder if it was really a joke, whereas for me, structurally it was obviously a joke.