2

I would like to know a programming languages that natively support delimited continuations. I do know that Scala used to have shift and reset, but those were removed; and I also know that Seaside seems to have something similar, but Seaside is a library, and as far as I understand, Smalltalk doesn't have support for delimited continuations.

So, is there a programming language that supports such continuations?

Thank you!

josh
  • 997
  • 1
  • 8
  • 13
  • I'm voting to close this question as off-topic because it is a polling question and not a programming question as defined in the [help] guidelines. *Make me a list of things* is not an appropriate question for this site. – Ken White Apr 18 '18 at 16:24
  • Racket and Haskell both come to mind – Mulan Apr 19 '18 at 13:40

2 Answers2

5

In most Smalltalk dialects you can trivially implement delimited continuations (or any other type of continuation). Due to the highly reflective nature of the environment, you can walk over the runtime stack and copy and reinstantiate any part of the execution stack. In fact, this is exactly what Seaside is doing.

Have a look at the different types of continuations implemented in these Monticello packages: http://source.lukas-renggli.ch/continuations/. The Continuation package includes tests and examples of various types of full and partial continuations (reset-shift and prompt-control style). The Generators package includes an implementation of generators.

Lukas Renggli
  • 8,754
  • 23
  • 46
5

As @user633183 points out, Racket has an extremely rich set of continuation operators. It includes shift and reset along with many other equivalent sets of continuation operation.

See the docs, at

https://docs.racket-lang.org/reference/cont.html?q=racket%2Fcontrol#%28mod-path._racket%2Fcontrol%29

John Clements
  • 16,895
  • 3
  • 37
  • 52