WebAssembly has become an even more attractive target programming language with the addition of heap objects, allowing many languages to be compiled into WebAssembly without the additional effort of translating their garbage collectors as well. In this thesis, we decided to compile the functional language Millet into WebAssembly. In this work, we first introduce both languages and then describe how Millet was compiled into WebAssembly. The translation is direct, meaning that each Millet instruction is mapped it to the corresponding WebAssembly instructions. We also had to specify the appropriate types for correct execution and validation of the compiled code. The translated code runs correctly and outperforms Millet’s original code by at least two hundred times in every case. Since the code is not yet optimized, it still requires a few improvements to perform more comparably to programs written directly in WebAssembly.
|