Today, I implemented the / pattern (as known from and meanwhile quite some other languages) ...

... in good old ! ๐Ÿ˜Ž

Well, at least sort of.

* It requires some standard library support, namely user context switching with and friends, which was deprecated in POSIX-1.2008. But it's still available on many systems, including , , (with ). It's NOT available e.g. on , or Linux with some alternative libc.

* I can't do anything about the basic language syntax, so some boilerplate comes with using it.

* It has some overhead (room for extra stacks, even extra syscalls as getcontext unfortunately also always saves/restores the signal mask)

But then ... async/await in C! ๐Ÿฅณ

Here are the docs:
zirias.github.io/poser/api/lat

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.bsd.cafe/users/zirias/statuses/114354254853751795 on your instance and quote it. (Note that quoting is not supported in Mastodon.)