In this post I will explain why supporting 64-bit integers requires special attention, what Cheerp used to do in the past, why the current situation is better, and what we will be able to do in the future to further improve support.
WebAssembly in its current MVP form is shipped by all major browsers and is already capable of amazing things. This does not mean that its development has concluded: on the contrary, there are many post-MVP feature proposals at different stages of development.
One such proposal is about adding the so-called
externref type (and related instructions) to the specification. But what is
anyref, and why is it desirable to add it to WebAssembly?
As a showcase project we decided to port a multiplayer game to the Web, and we opted for Teeworlds. Teeworlds is a retro multiplayer 2D shooting game, with a small but passionate community of players (including me!). It is lightweight in terms of both assets to download and CPU and GPU requirements. It was a perfect candidate.
We decided to use this project to experiment general…
A CFG is a directed graph with groups of consecutive non-branching instructions (basic blocks) as nodes, and branches as edges.
Structured control flow instead represents code as an ordered sequence of basic blocks and scoped control flow constructs (if/else, while/for, switch, break, continue, …). …
A few months ago I saw this blog post by Mozilla, which is about rewriting part of their source-map library in rust code compiled to WebAssembly.
I also noticed that the current limitations of WebAssembly lead to what I think are some sub-optimal design choices, and I thought that it could be an interesting experiment to write an implementation in C++ using the Cheerp compiler.
In order to explain why I think Cheerp is particularly fit…