3 ms·
The Web runs C via WebAssembly, but if you're porting a polling loop app you're going to have a bad time. Conversely, if you start with an event driven app then
by socalgal2 1y ago
The Web runs C via WebAssembly, but if you're porting a polling loop app you're going to have a bad time. Conversely, if you start with an event driven app then you lose nothing but gain portability.
- hyperhello 1y agoOkay -- this code is pathologically minimal. If you modify it to use events on the web, will your work extend to all the other platforms?
- socalgal2 1y agoYes, because it's trivial to make an event based loop from a polling loop but not visa-versa. The difference is that an event based loop needs to give up control to the OS. A polling loop does not. So if you have a polling OS you just write few lines to emit your own loop event.