andrewducker (
andrewducker) wrote2010-11-11 12:55 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Coding in web browsers
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
At the moment we write Javascript in web pages, which is then compiled down by the various JIT methods that Firefox/IE/Webkit use to make it super fast.
Seeing as what's run clearly isn't the actual JS itself, but bytecode, why not have a standardised bytecode that all browsers would support, which would then mean you could write your code in any language you liked, providing there was a compiler to convert it to the standardised bytecode?
At the moment Google uses GWT to convert Java into Javascript that then gets converted into the running code, (And MS used to have something similar) wouldn't it be handy if the intermediate step wasn't necessary?
no subject
I'm not doing it, the browser isn't doing it, so it's got to be the server....
no subject
no subject
no subject
<script type="byte/code" language="bytecode" src="http://myserver/somecode.byt"></script>
it will pass it to the bytecode interpreter to run.
When it encounters:
<script type="text/javascript" language="javascript" src="http://myserver/media/js/jquery.js"></script>
it will run it as it currently does through the JS interpreter.
The browser continues to do the work _for JS_, but allows you to write code in other languages if you so desire.
no subject
no subject
Same as currently happens if you're using GWT or anything else which compiles into JS.
no subject
people who write js can just write js
and people who write in something that compiles to js can compile to a different format instead