Live data from Hacker News

What makes WebAssembly fast?

hacks.mozilla.org

221–230 of 238 posts

Re: What makes WebAssembly fast?

#221
post #201
post #199

Earlier quoted context omitted.

JS provided that already without WebAssembly, no?

I don't understand why the downvotes , JS is one of the most target languages. Elm,GHJS(Haskell),Purescript,Clojurescript and supersets like Typescript which come with their own toolchains.

Also Javascript itself is frequently compiled down to an older version of Javascript.

Re: What makes WebAssembly fast?

#222

My excitement for WASM has nothing to do with speed or efficiency of the runtime. It's all about finally having a universal compile target for the web. We're finally going to be able to develop web apps in a proper language of our own choosing, without needing hacks like TypeScript. Hopefully, this will lead to real dedicated IDE tooling and standardized libraries for the web along the lines of what's available in iO…

Leading to real IDEs, real languages, real libraries. downsides will be some proprietary solutions will crop up.

There is no harm in that

Re: What makes WebAssembly fast?

#223

Earlier quoted context omitted.

GC is just something you implement on the language runtime.

Then you're shipping the entire (or at least large pieces of) language runtime to the client since presumably, you'd need to compile that to WASM as well.

You can probably fit the runtime in a 10th of the size of JQuery.

You'll need most of a runtime anyway, since it provides much more than GC.

Re: What makes WebAssembly fast?

#224

Earlier quoted context omitted.

GC is just something you implement on the language runtime.

Then you're shipping the entire (or at least large pieces of) language runtime to the client since presumably, you'd need to compile that to WASM as well.

Something that never really worked was cached versions of jquery (and similar) from cdn. One reason is that browsers didn't give them any particular precedence. The other was that jquery was moving quite fast compared to devs using it so as an end user i nearly never benefited from the caching. I wonder if this might work better for language run times. Maybe browsers could be provided with some manifest saying 'this site needs python 3+' or 'this site needs python 3-3.5' so that end users end up with less runtimes cached.

Re: What makes WebAssembly fast?

#225
post #58

Earlier quoted context omitted.

They decided to use it because it let you add things like drop-down menus (and falling snowflakes!) to your website, which made it look better than your competitor's website. Syntax was just the hoop to jump through to achieve that, and a very minor one at that. I doubt it would have made any difference.

You honestly believe that Javascript would have been equally successful if it had shared similar syntax to, say, Brainfuck? Especially given the alternatives that were available at the time? If syntax doesn't matter, I guess so, but I'm not sure I'm convinced.

I was talking specifically about the Scheme-like syntax that JS originally had. That syntax was a minor obstacle. BF-like syntax would be a far bigger one. Although what would probably have happened then is the same thing we saw with JS anyway - someone would have made a transpiler from something more sane - except it would have happened much faster.

Re: What makes WebAssembly fast?

#226

Earlier quoted context omitted.

There are a lot of developers -- a huge amount, actually -- who believe memory management is too important to leave to an automated GC algorithm. That, and the memory requirements of a particular application might require something different than a GC provides.

If your algorithm is such that everything can be placed on the stack then GC gets you nothing.

A lot of GC languages don't give you access to the stack, though, all objects live in the heap.

Re: What makes WebAssembly fast?

#227

Earlier quoted context omitted.

None of these things are true about MS Office (native - not online 365) right now, which was the specific subject this sub-thread.

You seem to have totally missed what the "specific subject of this sub-thread is". A quick reminder from just the parent comment above to which we're answering: "Imagine MS Word is running in your browser without them having to rewrite it in JS!". That is, we're not talking about the native MS Office "right now".

> Nothing improved for me as a consumer

Improved with respect to what, then, if not the current "right now" Office?

Re: What makes WebAssembly fast?

#228

Earlier quoted context omitted.

You underestimate the average programmer's aversion to Lisp syntax, despite it being the clearly superior syntax. If JavaScript had had Lisp syntax, then everyone would still be using Flash. Or some other plugin that provided a language with a more popular syntax.

You underestimate the average programmer's aversion to Lisp syntax, despite it being the clearly superior syntax. IME it's a learned thing from only knowing languages that at least superficially resemble ALGOL. JS is a first language for a lot of people - because their goal was to make a website do something. Scheme would not have been any different.

IME it's a learned thing from only knowing languages that at least superficially resemble ALGOL.

IME many computer programmers learned Lisp in college and for some reason hated it–I think in part due to the syntax and in part because they had a hard time with recursion and other "mind-bending" concepts. They often still harbor an irrational precedent to this day.

Me, on the other hand, I loved Lisp as soon as I learned it. (Perhaps I was primed by having learned APL in high school.) I changed my major from Astrophysics to Computer Science because I felt that SICP was even cooler than black holes and neutron stars.

Re: What makes WebAssembly fast?

#229

Earlier quoted context omitted.

SPAs are still considered too fat. how do you miss the nearly daily "web bloat crisis" stories on HN?

You're probably access web sites sitting at home or office, where you have decent 10+ Mbps channel. All this changes when you travel and you use either slow public WiFi or phone tethering. Yes, there's 4G, but in most places in most countries 4G coverage is very poor: it's only in the most populated areas. I travel between countries and of course I hate staying in huge cities because they're expensive and noisy. But…

Well, I'm talking about "state of the art" apps. You can always fallback to server-side rendering/pure html if the connection is too slow and you can't afford the boostrap/init download. Depending on your use case SPA may actually be an improvement as the static resources can be cached. WASM is supposed to compete with native apps. Why don't you complain about MBs to download on native apps?

Re: What makes WebAssembly fast?

#230

Earlier quoted context omitted.

GC is just something you implement on the language runtime.

Then you're shipping the entire (or at least large pieces of) language runtime to the client since presumably, you'd need to compile that to WASM as well.

Given that runtimes like Lua are comparable in size to a single image, and/or could be cached in web browsers, I don't think that will much of a problem. And the more that WebAssembly adds, the smaller that will get.

Obviously if we're trying to run a full JVM or CLR in WebAssembly, that will cause problems, but C# and F# both have compile-to-js targets that would likely just get faster.

Post reply on HN