3 ms·
What we really need is a replacement for Javascript as the 'bytecode of the internet'. It's clear now that people want to have the freedom to write client web c
by NickPollard 12y ago
What we really need is a replacement for Javascript as the 'bytecode of the internet'. It's clear now that people want to have the freedom to write client web code in whatever language they prefer. A web browser is just a VM for running the output of a [dart, coffeescript, scala...] compiler, and we should recognise that, and replace javascript (a language designed for humans to write) with a new bytecode (a language designed for computers to run), and then people can use whatever compilers they want to translate from the code they write to the code the user runs.
People can still write javascript with a JS->Bytecode compiler; people who want to write TypeScript or Dart can get better compilation or performance, and people can easily write a whole load of new languages and new compilers without being constrained by the intricacies and design decisions of Javascript.
- rtpg 12y agoI'll take "Subsets of Javascript by Mozilla" for $200, Alex I think asm.js has proven itself to be a "good enough" solution if we start writing some serious compiler tech
- NickPollard 12y agoI didn't mention asm.js but it was on my mind when I wrote the parent; it's possible that it is 'good enough' and eventually becomes widely adopted enough, but I wonder if we might do better by eschewing the need for compatibility with Javascript.
- deleted 12y ago[deleted]
- bobajeff 12y agoWe might but first someone has to first design and specify the new Intermediate Language. Then submit it to ECMA. Then implement it in a browser. This new IR better be so much better than JavaScript and asm.js at being a compile target for languages, that it takes no time for web application developers and compiler developers support it with enough tools and applications to dwarf their JavaScript counterparts. Good luck with that.
- Touche 12y agoCurrently each browser implements JS compilation different. Some compile to a bytecode, and others do not. Getting them to agree on a single bytecode format is very unlikely.
- rikkus 12y agoYes, and please let this 'bytecode' actually be that used in CLI assemblies. In other words, can we have a .NET runtime in the browser please? All that Javascript will continue to run beautifully, but I'll be able to write C# or Ruby, and those who favour other languages will likely be able to write them too, as there are so many supported.
- orbitur 12y agoI think in most cases, a bytecode solution would just be inserting another runtime layer between JS and hardware. It'd be a rough couple years of transition to get speed back, and not to mention the years spent trying to get everyone to agree to a standard. Sadly, JavaScript may very well be our bytecode. Unless by some miracle one of the intended JS replacements actually takes off.