WebAssembly: An Attempt To Give the Web Its Own Bytecode
New submitter Josiah Daniels writes with this kernel from a much more detailed article at Ars Technica about what already looks like a very important initiative: WebAssembly is a new project being worked on by people from Mozilla, Microsoft, Google, and Apple, to produce a bytecode for the Web. WebAssembly, or wasm for short, is intended to be a portable bytecode that will be efficient for browsers to download and load, providing a more efficient target for compilers than plain JavaScript or even asm.js
my submission here
They want their bytecode back.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
The web is hardly usable anymore. Even the simplest web sites are slow as molasses, thanks to heaps of "active" content alongside the actual information. Now you're going to bestow your own runtime on us? Now that we've finally ditched Java and Flash?
Why did /. ruin their layout by moving comment counts into the headlines? Sometimes the counts do not display at all. Is Dice outsourcing design to Retardistan?
Not needed. Simple as that. Our devices are getting more powerful each generation, and they worked well enough with HTML and human-readable text. This probably wouldn't even be on the table if it weren't for the bazillion advertisements and spyware on most major websites. My 2 cents at least.
Just what we need, another browser executable language to aid in drive-by malware. And i'll bet it'll be the kind to execute without prompts too. Activex mark 2 perhaps?
This is ultimately where the browsers need to go. Many have tried in the past, but always from some side angle assuming that it had to be through a plugin or had to use Javascript as the underlying byte code, e.g. GWT. This could finally allow a wide array of languages to be used to build web applications, similar to the explosion of languages that now run on a JVM.
10 minutes working on a sig. What a waste.
We are not giving back, so buzz off.
Have you run a Java applet lately? Or maybe you'd prefer Silver-light?
I think Adobe had something called Flash that's pretty popular too..
Java virtual machine (JVM)
I've been saying this for twenty years.
Java tried to be this, and unfortunately came close enough to remove the incentive to improve but not quite good enough to really accomplish the goal.
Everything on the web is ultimately a crude hack on top of HTML, which is why there are new development and deployment frameworks constantly being created, because no-one has come up with something good.
1) Why is this needed?
With the removal of binary plugins in Chrome and Edge (and soon to happen on Firefox), a way to code at native performance in the browser is still needed. Mainly to run high performance games, audio software, etc. You may not want it, but a lot of people consumes this content so there is a large industry behind it.
2) Why not asm.js?
This is almost the same as asm.js, except it's precompiled, so it' s more efficient for Javascript engines to JIT or AOT. Currently, compiling large asm.js codebases results in a large download and resource intensive compilation.
3) How is this different from Java, Flash, Silverlight?
It is different because:
A) It' s a w3c standarized effort
B) All the big players are behind it (Google, Mozilla, Microsoft and Apple)
C) It relies on the browser security model, it does not bypass it
D) It' s a low-level bytecode, more so than AS3, JVM or Silverlight, so it can run any language.
E) It runs in the same "space" as the DOM, it's not a separate/embeeded app.
4) Isn' t this unsafe or a new attack vector?
No, it relies on the same browser security model as Javascript, so It's as dangerous as having Javascript enabled. Read up on how PNACL works for material on why this is not unsafe.
5) Will it replace Javascript?
It is not intended to, but it gives developers the same API with the ability of writing in any language, even C++, so developing a website using tools such as Qt will become possible (efficiently at least).
Nice idea guys, but unless Browsers REFUSE to run code of any type (including Javascript and Java) without some kind of checksum confirmation, the whole framework will be open to man-in-the-middle malware insertion.
If telephones are outlawed, then only outlaws will have telephones.
I like many other people are forced to work in JavaScript. It's not too bad a language if you are careful but it would be nice to have some choose when working with webpages.While at first it will be all JS they plan to expand WebAssembly to other languages which could be compiled to the bytecode. Hurrah!
The most dangerous drug
This is literally various similar projects (PNaCL, asm.js, etc) being merged into one industry-wide project. And by literally I mean the PNaCL and asm.js teams are working on WebAssembly.
Probably some legal bullshit, but I think the effort could be better spent in making the JVM attractive and safe for the web...
Anything which tries to run a "binary" or bytecode in the browser is going to be vulnerable to sandboxing issues. It doesn't matter who writes it, it doesn't matter how it's "designed" or "architected", there will be vulnerabilities. Hopefully there is a better and more efficient patching process than there was for the much-hated Java sandbox, but no one should fool themselves that this is a "secure" approach for web applications.
I do not fail; I succeed at finding out what does not work.
One of the nice things of the web is that teens learning there little way about computers can look at the JavaScript source code and often figure out how some little trick is accomplished and from there gain insight in how programming works and inspiration for new tricks. Much the same as when we were punching in lines of BASIC from a magazine into a computer that didn't support much beyond 40x25 green & white characters.
I think this change would result in a lot of JavaScript being replaced with essentially a kind of assembler which will be really tough to untangle, especially for newbies. And I think that results in a kind of digital desertification.
We are slowly moving towards this nightmare ...
https://www.destroyallsoftware...
It boils down to "why not pre-compile entire websites into binary packages per-page? It would make it much faster and more efficient for the browser to load it..."
http://developers.slashdot.org...
You don't seem to realise that this doesn't add anything which isn't already possible with JavaScript. Downloading bytecode (as with Java) versus downloading source code then compiling it to bytecode (as with JavaScript) makes no difference to security. It's what that bytecode can do which matters.
Java's problem wasn't the addition of an interpreter. Java's problem was the addition of a ton of extra native functions which could be invoked from that interpreter.
This effort doesn't have that problem because the only functions available to the bytecode are those already available to JS.
You obviously do know what you're talking about.
Guess what -- machine code isn't executable either. As winword macro language (or VBA or however its mutation du jour is called these days) -- those aren't executable either.
But take a lesson from history -- all of those, and the Java VM make for wonderful malware delivery platforms.
Remember the last big holes in the Java VM? Some obscure introspection stuff tacked on the oh-so-type-safe VM opened them up.
Of course, JPEG or WMF (remember this one) or any sufficiently complex format can do that too, but the task gets significantly more complicated if you include an execution model (be it real or virtual, that makes no big difference) in the mix
Everyone making the same obvious complaints about an obvious click-bait article, with little to no interesting conversation or debate.
Moreover, replacing "read more" with "share" is one of the more fucked things i've ever experienced. I have been happily clicking away in the lower left for many years. To use that against me for monetary gain is repugnant.
Fuck dice and your trying to monetize my decades of lurking on slahdot.
Its about 1 billion times better than minified js.
http://michaelsmith.id.au
I'm sensing a systemd joke in here somewhere.
Your idea will fuck up the internet. Seriously.
The internet is already fucked up. Seriously.
After reading all the comments in this discussion, it's clear to me that nobody here has the final word on this subject.
A few have posted their ideas which approach the truth, and are being blasted for it. I love it. Makes me sleep a thousand times easier at night.
Not going to explain to you why you're wrong. I can guarantee you'll figure it out eventually; when the right product hits the market.
Yeah, and because the functionality is actually needed, with JavaScript you get a bunch of downloaded "extensions" that may or may not have vulnerabilities of their own, or roll your own code, which is even more likely to have bugs.
People keep re-inventing the wheel and insisting that their "new" invention isn't vulnerable to the same problems as those of the past. After 35 years of programming, it is just sickening to see the same arrogance from generation after generation of programmers.
I do not fail; I succeed at finding out what does not work.
"Efficient downloading" is a nonissue. Existing compression, concatenation, and minification techniques yield file sizes that a binary format will have a great deal of trouble beating at all, and even when it does, the savings will be no more than a few bytes at best.
"Efficient parsing" is a nonissue. This has been true for decades. Browsers simply do not spend enough time parsing JavaScript for it to ever become an issue. This is sorely misguided premature optimization at best.
"Language choice" is a nonissue. Emscripten and its kin have already solved the problem of compiling other languages to JavaScript. These languages will still have to be compiled to the bytecode, and gain no benefit from doing so.
"High performance" is a nonissue. This is what asm.js is for, and indeed, the existing polyfill uses asm.js to achieve its performance gains. This is a newer solution than those for the previous problems, but either way, the problem is solved.
"A standard runtime specification" is a nonissue. We already have one of those. It's called ECMAScript.
There is no point to this. All it does is comply with buzzwords and kowtow to JavaScript-haters. And make closed-source Web applications that much closer to feasible, I guess, but no one would consider that a benefit, right?
If by bytecode you mean 8-bit instructions for a stack machine, such as Python and the JVM use, then WebAssembly is NOT NOT NOT a bytecode. In fact, it is a concise binary encoding of a program in AST form. The team are working on a polyfill for existing browsers which will translate the AST into Javascript for execution. Future browsers will be able to JIT-compile the WebAssembly in much the same way as they JIT-compile asm.js or its equivalent.
Basically, WebAssembly is a distributed compiler infrastructure for the web, where browsers get to see a pre-parsed top-down view of a program instead of the bottom-up view that the JVM gives. Low-end devices will be able to quickly translate the AST into something that runs relatively slowly; browsers etc on high-end devices will be able to do lots of optimization.
Further reading:
* https://brendaneich.com/2015/0...
* https://github.com/WebAssembly...
BTW, the really scarey thing to be learned here is near the top of that FAQ: "pthreads ... are coming to asm.js". Yep. Asm.js will support pthreads. And people will write code that uses pthreads. In your browser.
Great... Just what we need... Another virtual machine for hackers to attack...
But one set of injected code works everywhere with this. Not so with JavaScript.
While the advantages are significant, let's not forget about the disadvantages:
* There will be fewer browser add-ons which extend the functionality of a website, as it will be a lot harder to figure out how the code works.
* It will no longer be possible to inspect the JavaScript-code to see how it works and learn from it.
* It will no longer be possible to inspect the JavaScript-code to look for security problems.
* It will no longer be possible to inspect the JavaScript-code for abuse of your privacy.
* It will be easier for malicious sites to run undesirable code in your browser undetected. (Such as Bitcoin miners.)
The problem with asm.js (and now WebAssembly) is it targets C++ delevopers. No one who works on the web codes in C++. The best thing they can do for adoption is to compile from a langauge that web developers already use: C#, Java, ruby, python, etc. I'd love to use something like this, but I can't expect my coworkers to learn C++ and the company to buy C++ tooling.
In the end you'll wonder why you don't just download the EXE.
Because you can't easily run an EXE on anything but an x86 PC running Windows, or in some cases an x86 PC running Wine.
I only use one platform. Apps should tailor themselves to my one platform
Now watch as the majority of app developers tailor their apps to platforms other than yours.
[To continue reading this comment, install Conglomo Reader. Available exclusively for Xubuntu.]