Re:BrowserHack: NetHack ported to the web
by azakai on Sunday April 12, 2015 @05:54PM
(#9364875)
Another interesting technical detail is that the nethack code contains a lot of synchronous stuff, which is generally hard to port to the web (where events must be short-lived). To get around that, the port uses Emscripten's emterpreter-async option to build (as you can see here: https://github.com/coolwanglu/BrowserHack/blob/master/build.... ).
That runs the application in a little interpreter designed for Emscripten output; the interpeter is capable of pausing and resuming code, so synchronous code isn't a problem.
That runs the application in a little interpreter designed for Emscripten output; the interpeter is capable of pausing and resuming code, so synchronous code isn't a problem.
More details on emterpreter here: https://github.com/kripken/emscripten/wiki/Emterpreter