5 ms·
This article is making a common mistake; confusing JavaScript the language itself with the DOM. Compiling to asm.js just gives you the ability to translate you
by ebbv 14y ago
This article is making a common mistake; confusing JavaScript the language itself with the DOM.
Compiling to asm.js just gives you the ability to translate your other language code to executable JavaScript. It doesn't solve the issues of DOM interaction.
In order to write your client side code in Ruby you'd need a DOM library LLVM them somehow understands how to translate into its JavaScript equivalent.
In the near term its certainly much easier just to write JavaScript. Which is honestly, really, really easy.
- kayoone 14y agoDeveloping some kind of API binding for the DOM or JQuery is no impossible task though, similar things have already been done in other languages (in C# and the Xamarin Framework for example)
- ebbv 14y agoNo, of course it's not impossible. But I was pointing out a flaw in the article, it glosses over this issue. And this hypothetical API would need to be implemented individually for each language that you want to use for client side scripting. Like I said, in the near term it's a lot easier to just write JavaScript.
- swombat 14y agoNo, it doesn't. The author is suggesting porting a GUI toolkit (e.g. KDE) in asm.js, rendering it directly to the user, and doing away with the DOM altogether.
- ebbv 14y agoYou can't "do away with the DOM altogether". You need to have some method of interacting with the browser; location, AJAX requests, cookies, etc. Porting a GUI toolkit only relieves your need to deal with CSS, it does not alleviate you of all need for the DOM.
- swombat 14y agoYou're splitting hairs. In practice, if all you're dealing with from the DOM is one canvas element and a URL that's static, you've pretty much "done away" with the DOM.
- ebbv 14y agoThat's not true at all. You need some way of interacting with a back end (as well as the browser.) Whether that's via forms or AJAX requests, you need more from the DOM. The DOM is not just a GUI toolkit. I am not splitting hairs, you are glossing over serious limitations to this approach.
- deleted 14y ago[deleted]
- anton-107 14y agoIsn't it exactly a thing in which Java failed about a decade ago? Apps running in a VM using GUI toolkit instead of DOM, delivered right into your browser window? What could be better? Well it's proved to be a total failure on the web.
- swombat 14y agoOh, agreed. But that's the idea that's being pitched.