4 ms·
This sounds like the first step in a vision I've had for how the web should evolve. We now have an LLVM frontend for Javascript, so Javascript code can be turne
by a-priori 13y ago
This sounds like the first step in a vision I've had for how the web should evolve. We now have an LLVM frontend for Javascript, so Javascript code can be turned into LLVM bytecode.
The next step would be to swap out the existing Javascript runtimes with this frontend plus a sandboxed backend for the native platform so they can compile Javascript to LLVM bytecode, then to native code.
Finally, you add an extension to the <script> tag to allow loading arbitrary LLVM bytecode, something like <script src="http://some/url/code.llvm" http://some/url/code.llvm" type="text/llvm">.
Once that's in place then you'd be able to execute any language that has an LLVM front end inside the browser environment. Javascript is no longer the sole language of the web, and things like Emscripten and asm.js become obsolete.
- chubot 13y agoIn other words, you want to use LLVM as a VM. Sorry to be harsh, but you're only the millionth person to think of this "idea". LLVM is not a well-defined protocol or specification; it's a library for making a compiler that changes with every release. Read: http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043719.html http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/0437...
- limsup 13y agothis is essentially what PNaCl is http://blog.chromium.org/2013/11/portable-native-client-pinnacle-of.html http://blog.chromium.org/2013/11/portable-native-client-pinn...
- KMag 13y agoInstead of arbitrary LLVM bitcode, you probably want a subset with some statically verifiable security properties, as a form of very lightweight sandboxing. Google has already created this, and calls it PNaCl. Running arbitrary LLVM bitcode would make browser exploits trivial, unless you ran the bitcode in a sandboxed subprocess. PNaCl's sandboxing is much lighter weight than requiring IPC to interact with the browser. EDIT: Just realized this is mostly redundant with another reply, but hopefully gives a bit more detail for those not interested in following links.