Depending on your language of choice, it might be worth looking at seeing if it compiles into web assembly.

If it does, and if the binary sizes aren't too large (both can be a problem for some languages) then you might be able to create your frontend using wasm, using your preferred backend language.

In this system, what is WASM drawing the UI to?

I've never tried it, but apparently some bindings exist, e.g. https://github.com/rustwasm/wasm-bindgen

So you can either try manipulating the DOM w/ some bindings or draw to canvas.