Live data from Hacker News

WebAssembly becomes a W3C Recommendation

w3.org

111–120 of 248 posts

Re: WebAssembly becomes a W3C Recommendation

#111
post #37

It's really uncanny how Gary Bernhardt predicted it all [0] a few years ago. [0] https://www.destroyallsoftware.com/talks/the-birth-and-death...

Repeating what I wrote here [1], Fabrice Bellard wrote JSLinux in 2011, which is a CPU emulator written in JavaScript that runs the Linux kernel (using typed arrays and relying on fast JITs). That's just a way of saying that "the best way to predict the future is to invent it" (and do so before people who were "predicting" it). If you knew about asm.js and Google's (now abandoned) Nacl and PNacl, there's nothing surp…

I think that's underselling the talk. Apart from the very enjoyable presentation, it makes valuable insights.

The talk isn't trying to sell itself as 100% original. It makes reference to asm.js and a game demo that already existed at the time of the talk as well as repl.it.

Despite that, I do think it makes a unique insight that even though JavaScript is ubiquitous, it will NOT be the language that future languages compile to, but rather a bytecode perhaps inspired by JavaScript that will be the language of the future. Also, importantly this bytecode will win; that is most languages will the ability to directly compile to or have a VM in this bytecode.

Moreover this bytecode has the potential to entirely supplant native code and can do so with equal or better performance.

At least to me, neither of those were obvious insights even though I knew of these plugins and JSLinux.

First off, those plugins died. Silverlight, ActiveX, Java on the web, Flash, all of these died out and were replaced by JavaScript before wasm really took off. It might've looked like the end state would be a version of JavaScript "winning."

Second, things like PNacl, Emscripten, etc. still seemed like curiosities (as the talk refers to when showing Repl.it). It wasn't clear that they or the ideas they championed would get widespread adoption.

These days it is looking more and more likely that wasm is going to become a target for all sorts of different compilers. The fact that it's a major compilation target of Rust, a language that's about as far away from what I would've thought of as a language for the web as possible, is striking.

And though we're still a long ways away from running everything on WebAssembly, it no longer seems as exotic an idea as it once did to me.

And because of that, as well as the fantastic presentation, I still return to this talk every so often awed at how much closer we are to realizing Metal.

There's still a lot of room for the talk to go very wrong, but it's not as far-fetched as when I first watched it.

EDIT: Put another way; the talk is interesting to me because it emphasizes the birth and death of JavaScript. It talks about a world where the same forces that propelled JavaScript to towering heights of popularity ultimately cast it aside and create a world not possible without JavaScript, but in which JavaScript itself essentially no longer exists.

Re: WebAssembly becomes a W3C Recommendation

#112

It's really uncanny how Gary Bernhardt predicted it all [0] a few years ago. [0] https://www.destroyallsoftware.com/talks/the-birth-and-death...

Seems like the obvious next step is using WebAssembly outside the browser so we can really go full-circle on this one EDIT: some quick googling shows it's already being done https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...

Completely! WebAssembly has a great potential outside of the browser. Mozilla has been doing a great work on their posts showcasing this new possibility.

Check out Wasmer! https://wasmer.io/ : along with other runtimes we are enabling the use case of WebAssembly programs as standalone applications that can run in any platform, or as libraries to be usable in any programming languages (disclaimer: I work at Wasmer!)

Re: WebAssembly becomes a W3C Recommendation

#113
post #11

Earlier quoted context omitted.

It would be hard (maybe not impossible) to access the DOM in WA without a GC making sure everything is sound, because the DOM and JS (meaning the GC) are very coupled. Currently, JS is used as a mediator between the two - so you do need some JS (but it could well be JS that you never have to write yourself). I recall one of the spec authors saying in an HN thread that a GC would be added eventually, back in the infan…

I'm a web dev and I don't know much about WASM. I've been wondering - will it be possible to render something to the screen without first going through the DOM? Or is the DOM literally the only way to display content? It's enticing to imagine being able to open a wasm file and seeing an application on the page. Kinda like how you can just open an image or a video in the browser, without rendering it via an html docum…

Currently the DOM is the content. You can not separate those.

I don't think changing this is even desirable. It's much easier and cleaner to standardize a stdlib of accessors.

Re: WebAssembly becomes a W3C Recommendation

#114
post #77

Earlier quoted context omitted.

"The future will be just like the past, but with a different name". I guess it's just as accurate when Gary Bernhardt says it as when everyone else says it. It's not exactly a theme that's gone overlooked before. But still... executing bytecode in the browser goes way, way, way, way back.

It’s not just executing code in the browser. It’s been a while since I’ve watched the video but its more about JavaScript becoming the universal assembly language. I think at least that aspect is wrong because Wasm came into existence. But ignoring that detail and subbing in Wasm for JS, it’s uncanny.

It's even more uncanny than that. The talk hypothesized that JavaScript will not be the universal assembly language but rather a lower level language (or more accurately an OS-like system I suppose as the talk presents it), "Metal," would be. In that respect it predicted WebAssembly on the nose.

Re: WebAssembly becomes a W3C Recommendation

#115

Earlier quoted context omitted.

That's just replacing trash with rubbish.

What would you prefer then, Lua, with its 1-based arrays? Python is a mature, universal, versatile, insanely popular dynamic language with a nice syntax. It fits the bill perfectly.

Something with a static/strong type system.

Re: WebAssembly becomes a W3C Recommendation

#116
post #81

Earlier quoted context omitted.

> embedding a WebAssembly runtime gives you all of that plus the ability for people to easily write plugins in any language No, you would still have to provide an application programming interface for every target language you want to support.

No, you don't. If you export functions to WebAssembly, any language that can run in WebAssembly can call those functions. And if you define WebAssembly Interface Types for your exported functions (note: still in development), any language that handles interface types can automatically handle things like "how does this language represent a string safely". Either way, you don't need to define a new API for every langua…

What you are describing is more like __asm__("") in C, not an interface for application developers. Those are still required for every single target language because of the mismatch between the levels of abstractions between those languages, webassembly and actual logic exported.

Re: WebAssembly becomes a W3C Recommendation

#117
post #77

Earlier quoted context omitted.

"The future will be just like the past, but with a different name". I guess it's just as accurate when Gary Bernhardt says it as when everyone else says it. It's not exactly a theme that's gone overlooked before. But still... executing bytecode in the browser goes way, way, way, way back.

It’s not just executing code in the browser. It’s been a while since I’ve watched the video but its more about JavaScript becoming the universal assembly language. I think at least that aspect is wrong because Wasm came into existence. But ignoring that detail and subbing in Wasm for JS, it’s uncanny.

In December that same year, the Internet Archive started letting people boot and run MS-DOS emulators in the browser. And this was well after binfmt_misc has been (ab)used with JS engines to execute JS like a native program.

A couple years earlier, NetBSD device drivers were running in the browser, and JS-engine-as-hypervisor was an explicit, if distant, goal. https://news.ycombinator.com/item?id=4757581

Re: WebAssembly becomes a W3C Recommendation

#118

Does anyone have any good success stories with WebAssembly in the actual context of using it on the web? That list of testimonials doesn't seem very inspiring as to whether or not the standard has seen actual production usage to justify being a recommended standard...

[deleted]

Re: WebAssembly becomes a W3C Recommendation

#120
post #6

Another nail in the Java coffin? I hope if doensn't refuse to die (again)

I don't think Java is a great language, but killing at this time would destroy a lot of value.

Besides, people mostly do not use Java because of the JVM, so I don't think WA will even make a dent on it. It's more likely that Java gets ported into WA than that WA kills it.

Post reply on HN