5 ms·
With all major browser JIT compiling JavaScript, aren't they already?
by Longhanks 9y ago
With all major browser JIT compiling JavaScript, aren't they already?
- pjmlp 9y agoNo, because it still is the pile of HTML, CSS and JavaScript hacks. With WebAssembly you can bypass all of it, and do your UI framework in GL, and everything else with native libraries compiled into WebAssembly.
- endless1234 9y agoWhy couldn't you do that now with canvas?
- pdkl95 9y agoYou can, theoretically, but it isn't practical because of the large amount of Javascript that would need to be downloaded and parsed. The WebAssembly's purpose is to remove that limitation, which is going to trash what's left of the open web. Get ready for lots of websites becoming un-adblockable, accessibility-hostile, "custom ui" trash.
- moron4hire 9y agoNeeding to download a large amount of JavaScript hasn't been a deterrent to anyone for anything yet. These arguments against WebAssembly are just FUD.
- pdkl95 9y ago> hasn't been a deterrent to anyone for anything yet This is patently incorrect. Javascript's impact on page load time is so widespread that Google introduced AMP to "enables the creation of websites and ads that are consistently fast ... and high-performing"[1]. [1] https://www.ampproject.org/ https://www.ampproject.org/
- moron4hire 9y agoGo look at any major site in the wild right now. They all download several MB of JS. Facebook is 1.8MB of JS out of 3.9MB. The BBC is 1.6MB out of 3.8MB. Kotaku is 2.6MB out of 7.5MB. CNN is 2.8MB out of 6.5MB. Hell, here's an article complaining about the size of websites that itself downloads almost 1MB of JS: https://gigaom.com/2014/12/29/the-overweight-web-average-web-page-size-is-up-15-in-2014/ https://gigaom.com/2014/12/29/the-overweight-web-average-web... I've written multiplayer VR experiences that run cross-platform through the browser that only clock in at 500KB of JS. You can put a LOT of code in a MB.
- TremendousJudge 9y agoIf it had been a deterrent, people wouldn't have done it, and we wouldn't have slow loading pages in the first place, and Google wouldn't have an AMP initiative. However, We have slow loading pages, and Google has AMP, which means that load speeds hasn't deterred stopped anyone from adding a ton of JS bloat
- AboutTheWhisles 9y agoYou are saying the same thing as he is. Javascript's impact on load time hasn't been a deterrent to people using mountains of bloat in their page. Thus, webasm being a few times faster to download and parse won't change a whole lot, since few web developers seem to care much about the speed of their pages. If webasm won't change much, then it isn't reasonable to predict a future of web pages that simply render to the canvas.
- dagw 9y agoYou could, but it's a pain and doesn't add much. With this you could in theory port GTK or Qt to WebAssembly and then simply change a compile flag and have your C++ GUI app running on the web.
- Figs 9y agoWhich is a terrible usability nightmare waiting to happen... Seriously, DON'T do this. This breaks ctrl-f. This is unlikely to work well for people who need to enlarge text or enhance contrast due to vision impairment. This breaks screen readers. This will probably break most site archive navigators, so your content is lost to history (e.g. wayback machine). This will probably prevent Google from indexing your site, killing your page ranking and driving away potential customers. Even if you re-implement all the things you think it will break, you'll find that your users have things set up in ways you'd never considered... Just, don't. Please don't do that.
- pjmlp 9y agoToo late, WebAssembly is already here. I really think it will bring Flash like web sites back, and browser vendors are the ones actually pushing it. The wheels are already in motion, with everyone trying to port their favorite language or VM into WebAssembly. For example, today it is Qt WebGL Streaming, tomorrow it might just run directly from WebAssembly. http://blog.qt.io/blog/2017/07/07/qt-webgl-streaming-merged/ http://blog.qt.io/blog/2017/07/07/qt-webgl-streaming-merged/ It will be up to those frameworks to provide usability support, like WPF does for Windows.
- pjmlp 9y agoActually, "Add support for WebAssembly as target platform for Qt https://bugreports.qt.io/browse/QTBUG-63917 https://bugreports.qt.io/browse/QTBUG-63917
- Skinney 9y agoWebAssembly doesn't change this. There's nothing preventing people from doing this with javascript (plain or asm.js flavored) and canvas/webGL, and yet no one does. It just doesn't make a lot of sense.
- pjmlp 9y agoTry to disable JavaScript and see how much of the modern Web you are able to enjoy, even on sites which are supposed to display static text.
- realusername 9y agoYeah you can but then you have exactly the same problems as a browser render so I'm not sure it's useful.
- vanadium 9y agoAccessibility?
- Skinney 9y agoBut why on earth would you do that? That would be like bypassing the native UI framework on iOS or Android. It gives a worse experience for users, and is likely more work for you, the developer.
- dymk 9y agoBecause this is a HN circlejerk about WASM, since when does an argument ever have to be well thought out or reasonable?
- AgentME 9y agoYou don't need WebAssembly to invent your own UI in a canvas. WebGL and all that works from Javascript.
- samnardoni 9y agoYou can do all that with JS too. Wasm adds nothing extra. It's perfectly sensible to imagine wasm applications targeting the DOM (which it can do via JS, and will do natively in later releases) just like JS applications do now.