JS engines in browsers should evolve to more general VMs, for which you can implement/port other languages. Hopefully WebAssembly is a start of that. That is the proper way, not writing it in JS with caveats such as
> Speed is explicitly not a main goal of this project.