News for hackers. Stuff that matters.
Re:Tom Duff on Duff's Device (1988) by AceJohnny2 on Saturday September 05, 2015 @08:36PM (#10176463)
> (Actually, I have another revolting way to use switches to implement interrupt driven state machines but it's too horrid to go into.)

I'm really, really curious about what that code is.

Re:Tom Duff on Duff's Device (1988) by mikeash on Saturday September 05, 2015 @08:44PM (#10176476)
This is just a guess, but perhaps something like: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
Re:Tom Duff on Duff's Device (1988) by nraynaud on Saturday September 05, 2015 @11:42PM (#10176771)
I just used it a few minutes ago: https://github.com/nraynaud/webgcode/blob/gh-pages/interpola...

https://github.com/nraynaud/webgcode/blob/gh-pages/interpola...

One problem is the reset of the functions, I just created a makeshift exception, but I don't know how far I want to deviate form the norm.

I still don't know if it's a good idea, but that's what personal projects are for.

Re:Tom Duff on Duff's Device (1988) by jhallenworld on Saturday September 05, 2015 @11:35PM (#10176759)
This is a very useful technique for making event driven parsers. I remember being surprised that the case statements didn't all have to be in the same scoping level, but it's true.