These limitations are familiar, but in the future, building on the upcoming pthreads branch, we should be fortunate enough to fix/work around all of these blockers!
Also with the pthreads branch, it will be possible to get JS events proxied into C code even though the C code is running an infinite loop. The way this can be done is that in the pthreads branch the Emscripten HEAP is a SharedArrayBuffer (from this spec:
https://docs.google.com/document/d/1NDGA_gZJ7M7w1Bh8S0AoDyEqwDdRh4uSoTPSNn77PFk/edit?usp=sharing ), so multiple threads can read and write to it simultaneously. The JS events are pushed onto the Emscripten HEAP, and the C side pthread/main thread can then read the event off of its HEAP directly in asm.js/C land. However I don't yet have that in a working condition since it requires a moderate amount of refactoring of the PROXY_TO_WORKER option, because there will most likely be a JavaScript spec limitation that the main JS thread will not be able to access SharedArrayBuffer objects. As a result we must set up a second intermediary worker thread to do the JS event -> C event passing into the SharedArrayBuffer.
One of the overall goals of the pthreads branch is to be able to run (single or multi-threaded) infinite looping code so that one doesn't need to do the synchronous->asynchronous transformation. I'll be sure to post back once I've been able to make the branch compatible with the PROXY_TO_WORKER option, so you can try it out!