5 ms·
Why is it so hard for browsers to implement a common set of byte-code. Then we all get what we want and it would make it much simpler to port your favorite lang
by toddan 13y ago
Why is it so hard for browsers to implement a common set of byte-code. Then we all get what we want and it would make it much simpler to port your favorite language to the browser.
This compile to javascript trend seems so brittle and frail.
- akoumjian 13y agoI have been wondering this myself for a while. While I believe there are probably reasons you couldn't exactly map behavior of all of today's popular scripting languages into a common byte-code, you could probably approach something close to it. Part of the problem is that Webkit has a very narrow mission of wanting to only be standards compliant. This is really holding back innovation given how widely used it is in Safari and until recently Chrome. It seems to me that in order to make it happen, it would need wide support from one of the major browser vendors.
- ht_th 13y agoLooking at the languages that run on the JVM ( http://en.wikipedia.org/wiki/List_of_JVM_languages http://en.wikipedia.org/wiki/List_of_JVM_languages ), I'd say it shouldn't be too much of a problem to create that common byte code.
- teacup50 13y agoWe may finally see this, if only as a side effect of Eich's departure from Mozilla. Google and Mozilla are the only mainstream browser vendors that have an incentive to offer a bytecode alternative to the JavaScript status quo, whereas Apple and Microsoft would simply be undermining their respective platform positions. This means that Mozilla could have worked with Google to form a bloc; Chrome and Firefox would have been the only browsers to support better web technology, and that might have been enough to force Microsoft and Apple's hand. Instead, Eich stuck to his "JavaScript First" guns for years, wasting market opportunities and in the process, serving as the swing vote that held the entire web back. I hope that the next CEO of Mozilla realizes that for platforms like Firefox OS to have a snowball's chance in hell, they need to work with Google to move past HTML/CSS/JS.
- xrd 13y agoChrome (or rather Chromium) will soon have Dart support built into it. There you go.
- ohhmaagawd 13y agoWhy is compile to JavaScript any different than compile to byte code? Is the "frail" comment from experience or intuition?
- teacup50 13y agoYou'd think this would be obvious. It's an inefficient and poorly designed "bytecode": - The only number representation available is floating point. - Concurrency is impossible except for the nearly useless web workers API; this prevents a language author from exposing any other type of concurrency mechanism. - Anyone wishing to implement the "byte code" specification must implement or integrate a full Javascript parser and runtime.
- RussianCow 13y agoOn top of that, you have no control over memory management (which makes properly implementing lots of languages impossible).