Emscripten Night!! #3

N.Shimizu
2 min readFeb 23, 2017

--

Emscripten Night!! is a bi-monthly tech-meetup in Tokyo, which focuses on Emscripten and cross-compilation against Web browsers. Its average attendance is 20–30. Not so big but very inspiring meetup. Its 3rd meetup happened last night.

We had 2 talks and 4 lightning talks. Their titles and links to their slide decks are listed as below (English titles are translated by me. Original titles in Japanese follow) . I was the first speaker of this meetup, talked about Emscripten’s file system architecture and some tips.

κeen’s talked about his compiler, which generates WASM from ML codes, and his effort to overcome gaps between ML and WASM. He struggle comes from WASM’s virtual machine design. ML runtime needs long jump to implement exceptions and WASM’s VM does not provide such feature. Long jump is not available in WASM primitives. We can not access program counter to change “next line” either. WASM’s VM is designed as a stack machine. That is why we can not use these features. He overcome lack of long jump by defining idioms. Combination of loop or block with break, we can implement forward long jump and backward long jump. I am not sure this technique is common in code generation, but quite impressive to me.

ueshita’s talk was also impressive. It is about code size reduction. He almost half his code size from 1.2MiB (uncompressed) to 690KiB. Most impressive secret was rewriting macros to function calls. It contributed 50KiB reduction. He did not mentioned performance penalty caused by this rewriting, but I assumed that it is small enough to be ignored.

This community is slowly but continuously growing. One third of attendees were new comers. Topics tend to require our some knowledge about low level things, such as compiler architecture or C/C++ runtime, but technically inspiring. I strongly recommend you to perticiate this emerging community. The next meetup have not been scheduled but will be notified in month. Please visit community site and join it.

--

--