News for hackers. Stuff that matters.
Re:Emulating Goto in Scheme with Continuations by kccqzy on Monday February 23, 2026 @11:49AM (#47124855)
Constrained GOTO semantics sounds a lot like delimited continuations. Indeed I think Scheme continuations are a little too powerful for regular use by having the possibility of global effect (like longjmp). Delimited continuations make the effect more local.
Re:Emulating Goto in Scheme with Continuations by richdougherty on Monday February 23, 2026 @12:24PM (#47125431)
If you'll excuse the self-post, here's a blog post on goto with delimited continuations.

https://rd.nz/2009/03/goto-in-scala.html

It uses an experimental compiler plugin for the Scala compiler. It's typesafe at compile time. At runtime unfortunately it relies on exceptions for control flow.

Re:Emulating Goto in Scheme with Continuations by taeric on Monday February 23, 2026 @12:27PM (#47125480)
Delimited continuations always bounced off of me. In theory, they should be a lot like coroutines? I think, in practice, I just never really internalized all that goes into managing the current "environment" for a piece of code that is managed by the call state.

Like, I have a few partial mental models for everything that they pull together. I haven't really tried to build on that, though. Should put some time to that.

Re:Emulating Goto in Scheme with Continuations by mikkupikku on Monday February 23, 2026 @12:29PM (#47125530)
You could implement coroutines with deliminated continuations, which is probably the best way to use deliminated continuations.
Re:Emulating Goto in Scheme with Continuations by jasonhemann on Monday February 23, 2026 @06:06PM (#47130329)
Effect handlers would like to have a word.