5 ms·
Would you be opposed if all browsers made Lua available for webpages? It does not seem impossible to me to add functionality to a browser to accept some other
by innguest 12y ago
Would you be opposed if all browsers made Lua available for webpages?
It does not seem impossible to me to add functionality to a browser to accept some other language to run. What you're talking about is how hard it would be to convince JS developers to stop using it. But no one is talking about that.
- jlarocco 12y agoI think that's already a feature of HTML, using the language="..." attribute of the script tag. Believe it or not, a long time ago, Javascript was actually the less bad option in web scripting. IE used language="vbscript" to allow web scripting in VBScript, which, AFAIK, was the only other language that became popular for scripting web pages.
- Aldo_MX 12y agoI would be opposed for one main reason: The extra overhead that supporting an additional language implies with hybrid websites (even if you disregard JS completely, external code like advertisements would introduce it). People can claim that the overhead is negligible with today's hardware, but this is not always the case, especially when you are trying to get as much performance as possible for a web-based game engine. We should be working hard to kill Flash and Java completely from the web, substituting them with modern and standard web technologies. I don't mind an obscure corporate website requiring their employees to install Flash or Java, but I do mind being bombarded with "please install Flash with Mc Affee unless you opt-out", because we are too lazy to display video without Flash. A better alternative to have Lua in the browser (at least in my opinion) is to support Mozilla's asm.js initiative, and compile Lua to LLVM/JS.
- swift 12y agoI don't think asm.js is a very good fit for garbage collected languages. You really want to integrate with the browser's existing, native GC instead of implementing your own GC on top of a huge typed buffer in JavaScript.
- lmm 12y ago> The extra overhead that supporting an additional language implies with hybrid websites (even if you disregard JS completely, external code like advertisements would introduce it). People can claim that the overhead is negligible with today's hardware, but this is not always the case, especially when you are trying to get as much performance as possible for a web-based game engine. If you're worried about performance, why are you advocating asm.js? That's always going to be less performant than direct browser support for a language. > We should be working hard to kill Flash and Java completely from the web, substituting them with modern and standard web technologies. The JVM (on which Java is only the most prominent of many languages) is standard and modern. So was Dart. So is Lua.
- Aldo_MX 12y ago> If you're worried about performance, why are you advocating asm.js? That's always going to be less performant than direct browser support for a language. TL;DR: You won't get Lua support in your favorite browser if you don't build web projects with Lua today, and you can only use Lua via asm.js today. non-TL;DR: because of 3 reasons: 1) JS is not going away, and you are not going to convince the main browser vendors to use Lua, this makes Lua via asm.js the only realistic way to use Lua in any browser today. 2) VMs like OdinMonkey use a different strategy when they detect the "use asm" pragma, and this allows Lua via asm.js to run faster than JavaScript, but this only applies to Firefox. 3a) In order to convince browser vendors to take Lua seriously, Lua has to be massively adopted in the web. 3b) In order to help Lua to become massively adopted in the web, it needs to run fast everywhere, not just in Mozilla's browsers. 3c) In order to help Lua to run fast everywhere, the teams behind other JavaScript VMs (V8, JSCore, Chakra, etc.) need to be convinced that the web needs asm.js. 3d) In order to convince the people of other JS VMs, we need to build more projects which use asm.js. -- > > We should be working hard to kill Flash and Java completely from the web, substituting them with modern and standard web technologies. > The JVM (on which Java is only the most prominent of many languages) is standard and modern. So was Dart. So is Lua. The JVM, nor Dart, nor Lua are web standards, also, I expect from you to not be nitpicking my comment, I was referring to the frontend (ie. applets / flash player).
- 12y ago