That's what people are trying to do with WASM. There's a project currently on the front page or not far about a frontend framework in Rust, and it's one of many. There's also TypeScript, and other alternatives. User interfaces are far from being a solved problem.