ursalang / ursa

A friendly, stable general-purpose programming language
https://ursalang.github.io
3 stars 1 forks source link

Delimited continuations #15

Open rrthomas opened 10 months ago

rrthomas commented 10 months ago

Adding static continuations with shift/reset to Ark allows me to implement exceptions, generators, coroutines etc.

For JavaScript-based implementations, there's a limitation: continuations are one-shot. The immutagen library hacks around this: https://github.com/pelotom/immutagen with a quadratic performance penalty.

mk270 commented 10 months ago

I'm going to need to be able to use chains of lazy generators, as I can in Python