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.
- File system in Emscripten (original title: Emscripten でのファイル入出力) by chiko
- Designing new compiler and runtime targeted WebAssemly (original title: WebAssembly とコンパイラとランタイム) by κeen
- Trans-compilation of proprietary Unity’s native plug-in to the Web (theory of black magic and its practice) (original title: プロプライエタリなUnityのC++ NativePluginをWebGLに移植する手法 (黒魔術の理論と実践)) by ゆんゆん探偵
- Fixing bugs in Emscripten’s SDL (original title: EmscriptenのSDLのバグを修正した話) by 後藤 浩昭 / GORRY
- Loosing weight: a practice of Emscripten generated asm.js code size reduction (original title: 結果にコミットする。asm.jsの減量やってみた) by ueshita
- Recent topics in WebAssembly by ikko
κ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.