Live data from Hacker News

WebAssembly support now shipping in all major browsers

blog.mozilla.org

301–310 of 346 posts

Re: WebAssembly support now shipping in all major browsers

#301

Earlier quoted context omitted.

While I don't agree with your second point, which seems to be there purely to exclude Python, I'll run with it so as not to devolve into religious war territory. How about Lua?

A line terminator on *nix isn't a line terminator on Windows, which is a big deal if line termination ends a statement, and that assumes the file isn't modified in transit.

And semicolons are optional in JavaScript, makes it whitespace sensitive I suppose.

Re: WebAssembly support now shipping in all major browsers

#302
post #267

Earlier quoted context omitted.

Implement a WASM JIT in kernelspace & you don't have to have a userspace while still having hot code hopefully optimized to remove bounds checking. Now all your programs are WASM modules & we can replace your CPU with some random architecture that doesn't have to care about supporting more than ring0. Oh why not implement a nearly-WASM CPU? Probably just change branches to GOTO. Now the only program people care about…

There’s prior art for this too, Microsoft started a research project called Singularity that was essentially a kernel that only executed .NET bytecode, and had similar advantages (everything in ring0, no syscall overhead, etc.) It died pretty unceremoniously though.

It died because it couldn't become an actual product and had a lot of very smart engineers spending a lot of time on something that had no future. Some of the core tech was reused and turned into other products.

Re: WebAssembly support now shipping in all major browsers

#303
post #135
post #34

A good occasion to watch Gary Bernhardt's talk "The Birth & Death of JavaScript" [0] again, where he talks about the precursor of WebAssembly: asm.js and the future implication it "could" have in the future in a really humorous way. A few years old but still relevant. You want Gimp for Windows running in Firefox for Linux running in Chrome for Mac? Yeah sure. [0] https://www.destroyallsoftware.com/talks/the-birth-and…

And for a somewhat more practical but at the same time more exotic example, the Internet Archive has a ton of old minicomputers and arcade games running in MESS/MAME, each compiled to webasm. One click and you can boot anything and play it in your browser. https://archive.org/details/softwarelibrary https://archive.org/donate/

That is gorgeous. I just booted Win 3.1 to Minesweeper in less than a minute on my phone's browser.

Too bad makers of the original Minesweeper did not think to build touch input support.

Re: WebAssembly support now shipping in all major browsers

#304
post #244

Earlier quoted context omitted.

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 folk…

It will take more than just DOM access to replace Javascript. Just off the top of my head you'd also need access to the event loop, XHR, websockets, audio & video, webRTC, Canvas, 3D, Filesystem, cookies & storage, encryption, Web Workers and more.

Re: WebAssembly support now shipping in all major browsers

#305

Earlier quoted context omitted.

While I don't agree with your second point, which seems to be there purely to exclude Python, I'll run with it so as not to devolve into religious war territory. How about Lua?

A line terminator on *nix isn't a line terminator on Windows, which is a big deal if line termination ends a statement, and that assumes the file isn't modified in transit.

Yet somehow, Python doesn't have this problem - it simply treats both types of line terminators as valid. So do all other modern languages that rely on whitespace.

Re: WebAssembly support now shipping in all major browsers

#306
post #51
post #47

Earlier quoted context omitted.

Most assembly languages have a "jump" instruction, though -- wasm supports only structured control flow.

It has br and loop , good enough.

I don't think it's sufficient for full-fledged generalized tail call elimination. You can certainly optimize a self-recursive call down to a loop, but consider a case where a function accepts another function as a pointer, and invokes that pointer in a tail call position, for example (i.e. anything written in continuation-passing style).

Re: WebAssembly support now shipping in all major browsers

#307

All the excitement around wasm seems quite puzzling to me. Yes, I understand that you can program in whatever language you love but what new language are you hoping would be supported? C? C++? Fortran? As far as I am concerned, all the languages I care about already have compilers that target JS.

JS imposes a memory/object model that doesn't map to other languages particularly well, so you either have to play fast and loose with semantics (effectively creating a dialect of the language that you're transpiling), or pay extra overhead for faithfully emulating the original behavior.

WASM is much lower level, and should allow compilers and VMs to use best-fitting data structures and layout.

Re: WebAssembly support now shipping in all major browsers

#308
post #241

Earlier quoted context omitted.

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.

TCP/IP is an open standard, yet I suspect you would have the same problems implementing it (Microsoft famously copied BSD stack at first).

You could probably say the same thing about any complex open standard, like FTP etc.

Re: WebAssembly support now shipping in all major browsers

#309

Earlier quoted context omitted.

There is a lot of processing that doesn't inherently need the DOM, and there's also server-side stuff as well. I think you'd be surprised!

Yeah, but WASM was supposed to democratise the web development not to do just server-side stuff. Without DOM and Web APIs you can't do much Web related.

> not to do just server-side stuff

He didn't say anything about 'only server side stuff'. There is plenty that has already been demonstrated with webasm - video editing and filtering, audio editing and filtering, advanced computer graphics, direct porting of games, etc.

Re: WebAssembly support now shipping in all major browsers

#310

Earlier quoted context omitted.

A line terminator on *nix isn't a line terminator on Windows, which is a big deal if line termination ends a statement, and that assumes the file isn't modified in transit.

And semicolons are optional in JavaScript, makes it whitespace sensitive I suppose.

Yes and no.

The language specification requires the use of semicolons. If a semicolon is not supplied the interpreter will insert it for you. That magical insertion step is referred to as ASI. I don't remember if ASI is mentioned in the spec (as I don't think it is), but at the very least it is a de facto standard as missing ASI breaks the web.

As stupid as all that sounds... semicolons are actually required to terminate statements in JavaScript.

Post reply on HN