Often people talk about cross-platform compatibility, but is it possible to write such "universal code" that would work both in browser, in desktop, on opengl, on webgl, and on html5 canvas-object? I'm thinking about writing a c-to-javascript compiler that would allow running desktop applications in browser. This utility would parse c/c++-code and generate javascript-code, and somehow replace all opengl-calls with webgl-calls. Something similar to Emscripten, but without assembly-like code (functions and statements would be converted one to one). Of course there will be some severe limitation on such c++ code. It will not support templates, dynamic polymorphism, etc. Also all libraries would have to be more or less substituted with javascript-implementations, so for example std-namespace will have to have javascript counterpart.
Do you think this is worth the trouble? Or should we just optimize better desktop-application download and execution, and except users to press "download" on our site? Google earth seems to be pretty popular even though it has a mandatory installation-step.