Live data from Hacker News

WebAssembly support now shipping in all major browsers

blog.mozilla.org

241–250 of 346 posts

Re: WebAssembly support now shipping in all major browsers

#241
post #202

Earlier quoted context omitted.

The real problem is CSS. Implementing a compliant render engine is nearly impossible, as the spec keeps ballooning and the combinations of inconsistencies and incompatibilities between properties explode. Check out the size of the latest edition of the book "CSS: The Definitive Guide" : https://twitter.com/meyerweb/status/929097712754098181 Until CSS is replaced by a sane layout system, there's not going to be anothe…

I think Blink's LayoutNG project and Servo both show that you can rewrite your layout implementation (and Servo also having a new style implementation, now in Firefox as Stylo). I think both of those serve as an existence proof that it's doable.

It's doable if you already have a large team of experienced web engine development experts, a multi-million budget and years to spend on just planning.

Implementing an open standard shouldn't be like this. Even proprietary formats like PDF are much simpler to implement than CSS.

Re: WebAssembly support now shipping in all major browsers

#242

Earlier quoted context omitted.

and js. eventually!

JS is a language and not a bytecode media. Perhaps chocolate will replace cars and airplanes. I love me some chocolate.

>JS is a language and not a bytecode media

Does it even matter when most people are using it as a compiler target (even just from newer versions of the language)?

Re: WebAssembly support now shipping in all major browsers

#243
post #102

Earlier quoted context omitted.

We'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.

> 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

I'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 could be replaced with that for users who have JS enabled.

Again - just wow, that's really nice, Lua in a browser.

Re: WebAssembly support now shipping in all major browsers

#244

Earlier quoted context omitted.

and js. eventually!

JS is a language and not a bytecode media. Perhaps chocolate will replace cars and airplanes. I love me some chocolate.

I am extremely unclear on whatever point you're trying to make, here, because it really does seem to come from a place of ignorance on WASM and JS. It makes no sense.

It seems like you're claiming, in a really roundabout way, that WASM will never have DOM access, even though it's planned[1]. There are even VDOMs[2] for WASM already. Future WASM implementations that include DOM access can absolutely, and for many folks will, replace Javascript.

[1]: https://github.com/WebAssembly/design/blob/master/FAQ.md

[2]: https://github.com/mbasso/asm-dom

Re: WebAssembly support now shipping in all major browsers

#245
post #203

Earlier quoted context omitted.

I'm not sure I agree that the DOM is that bad(more that people are using it improperly and for the wrong things), but yeah, modern JavaScript is hardly to blame for anything. The closest thing to an argument I've heard is "mah static typing". Asking WebASM to be everything, including a rendering engine, is asking for problems at such an atrocious level.

> I'm not sure I agree that the DOM is that bad(more that people are using it improperly and for the wrong things) If an API makes it easy to make mistakes it's a bad API. Blaming "people" is a cop-out.

So what you're saying is that people are stupid?

If people are misusing the DOM API at a fundamental level(to do non-DOM related things), that's not a fault of the API. It's as if everyone has forgotten that DOM means Document Object Model. The vast majority of websites and web apps are not very complicated on the client-side, so I'd say that the DOM API generally does its job well. Trying to do anything that's not about constructing a document or is doing heavy amounts of animation or node replacement using a document-building API is asking for a bad time. It's quite implicitly attempting to break fundamentals of computer science.

Making the API one uses to render pages in a browser a free-for-all doesn't solve the problem, and you end up losing many of the advantages of having actual standards. What would be better is for the browser to provide another set of APIs for things beyond the "expertise" of the DOM. This kind of the case right now in some regards, but there's a reason why React and Glimmer use things like virtual DOMs and compiled VMs. I'd argue that a standardization of such approaches could be a different API that probably shouldn't even be referred to as a DOM because they are meant to take a lot of shortcuts that aren't required when you are simply building a document. In a sense, WASM is intended to fulfill this purpose without replacing the DOM or JavaScript.

Object-oriented programming is quite often misued/misunderstood. Does that mean it's a "bad" concept? I wouldn't say so. Education tends to suck, and people are generally lazy and thus demand too much from the tools they use.

I'm not copping-out because I'm not putting the DOM on a pedestal. Calling it a bad API because it doesn't work well for a small minority of cases is a total mischaracterization. If it was an objectively bad API, it wouldn't have seen the astounding success it has.

EDIT: I'm not saying that programmers are stupid... but that their expectations are sometimes not congruent with reality.

Re: WebAssembly support now shipping in all major browsers

#246
post #203

Earlier quoted context omitted.

I'm not sure I agree that the DOM is that bad(more that people are using it improperly and for the wrong things), but yeah, modern JavaScript is hardly to blame for anything. The closest thing to an argument I've heard is "mah static typing". Asking WebASM to be everything, including a rendering engine, is asking for problems at such an atrocious level.

> I'm not sure I agree that the DOM is that bad(more that people are using it improperly and for the wrong things) If an API makes it easy to make mistakes it's a bad API. Blaming "people" is a cop-out.

If an API is meant for documents and you're using it for applications, that's not the API's fault

Re: WebAssembly support now shipping in all major browsers

#247

Earlier quoted context omitted.

There's another reason why I want JavaScript in the browser to die: We haven't had a new browser engine written from scratch since KHTML. Firefox is a descendant of Netscape, Chrome (and Safari) is a descendant of WebKit which is itself a descendant of KHTML, Edge is closed source, but I'm almost sure there's some old IE code in there. Why? It's simply too expensive to create a fast (and compatible) JS engine. If Web…

WebAssembly has nothing to do with JavaScript. When people make this association it is clear they are painfully unaware of what each (or both) technologies are. WebAssembly is a replacement for Flash, Silverlight, and Java Applets.

Flash, Silverlight and Java Applets all provided APIs and functionality above and beyond what JavaScript or the browser DOM provides. WebAssembly is the opposite, as it is much more restricted than JavaScript. WASM is a sandbox inside a sandbox.

Re: WebAssembly support now shipping in all major browsers

#248

Earlier quoted context omitted.

So every package author understands each of their dependencies and all of their respective sub-dependencies, recursively on down? This is probably the best bit of programming humor I've read all morning.

>So every package author understands each of their dependencies and all of their respective sub-dependencies, recursively on down? Have they personally audited every dependency? Probably not. Is the list of dependencies known? Yes. Is the list fixed? Yes. On the webpage side: Does the content provider know what will be served by their ad network? No. Does the ad network provided content change? Yes, constantly. Does…

> Does the ad network provided content change? Yes, constantly. Does the content provider even know who ultimately will be putting crap on their web page via the ads? No.

Whoa! hold on a sec.. code inside a browser != Ad network, when people insert ads into programs outside of web browsers you will have the same issue, only potentially worse because you wont know if they properly sand-boxed them.

Re: WebAssembly support now shipping in all major browsers

#249
post #16

For people wondering about features like SIMD and GC support, here is a good status page: http://webassembly.org/docs/future-features/

Specifically for GC, all that page does is to refer to a GitHub issue that is invisible to anyone but WASM contributors :-(

Invisible? You mean locked? https://github.com/WebAssembly/design/issues/1079

I'm not a collaborator on the WebAssembly Org, but I can still see that issue just fine.

Re: WebAssembly support now shipping in all major browsers

#250

Earlier quoted context omitted.

The last time that a package I installed proceeded to install code that the vendor didn't know about was never. The last time a web page caused my browser to download and run js that the page owner didn't know about was five minutes ago.

So every package author understands each of their dependencies and all of their respective sub-dependencies, recursively on down? This is probably the best bit of programming humor I've read all morning.

:D ... obligatory xkcd https://xkcd.com/797/
Post reply on HN