News for hackers. Stuff that matters.
Re:A Forth Story (1995) by nolist_policy on Saturday June 22, 2024 @05:36AM (#40757669)
He should look into C, not C++. With Duff's device[1] trick, it becomes surprisingly lisp- and forth-y. It can be used to implement coroutines in 100% portable C[2]. And I'm pretty sure you can use the same trick to implement infinite recursion (stack on heap) and maybe even backtracking a la prolog.

[1] https://en.m.wikipedia.org/wiki/Duff%27s_device

[2] https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

There are no comments on this comment yet.