I wrote an in-browser serverless platfrom [1] a few months ago with which this would pair well; but seeing the techniques described here, it might make sense to compile workerd [2] to wasm instead.
[1] https://github.com/johnhenry/actually-serverless [2] https://github.com/cloudflare/workerd