Description
With the new MIR->LLVM backend being all but done, and being cleaner than the old trans, we can seriously think about writing yet more backends. A relatively important, and relatively easy target to translate to is WebAssembly.
The right starting strategy per @eddyb is to fork miri and prototype the new backend out of tree.
One interesting point that @kripken brought up recently is that wasm is an AST with controlflow, whereas MIR is just a graph of blocks. This means that somebody has to "reloop" the controlflow back out of the graph. Most likely binaryen, the C++ tool that
consumes wasm, will just additionally accept a basic-block form of wasm and do the conversion itself.
@kripken is interested in helping with this, so I'm setting up this issue as a place for interested parties to discuss.