Settings

Theme

Nim CPS: compile-time continuations

github.com

3 points by disruptek 2 years ago · 3 comments

Reader

zevv 2 years ago

So, what this is: it's a Nim macro that rewrites your regular procedural code into a continuation using the CPS transform; this offers you total power over the flow control of your code and allows you to build things like coroutines, async I/O schedulers, iterators, exceptions, all as first class citizens in the language. It has been under development for quite some time and is pretty much mature.

Relevant recent articles:

- https://without.boats/blog/let-futures-be-futures/

- https://adam.nels.onl//blog/maybe-everything-is-a-coroutine/

disruptekOP 2 years ago

This'll get you closer: https://github.com/nim-works/cps

Sorry, I was in a hurry.

disruptekOP 2 years ago

Another in the continuing discussion... CPS as a library using nothing more than Nim's meta-programming.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection