Live data from Hacker News

Compiling to WebAssembly: It’s Happening

hacks.mozilla.org

61–70 of 225 posts

Re: Compiling to WebAssembly: It’s Happening

#61
post #6

Earlier quoted context omitted.

The important use case is to allow people to write web applications with their language of choice, instead of horrible javascript. And get near full performance.

I can't believe people still bash JavaScript. I've used a lot of different languages including Java, C#, C++, AVR Assembly, Python and others but JavaScript is my favourite and I would not want to go back. I think its a shame that some people just didn't seriously try JavaScript. It's a very powerful, expressive language. Also, testing with JS is amazing - Especially unit testing on Node.js. It lets you do stuff like…

I've tried JavaScript, and I decided I preferred type safety. This kind of thing:

> It lets you do stuff like redefine entire objects, properties or methods at runtime

Sounds horrifying to me, because, as in Ruby[1], library authors will decide that's a good idea. Typeclasses/protocols solve this problem perfectly, while maintaining type safety.

[1]: for some reason, this seems to be less of an issue in Python and Obj-C, even though it's totally doable?

Re: Compiling to WebAssembly: It’s Happening

#62
post #3

Web assembly always makes me a little sad. It feels like we are going back to flash only it won't be bad this time, I promise, no really. I always feel like the most obvious use for it is to start writing truly hateful and abusive code. I'm sure this is because I'm getting old.

The main use for it (for me at least) is to write fast numerical code (physics modeling, audio processing, image processing, machine learning, 3D rendering, statistical analysis, etc.) in a deterministically fast way against an easy-to-reason-about programming model with an ability to manually allocate memory and structure data, instead of hoping that every browser’s heuristic-driven JIT will be able to optimize some…

The issue with this is that if you care about speed, you need to be using SIMD -- and wasm doesn't seem to want to support it -- stating a "minimum viable" standard from the year 2000.

Re: Compiling to WebAssembly: It’s Happening

#64
This sounds like an odd question, but I honestly need somebody to explain this to me...what is the motivation behind the modern trend to put everything on the web? Is there something you get by running your program from a browser that you don't get from downloading and running an elf or a text file, or is this entire trend based around appealing to users who don't actually know how to use their computers?

Re: Compiling to WebAssembly: It’s Happening

#65

Earlier quoted context omitted.

In the current proposal there is no way for WebAssembly to directly access the DOM (or any other "Web API" objects). Basically you will need to drop back down into javascript and handle that there (basically how asm.js does it now). But there is a proposal to eventually integrate direct DOM access into Web Assembly, but that's for after they get it up and running.

If they wanted to do it right, then an HTTP requests itself should serve a compiled HTML binary based on an AST. The binary version of HTML.

I would consider that the worst scenario. If each website was its own binary application it would undo the open source aspect of websites (even though that's only partly true today due to all the obscured javascript). But maybe that would actually be desirable for all companies which rely on advertising revenue and want to prevent any modification of their web content (such as removal of ads). It'll be interesting to see how the web develops in the future. WebAssembly definitely seems to give more control to the author.

Re: Compiling to WebAssembly: It’s Happening

#66
post #62

Earlier quoted context omitted.

The main use for it (for me at least) is to write fast numerical code (physics modeling, audio processing, image processing, machine learning, 3D rendering, statistical analysis, etc.) in a deterministically fast way against an easy-to-reason-about programming model with an ability to manually allocate memory and structure data, instead of hoping that every browser’s heuristic-driven JIT will be able to optimize some…

The issue with this is that if you care about speed, you need to be using SIMD -- and wasm doesn't seem to want to support it -- stating a "minimum viable" standard from the year 2000.

Existing Javascript JITs also don’t output SIMD instructions as far as I know.

I expect SIMD support can be added to wasm at some future date.

Re: Compiling to WebAssembly: It’s Happening

#67
post #64

This sounds like an odd question, but I honestly need somebody to explain this to me...what is the motivation behind the modern trend to put everything on the web? Is there something you get by running your program from a browser that you don't get from downloading and running an elf or a text file, or is this entire trend based around appealing to users who don't actually know how to use their computers?

You get a largely cross platform, consistent UI that can easily talk to outside services without being configured. All of these things help make the application work consistently across the many devices that exist now (Computers, smart phones, tablets, mp3 players, refrigerators[1], etc.) so you really can develop once and deploy everywhere. It also does seriously help the users that don't know how to use their refrigerator[2] so they can look up recipies and plan shopping trips.

[1] http://www.digitalafro.com/samsung-smart-fridge-serves-up-re... [2] https://productforums.google.com/forum/#!topic/calendar/Uhfp...

Re: Compiling to WebAssembly: It’s Happening

#68
post #64

This sounds like an odd question, but I honestly need somebody to explain this to me...what is the motivation behind the modern trend to put everything on the web? Is there something you get by running your program from a browser that you don't get from downloading and running an elf or a text file, or is this entire trend based around appealing to users who don't actually know how to use their computers?

It's the current fad. But nothing new. Since the beginning of computing the tides go from thin-clients and fat-clients back and forth. Currently fat-clients are en-vouge.

Re: Compiling to WebAssembly: It’s Happening

#69

Earlier quoted context omitted.

What makes WebAssembly like Flash? Please elaborate. You already can't just read someone's JavaScript code if they're using a transpiler or uglify or something like that, it looks like line noise and you basically have to go through a lot of work to reverse engineer it. WebAssembly is no worse. The JavaScript environment on the web reminds me of the "walled gardens" that were Lisp machines back in the day, that force…

> "walled gardens" that were Lisp machines back in the day, that force you to write code in Lisp, Lisp machines come with Fortran and C compilers.

I never used it, but allergly they where not only comming with a Fortran, but the best Fortan IDE.

Re: Compiling to WebAssembly: It’s Happening

#70
post #64

This sounds like an odd question, but I honestly need somebody to explain this to me...what is the motivation behind the modern trend to put everything on the web? Is there something you get by running your program from a browser that you don't get from downloading and running an elf or a text file, or is this entire trend based around appealing to users who don't actually know how to use their computers?

You want to reach as many people as you can, and nowadays people are pretty proficient with using a browser to go to a web page. If you can reduce the number of steps between you and your users, I'd say that's a good thing. Right now that can mean putting everything on the web, in the future, who knows.
Post reply on HN