Wouldn't something like this work in a game engine that can export to Webassembly, like Godot?
Though in either case, you lose the web platform, with its accessibility (aria, screen readers) and forward compatibility (like the one we had with the move to smartphones, etc).