Essentials of Compilation
If I were teaching a compilers course, I would consider using WebAssembly as the target language. Has anyone tried this in a teaching setting?<p>When I took compilers, a substantial amount of student and TA time was spent learning how to use GDB to step through x86-64 machine code that had been incorrectly generated in some way. This experience was probably useful, but detracted time that could have been spent focused on the core material - optimization passes, etc. The debugging tools for WebAssembly are much easier to use.<p>It would also be a lot easier to set up a sandbox environment to run tests on student code - this requires a lot of work to do safely with machine code.<p>One major downside is that WebAssembly is a stack machine, so you wouldn&#x27;t get the chance to work on register allocation, which is both interesting and important in practice.