Related to what I wrote in my previous post about Script#, there is already GWT - Google Web Toolkit, which does something similar but with Java. You write your front end in the Java language, and the GWT compiler converts the code into JavaScript and HTML.