6 ms·
Great. We will soon have an entire JVM running inside each browser's tab, just to run an animated slider. Maybe even more than one. Plus a .NET VM, several Pyth
by etatoby 9y ago
Great. We will soon have an entire JVM running inside each browser's tab, just to run an animated slider. Maybe even more than one. Plus a .NET VM, several Python and Ruby interpreters, and so on.
Because webmasters will keep loading ready-made plugins from CDNs, exactly like they are doing now, except that the new generation of web software will carry their own interpreter or runtime with them, because the developer wanted to use Python or whatever.
The web is getting better by the day.
- moron4hire 9y agoThen there should be a huge market opportunity to provide identical services at far smaller and faster downloads.
- steveklabnik 9y agowasm is modular, so in theory, you could produce a jvm9.wasm file, put it on a CDN with caching, and every site that wanted to do that could share it, and you'd only download it once. I do agree that runtime-less languages have an advantage here though.
- rl3 9y agoWe're still a long ways off from garbage-collected languages inside wasm. That said, it's not the technology's fault that people abuse or otherwise make poor use of it. I see no point in limiting it on that basis.
- boomlinde 9y ago> We're still a long ways off from garbage-collected languages inside wasm. I'm not sure what you mean by that. Is there some limitation inherent to WebAssembly that makes implementing garbage collection particularly difficult? For what it's worth, here's Lua (which implements a garbage collector in its runtime) in WebAssembly: https://github.com/vvanders/wasm_lua https://github.com/vvanders/wasm_lua
- FRex 9y agoI'm impressed. It seems to be in total working order when trying out collectgarbage, __gc and __mode[0]. Code: print(_VERSION) local a = setmetatable({}, {__mode = 'v'}) local b = setmetatable({}, {__gc = function(x) print("Deleting: " .. tostring(x)) end}) a[1] = b a[2] = 2 print(table.unpack(a)) print(collectgarbage'count') b = nil collectgarbage() print(table.unpack(a)) Result: Lua 5.3 table: 0x50a748 2 21.4033203125 Deleting: table: 0x50a748 nil 2 [0] - 3 features tied to the Lua GC, to simplify, they basically are (respectively): forcefully running the GC, finalizers that run when object is collected and weak refs that don't hold the object alive on their own. Perhaps http://www.lua.org/demo.html http://www.lua.org/demo.html could be replaced with that for users who have JS enabled. Again - just wow, that's really nice, Lua in a browser.
- rl3 9y ago>I'm not sure what you mean by that. Is there some limitation inherent to WebAssembly that makes implementing garbage collection particularly difficult? Yes, in that you'd have to implement the GC inside the wasm module itself (as in your example). In contrast to other languages, Lua is very lightweight. Many GCs are non-trivial. Moreover, proper GC support is a piece of the puzzle for the wasm/JS/DOM interop story to get better. See: https://github.com/WebAssembly/design/issues/1079 https://github.com/WebAssembly/design/issues/1079
- steveklabnik 9y ago> Moreover, proper GC support is a piece of the puzzle for the wasm/JS/DOM interop story to get better. I commented with a link elsewhere, but it seems that people have found a way around that!
- rl3 9y agoRelevant discussions in case anyone's interested: https://news.ycombinator.com/item?id=15694292 https://news.ycombinator.com/item?id=15694292 https://news.ycombinator.com/item?id=15694289 https://news.ycombinator.com/item?id=15694289 I didn't see those, thanks. That's good news. Hopefully host bindings land sooner now than they otherwise would have if tied to the GC proposal. The wasm32-unknown-unknown LLVM backend target for Rust is also quite exciting. I say this after having just spent a minor eternity compiling the Emscripten toolchain. :)
- boomlinde 9y ago> That said, it's not the technology's fault that people abuse or otherwise make poor use of it. I felt like I should respond to this, too. It's not, but it is not unreasonable to object to implementing new ways for browsers to hog resources pretty much at the hosts' discretion. In this case it can be argued that it's poor use of technology to implement it in the browser. On a similar basis, one might argue that it's poor use of technology to kill people with dynamite, but it is also reasonable to take a step back and argue that it is poor use of technology already at the point at which you gave a toddler the detonator. Regardless, dynamite is an excellent and useful technology.
- rl3 9y agoI understand your point, and admittedly I have many of the same concerns. That said, some of us have legitimate uses for said dynamite, pyromaniac infants be damned.
- tzahola 9y agoI'd like to interject for a moment here, and pitch my idea about what I call the "Web 4.0". It's basically a binary equivalent of HTML, without the many inconveniences of HTML for content providers. Web 4.0 pages are obfuscated WebAssembly payloads, that draw their contents via WebGL. This way, adblocking becomes impossible, as the actual content and ads are within the same opaque WebGL framebuffer. Stealing copyrighted text is also made significantly harder, beause the Web 4.0 platform leaves it up to the publisher to enable glyph selection and copying. You have concerns about accessibility? Web 4.0 is 100% accessible thanks WebAudio based realtime speech synthesis!
- taf2 9y agoit'll also be harder to learn how things work... i wonder how much we've learned from reverse engineering the easy to read inline script tags... I definitely remember teaching myself JavaScript by reading blizzard.com's late 90s markup... figuring out that mouse over effect with onmouseover and onmouseout... works in ie4... but whats that strange bug in netscape 4..
- TremendousJudge 9y agoYou can't really do that today anymore though
- MaxBarraclough 9y ago> adblocking becomes impossible No, it'd just take a sufficiently smart AI.
- shthed 9y agoJust like the good old days with sites built in Flash :)
- vbezhenar 9y agoAnd to have different pythons running together we need docker with ubuntu.
- kevin2r 9y agoI hope to have at least 128GB of ram in my phone by that time :)