Hacker News new | ask | show | jobs
by elcritch 1281 days ago
No, not directly but Nim supports async. Effectively it turns the function into an Iterator whose state can be passed around. Those are put into Futures.

Its possible to write your own async engine, or you could use the iterator yourself if you really wanted. It's actually not too hard.

Checkout: https://github.com/status-im/nim-taskpools

Edit: also Nim compiles to C, so its possible to do whatever you can do in C with a bit of fiddling. Also theres coro https://nim-lang.org/docs/coro.html