Hacker News new | ask | show | jobs
by lj3 3497 days ago
> Webasm actually has the potential to be faster than many native apps at the same time.

How do you figure?

1 comments

This is the constant claim from the web community. You can easily find references that there is no reason javascript has to be slower than compiled code from long ago. They all boil down to the sufficiently smart compiler argument.

Of course that became well known to be ridiculous.

But rhino would change that. asm.js would change that ! V8 will change that ! Native client will change it ! P-nacl will change it !

Of course, for all of these you can find some skewed edge case where someone was able to make a benchmark say the javascript/web version was faster. . It never was faster in practice for any of these. Browsers, after 22 years of optimizations are still far slower than even pretty bad native apps ... And let's just not mention games (not to worry the latest javascript 3d abstraction will change that. Of course)

And now webasm will change it - I guess. Well, no, truth be told, I guess not !

As far as I can tell, pnacl came pretty darn close. It executes LLVM bitcode and supports hardware features like SIMD and threads. For some reason I'm not aware of[0], they made pnacl dependent on the pepper plugin api, which only chrome uses. That pretty much killed it dead on arrival. None of the other browser manufacturers were interested in implementing chrome's pepper api so they can run chrome plugins, especailly since the pepper api isn't open and isn't documented anywhere.

[0]: I'm sure there's a good reason for this decision, I just don't know what it is.

I would agree. PNacl is one of those technologies that failed because it died, not because it was bad. People felt it needed to be killed and it was killed, or abandoned.

There is criticism, such as that it only solved one part of the puzzle of getting real apps running on the web browser, but it's not like anything else came closer.

> And now webasm will change it - I guess. Well, no, truth be told, I guess not !

You didn't give anything to back up your claim except for 'nope, nuh uh'. V8 did speed up the state of the art in javascript and asm.js went further than that, but both of those are tangential.

Webasm is made for statically typed programs with explicit memory allocation. Combine that with the fact that most apps are not compiled natively and those that are still don't have explicit memory allocation unless made with swift for IOS. What is the limitation other than you not understanding webasm and not wanting to believe it could be JITed efficiently.