Our plans for the future are more general but improve the support for wasm as a 
side-effect:

  * Make the language more agnostic to the used underlying allocators 
(destructors).
  * Introduce an optional code transformation that maps exception handling to 
`if` statements.
  * Make the tracing garbage collection precise with respect to stack roots. 
This means Nim's GCs will get rid of hardware specific code that doesn't port 
well to wasm.



Whether you compile the Nim code to wasm via C/Emscripten or via Nim's LLVM 
backend (nlvm) does not matter, these toolchains will all benefit from the 
outlined changes. Note that a direct wasm backend is currently not planned, but 
I expect the community to provide one. A Nim-to-wasm translator is a nice 
greenfield project to learn about compilers. 

Reply via email to