This kind of compiler has already be done: http://gergo.erdi.hu/projects/metafun/
"Everything that can be implemented in {c++ templates, javascript} will eventually be implemented in that language"
jeff atwood: "any application that can be written in JavaScript, will eventually be written in JavaScript. Writing Photoshop, Word, or Excel in JavaScript makes zero engineering sense, but it's inevitable. It will happen. In fact, it's already happening"
Good foresight considering he said this 2009.
Which isn't to say the web is ready. But it will be!
Also, you say "emotionally distraught" as though there's no technical reason to dislike JavaScript.