Slashdot Mirror


Major Browsers Add Experimental Support For WebAssembly (thestack.com)

An anonymous reader writes: Four major web browsers have announced support for the near-native compiling technology WebAssembly, and collaborated to bring an initial common game demo of Angry Bots, running via Unity and WebAssembly, to experimental builds of Chrome, Firefox, Microsoft Edge and, shortly, Safari. WebAssembly was launched last year in a joint project between Microsoft, Mozilla, Apple and Google as a potentially more efficient route to assembly-level performance than asm.js, which is in itself a low-level subset of JavaScript.

118 comments

  1. assembly-level performance from Javascript by xxxJonBoyxxx · · Score: 1, Funny

    >> assembly-level performance (from Javascript)

    You keep using that word, I do not think it means what you think it means.

    1. Re:assembly-level performance from Javascript by Anonymous Coward · · Score: 0

      Soon, the world will be filled with assembly-level angry bot computers! Now with bootkit technology that is webscale! Oh, check your logs I think someone just sharded...

    2. Re:assembly-level performance from Javascript by Anonymous Coward · · Score: 0

      Im a noob so I may be wrong but dont we already have this technology. Everytime I look at disassemble memory objects of Firefox while on a site running flash, I see:

      nop ...
      nop
      push 0x66
      pop eax
      cdq
      push edx
      inc edx
      push edx
      mov ebx, edx
      inc edx
      push edx
      mov ecx, esp
      int 0x80
      xchg ebx, eax
      mov ecx, edx
      loop:
      mov al, 0x3f
      int 0x80
      dec ecx
      jns loop
      mov al, 0x66
      xchg ebx, edx
      push 0x58FF5A9A
      push word 0x5C11
      push word bx
      inc ebx
      mov ecx, esp
      push 0x10
      push ecx
      push edx
      mov ecx, esp
      int 0x80
      push 0xb
      pop eax
      cdq
      mov ecx, edx
      push edx
      push 0x68732f2f
      push 0x6e69622f
      mov ebx, esp
      int 0x80

    3. Re:assembly-level performance from Javascript by Anonymous Coward · · Score: 0

      "that" is singular, you quoted five words. Choose.

    4. Re:assembly-level performance from Javascript by erapert · · Score: 0
    5. Re:assembly-level performance from Javascript by UnknownSoldier · · Score: 1

      I think the conflation comes about due to Javascript compiling to assembly code.

    6. Re:assembly-level performance from Javascript by Anonymous Coward · · Score: 0

      You seem to be confusing assembly code with machine code. Machines run machine code not assembly code. Assembly code is converted to machine code by an assembler. WebAssembly is compiled to neither. It compiles to bytecode, similar to how Java works.

    7. Re:assembly-level performance from Javascript by UnknownSoldier · · Score: 1

      Obviously you haven't worked with compilers long enough to understand the "compiling to assembly code" is the defacto standard nomenclature (regardless of pedantry) even if you emit bytecode on the backend, or technically compile to Lithium, an IR (intermediate Representation) like you do in V8 in the latter case.
      * http://www.mattzeunert.com/201...
      * http://jayconrod.com/posts/51/...

      Hell, even the V8 engine uses that terminology:
      * https://github.com/v8/v8/blob/...

  2. We got rid of flash and applets by Anonymous Coward · · Score: 1, Funny

    Now this?????

    1. Re:We got rid of flash and applets by NotInHere · · Score: 0

      Flash was a technology developed by a single company and parts of it were just cheap copies of the back then still limited html4/js environment, while other parts were reasonable extensions. The extensions added by flash were added over time into html5 and related APIs.

      Applets were a technology developed in the flash age, built by a company that mostly targeted the enterprise market. It only needs to work, not work well. Having a JVM with platform independent bytecode is a great idea, but it has failed for several reasons. Research on these matters is much more advanced, and the market knows much better what it wants.

    2. Re:We got rid of flash and applets by Anonymous Coward · · Score: 0

      I was just going to post about how we are finally getting rid of JRE (in browser with v9) and Flash. This is lunacy at its finest. What could possibly go wrong??? If you install this crapware, you get what you deserve. I am sure the Angler EK dev team is just thrilled!

      CAPTCHA: madness

    3. Re:We got rid of flash and applets by beelsebob · · Score: 4, Insightful

      Right, now we have an open standard byte code that any language can target, and any browser can implement, along with several competing implementations, and lots of eyes looking at the security of those implementations.

      So yeh... HELL YEH, NOW THIS!!!!

    4. Re:We got rid of flash and applets by vivaoporto · · Score: 3, Interesting

      and any browser can implement

      Up until someone finds a way to introduce either a patent encumbered functionality (like H264) or one inherently proprietary (like EME for DRM) to poison the well and keep real independent implementations out of scope for everybody else except the incumbents.

    5. Re:We got rid of flash and applets by Junta · · Score: 0

      the enterprise market. It only needs to work, not work well.

      That's probably the most accurate succinct explanation of 'enterprise' software I've ever seen. Except the 'needs to work' part is generally a mild suggestion rather than a rule.

      I'm just amused when people speak of 'enterprise grade' software as if typical enterprise software is something to actually look up to...

      --
      XML is like violence. If it doesn't solve the problem, use more.
    6. Re:We got rid of flash and applets by ripvlan · · Score: 0

      Enterprise Grade means it has bells and whistles that only a CTO would love. Such as the ability to backup to legacy mag-tapes. Or runs on hardware that the software company would be willing to support. Or plugs into a single-sign-on that actually works, or SSL gateways, Citrix solutions, VDI, etc. Things that "save" money for a large company.

      End of the day - enterprise just means one throat to choke.

    7. Re:We got rid of flash and applets by Junta · · Score: 1

      I think the only universal truth of enterprise software is software selected for someone based on executives having enjoyable golf games/trips. I see plenty of 'enterprise' stacks that are like you say, but also ones that are an unholy amalgamation of disjoint things from different companies.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    8. Re:We got rid of flash and applets by Anonymous Coward · · Score: 0

      I don't see how that's any more likely with wasm than someone poisoning the JS well. That is, it's wholly unnecessary to bother, when you can just add H264 or EME/DRM or WebP or whatever to your browser without piggybacking it like some rider on a bill. Heck, Google has been "poisoning the well" with a lot of tech that only works in Chrom(e|ium) for years now, and Apple did the same with CSS/JS extensions back when the iPhone came out. I can't see how wasm makes the situation any worse from that perspective.

    9. Re:We got rid of flash and applets by Actually,+I+do+RTFA · · Score: 1

      Right, now we have an open standard byte code that any language can target, and any browser can implement, along with several competing implementations, and lots of eyes looking at the security of those implementation

      Flash was an open standard byte code (well documented too) with at least once complete F/OSS implementation.

      The difference is now ads in JS can bypass the easy "do not play Flash except from whitelist" method of killing nasty ads.

      several competing implementations

      For the love of holy things, why would I want multiple competing, incompatible, implementations of a programming runtime environment?

      --
      Your ad here. Ask me how!
    10. Re:We got rid of flash and applets by Darinbob · · Score: 1

      I thought enterprise grade meant you had to pay 6 to 7 figures for maintenance.

    11. Re:We got rid of flash and applets by __aaclcg7560 · · Score: 1

      I'm just amused when people speak of 'enterprise grade' software as if typical enterprise software is something to actually look up to.

      The mistake some people make is thinking that an IE6 intranet website is enterprise-grade software.

    12. Re:We got rid of flash and applets by roman_mir · · Score: 1

      Enterprise only means one thing: SLA. Nothing about 'enterprise' is in any way better, most often enterprise means monotone, monolith, boring but there is somebody to talk to (or at least there is a piece of paper that is signed that says there is somebody to talk to).

      That's all it is, that's all it was and that's all it will be.

    13. Re:We got rid of flash and applets by Grant_Watson · · Score: 1

      For the love of holy things, why would I want multiple competing, incompatible, implementations of a programming runtime environment?

      Because you remember what a single-browser hegemony was like and you don't want us to go through that again.

    14. Re:We got rid of flash and applets by beelsebob · · Score: 1

      Because when there's only one single, or a very few implementations, that implementation gets rapidly stale and shitty.

      See for example, Flash, and Java, or just with generic web techs... IE.

      Add two implementations of generic web techs (i.e. Gecko and WebKit), and suddenly the quality has gone sky high.

    15. Re:We got rid of flash and applets by Actually,+I+do+RTFA · · Score: 1

      Runtimes != Browser. See, Chrome, Chromium, Opera and others.

      Also, IE6 was bad because it didn't play well with established standards, and was greedy of MS, but it wasn't actually horrible.

      --
      Your ad here. Ask me how!
    16. Re:We got rid of flash and applets by Anonymous Coward · · Score: 0

      false, enterprise = support WHEN something goes wrong (not if)
      and if that support fails ability to blame that someone else in front of your boss for bad support, and more importantly keep your job.

    17. Re:We got rid of flash and applets by Actually,+I+do+RTFA · · Score: 1

      Flash had at least three implementations: Flash, Gnash and a Mozilla one. I believe Google also implemented a Flash runtime for embedded Chrome.

      It's a fucking platform. Why shouldn't it get stale? You say stale; I hear "stable"

      --
      Your ad here. Ask me how!
    18. Re:We got rid of flash and applets by Anonymous Coward · · Score: 0

      In what sense was IE6 not horrible? It's not that it didn't play well with established standards, it's that it completely ignored them, and instead did things which were not implementable on other platforms. Box sizing was the least consequential change, and apparently you don't remember all the browser hacks needed to get feature parity between browser versions — include this little snippet because IE won't see it and standards compliant browsers will, then include this other bit so that IE does something remotely appropriate. And then there were all of these lovely visual effects which were just bits of DirectX exposed for the browser. Then there were the out-and-out bugs, where it simply failed to do any definition of the right thing.

      Saying IE6 wasn't horrible is essentially saying that you were not involved in web development in the '00s. It invalidates your opinion the same way that talking about the Flat Earth Hypothesis does at a physics conference. The entire web industry collectively has PTSD over it. For fuck's sakes...

    19. Re:We got rid of flash and applets by Actually,+I+do+RTFA · · Score: 1

      It's not that it didn't play well with established standards, it's that it completely ignored them, and instead did things which were not implementable on other platforms

      That's kinda what I said by "didn't play well with.."

      Saying IE6 wasn't horrible is essentially saying that you were not involved in web development in the '00s

      I remember the late 90's, when if it worked in IE6, it shipped. And if it worked in any other browser, neat, but who cares.

      That's kinda my point. If you only developed for IE, it wasn't so horrible.

      --
      Your ad here. Ask me how!
    20. Re:We got rid of flash and applets by TheCycoONE · · Score: 1

      That's somewhat revisionist. IE 3-6 when they were released were much more standards compliant than other browsers, particularly Netscape Navigator. (Layer tags, seriously?) IE was the first browser to fully comply with CSS1. The problem was that once IE6 was out they had so far outpaced their competitors (and abused their monopoly position) that there was no more competition, and since Microsoft was not a web company and had no interest in seeing the web advance, they did nothing for years. Of course years later when Firefox and eventually Chrome came out, IE was horribly outdated - and then when MS tried to make up for lost time with IE7 they failed miserably. That was a browser that was not standards compliant at release. IE8 was better, with very good CSS 2.1 compliance, but still fairly horrible DOM compliance and none of the CSS 3 stuff everyone else already had. 9, 10, 11, Edge are all better, but they still suffer from too long of a delay between releases and customers holding on to old versions for too long.

  3. Fuck plugins by Anonymous Coward · · Score: 1

    This is awesome. Bring it on.

    Last month I saw a JS x86 virtual machine running DOS and windows 98 in a chrome tab.

    That is fucking awesome. Need some special feature that no browser will support? Fuck it. Ship your own weird pseudo micro-OS and have your web application load it up on the fly.

    I remember my first time on the internet. Someone set up Next stations in the Exporatorium in San Francisco. This is when the www was just a handful of web pages.

    My first internet at home was on a 3.11 machine with dialup.

    Now I have a 64bit quad core smartphone with 128 gigs of storage sitting in my pocket. We've come a long way.

    1. Re:Fuck plugins by MightyMartian · · Score: 0

      I miss my 2400 baud modem hooked up to my Radio Shit computer with my 40x24 display. Now get off my lawn!

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    2. Re:Fuck plugins by Anonymous Coward · · Score: 0

      ..and yet flying across the Atlantic still takes 6 hours sitting in an aluminum tube while burning kerosene in turbines.

      We've come no way at all, processing information is cute, but it doesn\t move you around. And you can't eat it.

    3. Re:Fuck plugins by 110010001000 · · Score: 1

      And your 64bit quad core smartphone and modern computer have been thoroughly cracked by hackers at record speed. Progress!

    4. Re:Fuck plugins by rjstanford · · Score: 1

      It sure made the cost of flying across the Atlantic far more reasonable though.

      --
      You're special forces then? That's great! I just love your olympics!
    5. Re:Fuck plugins by Anonymous Coward · · Score: 0

      Go FUD yourself.

    6. Re:Fuck plugins by qbast · · Score: 1

      Fucking awesome! All the speed of Pentium 100 available on your newest i7. But ... in the browser! Fucking awesome I tell you.

    7. Re:Fuck plugins by Anonymous Coward · · Score: 0

      I don't. I typically get 14K with my current modem (phone line noise is horrible), regardless of the PC.
      And I don't miss loading software via cassette.
      However, I get a bit nostalgic when I happen across some of my 5.25 floppies.

  4. This just in by Anonymous Coward · · Score: 0

    Four major web browsers have announced support for bullshit.

    This technology has been brought to you by the game Angry Bitch.

  5. We got rid of flash and applets by Anonymous Coward · · Score: 0

    Now this?

  6. Hard to find a worse route... by Anonymous Coward · · Score: 0

    ...to assembly-level performance than Javascript.

    1. Re:Hard to find a worse route... by Darinbob · · Score: 1

      If Javascript programmers wrote in assembly they'd probably end up with code that's even slower than Javascript. Thus their assembly-level performance might be very very slow.

    2. Re:Hard to find a worse route... by tomxor · · Score: 1

      If Javascript programmers wrote in assembly they'd probably end up with code that's even slower than Javascript. Thus their assembly-level performance might be very very slow.

      Likewise If all C programmers wrote in assembly they'd usually end up with code that's even slower than C, i'm sure a higher portion of C programmers are less likely to write completely shit assembly but you are really missing the point... The idea is to define a type of assembly language that browsers can compile appropriately on their platform and then add appropriate annotations to JavaScript to compile into it... or just use some other high level language, not to turn JavaScript into an assembly language.

    3. Re:Hard to find a worse route... by Anonymous Coward · · Score: 4, Interesting

      You're in luck, the workflow is typically C/C++ (or some other language than JS) -> Emscripten (or other compiler that targets ASM.js / WebAssembly.

      Then the browser notices the "use asm" tag, and validates a code block as ASM.js / WebAssembly. If it conforms to the strict standards of no GC, arraybuffer memory accesses, no function pointers, etc. then the code is compiled into machine code (and cached for faster loading next time).

      So it's not Javscript programmers, but C programmers, who are running code in ASM.js / WebAssembly, via LLVM's translation.

      The cool thing is that ASM.js is just a subset of Javascript. It's pretty gnarly to program in directly because of the kludgey way it handles data types. However, this means that if the browser doesn't understand ASM.js then it just runs it as regular javascript and it still works.

      This is what has been needed to transition away from Javascript. ASM.js lets me opt-out of Javascript's slow GC and even slower prototype system (which is a pain to optimized, since objects can change their properties at any time).

      I've taken to implementing some things, like SHA256/512 hashing functions in ASM.js by hand, and get even better performance than running the C code through LLVM and into ASM.js. However, I'm a language designer and code in many other languages than just Javascript.

      Just because I know how to code in Javascript doesn't mean I can't proficiently code in C, Perl, Lua, Python, C++, Java, COBOL, Fortran, FORTH or even x86, AMD64, or ARM assembly. In fact, it takes people like me to get performance out of languages. Some say that the OS and hardware is irrelevant, users don't care about the OS or hardware, they just care about what software runs on it. An OS is just an API for talking to hardware. Well, I don't care about languages, languages are irrelevant, they're just APIs for talking to hardware. Let me at the machine code.

      Google's NaCl had a good approach: validate a subset of opcodes that were guaranteed not to be able to escape a sandbox. However, it tied itself to x86 opcodes. WebAssembly wants to do the same thing in a cross platform way. I think it's the right way all programming will go (is going, has gone) -- code compiles to cross platform bytecode and then the bytecode is translated per machine (Android does this, Perl6 uses this strategy, There's Java, C#, etc.).

      TL;DR: All javascript programmers are writing in ASM.js already, since ASM.js is a subset of Javascript.

    4. Re:Hard to find a worse route... by leptons · · Score: 1

      Javascript isn't even the worst of this... if webassembly is running inside the browser, it's going to have the DOM as a bottleneck. It's great that bytecode can be loaded and run, and C++ programmers can work on front-end code, but now they'll still have to deal with the DOM and the browser API, and CSS, which they will no doubt complain about - and so this won't go anywhere very fast... except maybe for some games, but those will likely be limited because nobody is really going to develop new games inside a web browser.

    5. Re:Hard to find a worse route... by ShadowRangerRIT · · Score: 1

      That's what the canvas tag and WebGL are for; yes, you use DOM APIs to gain access, but the APIs for using them are essentially bypassing the complexity of the full DOM; canvas is a raster image, that's all, no internal interactions with CSS or the rest of the DOM, the DOM just positions the square and you draw into it directly.

      As for "nobody is really going to develop new games inside a web browser", what do you think all the free to play stuff on Facebook is? Or every old Flash game? WebAssembly just means that you can write the same games in whatever Emscripten supported language you like, then cross-compile, instead of using Flash, hand-coding JS, etc. And that's before we get into playing abandonware games; cross-compile an emulator like DOSBox to WebAssembly, and you can serve the original game files directly, only the emulator needs to be cross-compiled. Archive.org has already done that for hundreds of games using asm.js

      --
      $_ = "wftedskaebjgdpjgidbsmnjgcdwatb"; tr/a-z/oh, turtleneck Phrase Jar!/; print
    6. Re:Hard to find a worse route... by Blaskowicz · · Score: 1

      The other day I was thinking about how it would be awesome to get some new adventure games in the vein of Full Throttle, and that much of what we do on the web seems more demanding already (e.g. youtube).
      Having such a game web-based would be great, since you don't even have to worry whether this is a game for Windows, Linux, Android, console or other. Just run it from anywhere!

      Getting people to pay for the content is what I think would be the hard part, especially if you'd want the game to be able to run off-line.
      Yet another god damn account?
      But at least, nearly every one with a computer should have a compatible browser.

      Mid-90s were so nice, every one had DOS, VGA and Sound Blaster (or things directly compatible with them), I can't help but think things were easier lol.

  7. What is webassembly? Never heard of it before... by fishscene · · Score: 2

    Is this the whole HTML 2.0 thing where it's not HTML at all, but compiled code to "run faster"? If so, I want no part in this. The Web is perfectly speedy, but it's the Ads and garbage slowing it down. Combined with the MPAA and RIAA mafia's, ALL 4 major browsers simultaneously announcing support... and my conspiracy meter goes off.

  8. lock in by Anonymous Coward · · Score: 0

    Sounds like a lovely form of DRM.

  9. my-pntbtr-add(list_eria) by Pseudonymous+Powers · · Score: 0

    Ugh. Performance hacks.

    I understand that a lot of people want to be on the cutting edge all the time, but aren't all those people already pretty firmly in the native code camp? This seems like a compromise solution that will satisfy no one. Speaking for myself, in general I prefer to just wait for the computers to get fast enough to run the inefficient-but-maintainable code over dealing with some uber-optimized smegma.

    1. Re:my-pntbtr-add(list_eria) by BarbaraHudson · · Score: 1

      Why do people want to stick everything in a web browser? It's like they want us to have only one tool (the browser), to rule them all ...

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    2. Re:my-pntbtr-add(list_eria) by Anonymous Coward · · Score: 0

      you are not expected to write asm you frickin doughnut, that's the intermediate language that your compiler will spit out from your JS source... you think everyone who writes C or C++ edits the generated asm?

    3. Re:my-pntbtr-add(list_eria) by Anonymous Coward · · Score: 0

      That explains why nobody wanted or used Flash, right? I understand wishing that the web was still a simple place for viewing documents and such, but personally I'd rather take a standard industry-vetted "hack" than all the inferior versions of this we've seen, and MUCH rather give web scripting a chance to not waste as much bandwidth or CPU/RAM just because it's taking a very inefficient way to do the same thing. I'd rather not just throw more silicon at a problem when we have efficient and time-tested ways to improve things that don't require such a step.

    4. Re:my-pntbtr-add(list_eria) by ripvlan · · Score: 0

      Javascript as maintainable? :-) Native code folks have a big lead on tooling that JS is slowing getting. But I also believe it comes down to language support. There are so many things about JS that I don't like that I can't believe people are building great stacks on top of it. Sure JS has plenty of happy features (like closures) - but I think it is growing old quickly. What people want to use it for is causing stress marks to appear.

      Lint is still weak. People are still writing unit tests just to verify that they didn't make a typo. Granted one won't know if C++ code is algorithmically correct without a unit test. In JS you do both - No Syntax Errors + Algorithmic via unit test. C++ won't compile - so the steps are separated.

      But with everything being placed in one giant "JS is the world" stack (cough - nodejs) - next comes the need for: make it run faster. Without asking: does JS need to fundamentally change? Examples: Better (native) OO support rather than overloading existing features (sorry - I still don't like "prototype"). Okay - maybe it is the verbosity of the code and lack of syntactic sugar that I miss.

      Should it "compile" or stay with JIT - what about Strength Reduction optimizations etc. If JS is going to grow up and really be a big language for big jobs - it needs to change. Or is it just the little scripting language used in the browser?

    5. Re:my-pntbtr-add(list_eria) by ranton · · Score: 1

      Why do people want to stick everything in a web browser? It's like they want us to have only one tool (the browser), to rule them all ...

      Many people would like an ecosystem similar to when all computers had Windows and Internet Explorer, where you only had to worry about writing for a single platform. Many changes to web standards are an attempt to get the benefits of a single platform to target but without a single corporation owning that platform. Time will tell how it works out.

      --
      -- All that is necessary for the triumph of evil is that good men do nothing. -- Edmund Burke
    6. Re:my-pntbtr-add(list_eria) by U2xhc2hkb3QgU3Vja3M · · Score: 2

      It's the one platform that's OS-independant, at least in theory.

      It gives me hope that all four major browsers are in this together but at the same time it's going to give me nightmares about what the advertising companies are going to do with it.

      I hope nobody messes up the sandboxing of this whole thing.

    7. Re:my-pntbtr-add(list_eria) by Darinbob · · Score: 1

      Single point of failure is easier for the casual users.

    8. Re:my-pntbtr-add(list_eria) by BarbaraHudson · · Score: 0

      The consumers aren't asking for this. They're quite happy using different environments, even ones that don't share the same software pool. Apple vs Windows is a good example of that. For everything else, there's java.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    9. Re:my-pntbtr-add(list_eria) by BarbaraHudson · · Score: 1

      Java is os-independant, and actually has fewer security flaws than web browsers. Solved problem, but people are too lazy to learn "real programming", even simplified as much as Java is. Web script monkeys are their desire.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    10. Re:my-pntbtr-add(list_eria) by BarbaraHudson · · Score: 1

      Strange how that hasn't worked out too well ... and mathematically it's the inferior approach. Not to mention that a single point of failure hoses everything.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    11. Re:my-pntbtr-add(list_eria) by windwalkr · · Score: 2

      I'd disagree, for the most part-

      * Consumers are asking for something like this. Not everywhere, and often because they know it's generally not up to them, but platform lock-in is a pain for many people. "I have to buy a PS4 for this game." "This product isn't going to support Mac." "Only on iOS." "Requires Flash."

      * Devs are definitely asking for something like this. "Can we afford to port to platform X? Can we afford not to?"

      How things are now, we're talking about a lowest-common-denominator problem, so only a small subset of problems are solved. Hopefully this will improve over time, until the majority of problems are solved and only edge-case problems require specific platforms.

    12. Re:my-pntbtr-add(list_eria) by non0score · · Score: 4, Insightful

      That's a pretty naive interpretation of Webassembly. Let's address your comments.

      1) Yes, the target audience are in the native code camp. But outside of mobile, there is no good delivery mechanism, other than the web. This is basically doing that: brining the web to native apps.
      2) There is no cross platform sandbox for running native apps, and this delivers on that. All modern browsers at least attempt at security, whereas non mobile platforms offer very little in terms of security against native apps.
      3) Computers aren't getting "fast enough" (or much faster, for that matter). Especially not for mobile, which will always be slow because of power requirements. This spec will greatly help with that.

      So it serves many purposes, and I think is a wonderful boon to the web.

    13. Re:my-pntbtr-add(list_eria) by U2xhc2hkb3QgU3Vja3M · · Score: 1

      If Java was really OS-independant, Minecraft would be able to run on all operating systems. But it's Windows-only, so there you go.

    14. Re:my-pntbtr-add(list_eria) by BarbaraHudson · · Score: 1

      Someone who has to buy a PS4 because the game won't play on a PS2 or PS3 is in the same situation. Big deal. You can't achieve the same performance from one-size-fits-all code, so gaming is going to continue to require code adapted to each platform.

      Most devs are smart enough to understand that one-size-fits-all means going with the lowest common denominator for functionality. And let's ber honest - web platforms are the sh*t. They always have been. They always will be. Just one more layer to be compromised and p0wn you.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    15. Re:my-pntbtr-add(list_eria) by dave420 · · Score: 1

      Your prejudice is worrying.

    16. Re:my-pntbtr-add(list_eria) by BarbaraHudson · · Score: 1

      I can write java code that will run on *nix and not Windows - doesn't prove that it is os-independent, just that you can get around that feature, so as you said. there you go.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    17. Re:my-pntbtr-add(list_eria) by BarbaraHudson · · Score: 1

      Not to moi :-) In case you haven't noticed, there's been a huge push to make programming a low-cost commodity. That's possible with simple scripting languages, not so much with C, etc.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
  10. A reason for concern by vivaoporto · · Score: 2

    This development can very much be a big reason of concern. Setting aside the fact that this will bring closed source software to an arena where it is mostly non-existent (the scriptable part of the web) this will also open a new vector for malicious scripts to hide.

    If it is already a vector today imagine when it is a binary that you cannot even cursorily inspect before running.

    1. Re:A reason for concern by Anonymous Coward · · Score: 0

      Practically speaking, minified javascript and asm.js already have this problem. There's no reasonable way to inspect these things; you simply must rely on the browser's js sandbox being correct and functional.

    2. Re:A reason for concern by Junta · · Score: 1

      Look at most sites that deploy javascript nowadays. The variable names are mangled beyond recognition, all whitespace and comments have been removed. It's already as difficult as debugging assembly code, but with limited upside. In theory at least, embracing a reality of bytecode rather than making an interpreted language behave like bytecode can get some gains.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    3. Re:A reason for concern by Anonymous Coward · · Score: 0

      The spec includes a human-readable representation of the code as well, much like assembly language for other platforms. That's really no worse than all the minified JS code we already have to contend with. People who still want to make their code readable will provide something like source maps to make it even easier; those that don't want to already have obfuscation techniques that make it impractical to know what their scripts are doing anyway.

    4. Re:A reason for concern by erapert · · Score: 2

      If you're using nodejs then try uglify-js. On Ubuntu, assuming you already have nodejs installed, you can install uglify with:

      > sudo npm install -g uglify-js

      And then get the options:

      > uglifyjs -h

      So if I have a source file foo.js which looks like this:

      > function foo(bar,baz){console.log("something something");return true;}

      I can beautify it like so:

      > uglifyjs foo.js --beautify --output cutefoo.js

      uglify uses spaces for indentation by default so if I want to convert the 4-space-indentation to tabs I can run it through unexpand which Ubuntu 12.04 comes with:

      > unexpand --tabs=4 cutefoo.js > cuterfoo.js

      so after all this I wind up with a file that looks like so:

      function foo(bar, baz) {
      console.log("something something");
      return true;
      }


      (when will /. support markdown for comments?)

    5. Re:A reason for concern by Anonymous Coward · · Score: 0

      You are much too late. When browsers introduced WebGL they could already run Ports of the Unreal engine at passable speed by compiling the native code to a basic subset of JavaScript littered with "type annotations". For example var a = 1.0; var b = a | 0; would make b an integer and an optimizing runtime could use that to great effect - avoiding the slower floating point computation and additional interger / float conversion when possible. The code produced by the used compilers while legal JavaScript is about as readable as your standard exe file and web assembly wont make that worse.

    6. Re:A reason for concern by xxxJonBoyxxx · · Score: 1

      Please tell me you know about sites like: http://jsbeautifier.org/

    7. Re:A reason for concern by Anonymous Coward · · Score: 0

      I sure do love a beautified blob of single-character variables

    8. Re:A reason for concern by non0score · · Score: 1

      Webassembly runs inside the browser's sandbox, which is at least as good as running it natively on your OS in terms of security. That and NaCl/asm.js has been around already, so I'm not sure how this will be an issue.

    9. Re:A reason for concern by Anonymous Coward · · Score: 0

      There is nothing beautiful about K&R style. It is an abomination.
      -- Leviticus 45:16 (KJV)

  11. Welcome the Ads by eedwardsjr · · Score: 1

    Pretty darn sure they will work out a way slip in anti-ad blocking functionality.

    1. Re:Welcome the Ads by Anonymous Coward · · Score: 0

      They certainly didn't need wasm to do that. And wasm will make it possible to write more efficient adblockers, too, so it seems like a pretty neutral bit of tech to me overall, wrt ads.

    2. Re:Welcome the Ads by Anonymous Coward · · Score: 0

      This.

  12. Assembly is for LUDDITES. by Anonymous Coward · · Score: 0

    Modern app appers ONLY use AppScript because it's the appiest apping app, NOT LUDDITE languages like assembly!

    Apps!

  13. par for the course by Anonymous Coward · · Score: 0

    It's like expecting sensible language design out of PHP core devs: You're looking at the wrong people for the job.

    The natural language butchery is just a bonus.

    1. Re:par for the course by Darinbob · · Score: 1

      You're anonymous, how am I supposed to mod this up?

  14. adorable by Anonymous Coward · · Score: 0

    like javascript weenies even know what op codes are.

  15. Re:What is webassembly? Never heard of it before.. by zlives · · Score: 5, Funny

    don't worry, it will never be used for DRM or adware

  16. Re:What is webassembly? Never heard of it before.. by Anonymous Coward · · Score: 1

    ^^^ funniest joke all day! ^^^

  17. Re:What is webassembly? Never heard of it before.. by peragrin · · Score: 2

    This is Web 3.0. The search for more money.

    With ads running at assembly speeds they can play a dozen videos ads per page at the same time.

    --
    i thought once I was found, but it was only a dream.
  18. Yo dawg by roman_mir · · Score: 1

    I guess Mozilla just can't sit still until they have an OS behind their name that creates the buzz unlike FF OS and more like Android. But seriously, blocking a JVM plugin (instead of maybe working to fix it by submitting fixes to Oracle if that was necessary) but creating a completely new VM to run bytecode inside browser directly... I guess so that eventually they'll just supply the VM and the browser itself will be written as an add on to it in WebAssembly, so that eventually somebody could port the original FF on top of that.

    In any case, I thought and posted about it a year ago that things will go full circle. The mobile apps will eventually run directly in the browser (which incidentally will allow a mobile browser app to run inside a browser on your desktop, because why not).

    1. Re:Yo dawg by Anonymous Coward · · Score: 0

      The reason things usually go full circle is because the earlier versions aren't quite cutting it. Sometimes lessons must be learned and a better version deliberated later. We're now at a point past Java, Flash, NPAPI, NaCl, PPAPI, and asm.js, and it seems like the time is right to finally get this done. This way a new VM won't have to be added to the browser, but their existing Javascript VMs can be expanded to support other languages via WebAssembly. This way all the experience put into those VMs on sandboxing web content won't go to waste. This way it won't just be one or a few languages that are supported, but an open-ended list of both static and dynamic languages, and ones that do and do not require garbage collection.

      It's not necessary to make this into some grand "all encompassing" tech for every use-case, but it's a clear improvement over what's in web browsers now, and is a much more open, feasible, and collaborative effort than what browser vendors have done before. That's a good thing. It doesn't have to take over native apps, it can simply make browser apps better to the point where people can pick and choose between superior choices to what we had before.

    2. Re:Yo dawg by roman_mir · · Score: 1

      it's a clear improvement over what's in web browsers now

      - I doubt it.

    3. Re:Yo dawg by Anonymous Coward · · Score: 0

      There is no better indicator that a user is mentally retarded than posting XKCD spam while believing it is somehow insightful or informative.

    4. Re:Yo dawg by Anonymous Coward · · Score: 1

      completely new VM to run bytecode inside browser

      It isn't a new VM. WebAssembly targets the existing JavaScript VM that's already there in your browser. You should do some reading on WebAssembly.

    5. Re:Yo dawg by Anonymous Coward · · Score: 0

      Another key sign of idiocy is having the username roman_mir

  19. Re:What is webassembly? Never heard of it before.. by firewrought · · Score: 5, Insightful

    It's a replacement of two previous ideas... Mozilla's asm.js ("let's specify a subset of JavaScript that can run faster") and Google's NaCL ("let's ship x86 code directly to the browser"). As best I can tell, the replacement resembles putting a Java/.NET-style virtual machine into the browser to execute a new form of bytecode (.wasm files).

    This is good for speed, which is in turn good for developers who want to deliver complex ("Photoshop-like") apps from the cloud.

    It's bad for security (expanded attack surface), and it's bad for privacy (more ways to fingerprint the browser).

    It's a wash for transparency: today's minified JavaScript is pretty much unreadable anyways.

    Probably my biggest concern off the bat is wondering how the ecosystem for web API's is going to work when everyone's developing in their own favorite programming language. Traditionally, JavaScript has been a uniting force in this regard.

    --
    -1, Too Many Layers Of Abstraction
  20. Re:What is webassembly? Never heard of it before.. by Anonymous Coward · · Score: 0

    Aren't the vast majority of web APIs text based anyway? Why would webassembly change anything about that?

  21. Re:What is webassembly? Never heard of it before.. by Anonymous Coward · · Score: 0

    Simply put, it's a new attack surface.
    Goodbye.

  22. Webassembly for the Masses by Anonymous Coward · · Score: 0

    Subject Matter Experts (TM) agree that WebAssembly (TM) makes your browser Webscale (TM) and able to parse Big Data (TM) stored in the Cloud (TM) or in your personal IoT (TM). While traditional web applets are slow, WebAssembly (TM) is Fully Robust (TM) and Scalable (TM) capable of delivering Real-time Data (TM). WebAssembly (TM) will bring Artificial Intelligence (TM) to ever desktop and Smart Phone (TM).

    Hi, I am Robert Tappan Morris and I approve this message.

  23. One more step to "Birth & Death of Javascript" by UnknownSoldier · · Score: 1
  24. Re:What is webassembly? Never heard of it before.. by Darinbob · · Score: 2

    Don't forget that Javascript is slowing it all down too. Content loads fast, but the web-as-an-application-framework is what's wrong with the web. This is essentially Java applets reinvented but with the wrong lessons learned.

  25. Re:What is webassembly? Never heard of it before.. by paulpach · · Score: 5, Interesting

    Aren't the vast majority of web APIs text based anyway? Why would webassembly change anything about that?

    I am a game developer and I am really excited about webassembly.
    There are many challenges a game developer faces today:

    1) Javascript has awful performance. Some game related code such as procedural content generation is very cpu intensive, and it would just take too long in javascript. Webassembly is meant to _always_ be compiled to native code and it is statically typed which allows the compiler to optimize the code much better. It will perform many times faster than javascript.

    2) Javascript does not support threads. This is one stated future goal for webassembly. This is useful when you want some work to happen in the background (again, procedural content generation).

    3) Plugins suck. If I deploy my game, say with the unity plugin, I am asking my customers to download a huge ass plugin in order to run my game. Some won't because they don't trust the plugin, some wont because the download takes to long, some wont because they don't have the required permissions, some won't because it does not work in their platform. Whatever the reason, I am losing a lot of potential users by using a plugin even if I get better performance. Webassembly will not require plugins.

    4) Download time. If I compile a game to asm.js, just the game engine runtime require several megabytes downloads. Webassembly does reduce the size of the download significantly. This is one of the stated goals. This is one of the reasons webassembly is binary instead of text based. The smaller the download, the faster the player can start playing and the less users I lose.

    5) Startup time. If it takes 30 seconds to parse all the asm.js or javascript before the game actually starts, that is an eternity, and many people will actually close their browser before the game starts. Webassembly is binary because parsing it will take orders of magnitude less time than parsing the equivalent asm.js.

    6) Browser compatibility. Today, only 2 browsers are serious about asm.js: Edge and Firefox. webassembly is being developed by all major browsers. It is also quite likely it will be implemented in mobile or even outside browsers altogether.

    So yes. I am excited about it. It will make may games more accessible to my users.

  26. Re:What is webassembly? Never heard of it before.. by wonkey_monkey · · Score: 4, Funny

    a huge ass plugin

    [hyphenation needed]

    --
    systemd is Roko's Basilisk.
  27. Non machines need not apply. by Anonymous Coward · · Score: 0

    Let's dispell the myth that Skullcode.com doesn't know what it is doing.
    Skullcode.com knows exactly what it is doing.

    It me that's having a time of trying to figure out what that is.

    IMHO, there's something fishy going down at 6666h.

  28. WebAssembly isn't that impressive (yet) by Elledan · · Score: 2

    Last December I took an extensive look at ASM.js and WebAssembly, from the point of view of an old-school C/C++ developer, and wrote an article about it: A look at asm.js and the future with WebAssembly.

    The short of it is that while interesting, the JavaScript runtime both asm.js and WebAssembly run in impose such major limitations on the applications being written that its actual uses outside of game ports is fairly limited.

    --
    Site & blog: http://www.mayaposch.com
    1. Re:WebAssembly isn't that impressive (yet) by Anonymous Coward · · Score: 0

      I don't actually see much evidence in that article that wasm is all that limited. They just seem to have taken a very early peek, and reached a bitter premature conclusion. Now if they had suggested alternatives which seemed more exciting, then maybe I could buy that wasm isn't all that impressive. But the fact that it has already trumped NaCl in terms of browser vendor interest implies that we'll actually GET something compared to asm.js and NaCl. That's very exciting to me, and undeserving of premature conclusions.

    2. Re:WebAssembly isn't that impressive (yet) by Anonymous Coward · · Score: 0

      If you're alluding to things like the same-origin policy, most of these kinds of restrictions can be worked around by using websockets, which is much less restricted -- although it shifts some of the security burden to the developers of both the front-end and the back-end.

  29. Re:What is webassembly? Never heard of it before.. by Anonymous Coward · · Score: 0

    If done right it's a pretty cool idea. How cool would it be to be able to compile language whatever you like (I dunno... C++? Java? Fortran?) on platform whichever one you have access (windows? linux? shouldn't matter) to run on a standardised browser? Infinitely nicer than the current hideous mess that is javascript and co.

    I guess the test will be (a) how standard it really is (universality), (b) how well sandboxed it is (security) and (c) how fast it is (usefulness).

  30. Re:What is webassembly? Never heard of it before.. by Kiwikwi · · Score: 1

    The important thing to realize is that this isn't a new VM, nor a new set of APIs. Just like asm.js, it's still JavaScript, executed inside the same JavaScript VM as the browser already uses. WebAssembly is about delivering that JavaScript in an optimized format: binary instead of text (for smaller downloads and improved parse speed), and enforcing a JavaScript profile that enables improved JIT'ing (like asm.js).

    As such, the attack surface is the same. There is no new way to fingerprint the browser either (well, besides 1 bit of "Does this browser support WebAssembly, yes/no?").

    WebAssembly will benefit all complex JS applications, and is a must for the very complex ones. Currently, one of the big problems with running Unity games in the Chrome browser is the memory and CPU requirements of parsing the game JavaScript code. Not running the game code, but just parsing/compiling it, which will often cause the Chrome tab to crash for larger games. WebAssembly solves this problem (among others).

  31. Web Assembly? by PPH · · Score: 1

    I thought it was just a joke

    --
    Have gnu, will travel.
  32. Re:What is webassembly? Never heard of it before.. by Anonymous Coward · · Score: 0

    >> 1) Javascript has awful performance ... perform many times faster than javascript.

    Not true at all. SIMD does a provides performance advantage, but that is hardware optimzation.

    >> 2) Javascript does not support threads.

    Not a big deal for most applications.

    >> 3) So yes. I am excited about it. It will make may games more accessible to my users.

    I'm excited too, but not because of performance issues.

    Internet browser based games have a bright future,

    but I disagree with you about javascript, it will be the biggest part of making that happen.

  33. Re:What is webassembly? Never heard of it before.. by drinkypoo · · Score: 0

    a huge ass plugin

    [hyphenation needed]

    If it's Unity, it's a huge-ass plugin.

    If it's Flash, it's a huge ass-plugin.

    If it's Java, it's a huge, ass plugin.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  34. Re:What is webassembly? Never heard of it before.. by chebeba · · Score: 0

    To balance your points 1) and 6) somewhat I present the following little anecdote:

    I was development lead on a rather complex app used to model and monitor large streaming media networks.
    We were using D3.js to render large graphs of the system on the browser, and we had performance issues.

    When one of the engineers suggested switching from D3.js to GraphViz (A C++ graph library) using asm.js I was like "You can't be serious!"

    It turned out that GraphViz compiled to asm.js outperformed the D3.js implementation by a factor of about 2-3x. And it ran perfectly on Chrome as well.
    The only thing we lost was the swishy-swoshy (and completely unimportant) animations when the graph changed.

  35. Re:What is webassembly? Never heard of it before.. by Anonymous Coward · · Score: 0

    The only thing we lost was the swishy-swoshy (and completely unimportant) animations when the graph changed.

    In the business world where impressing clients is #1, that alone would kill your superior solution unless it could be monetised to improve the balance sheet.

  36. Re:What is webassembly? Never heard of it before.. by Blaskowicz · · Score: 1

    I'd think javascript is fast enough for quite many a thing, but I only have to launch some simple Space Invaders clone or similar and here is it, it stutters every couple seconds. So e.g. a javascript mp3 decoder works fine, but something that looks like a primitive Windows 3.1 action game fails, although perhaps the game wasn't properly written.

    2) Javascript does not support threads. This is one stated future goal for webassembly. This is useful when you want some work to happen in the background (again, procedural content generation).

    Great, with that or other performance improvements maybe a smooth Space Invaders clone will be possible (ignoring WebGL there, as you need recent enough graphics hardware and assorted driver for it to run).
    I'm concerned about 100% or nearly 100% CPU use on all cores : many PC will overheat and shut down (even mine needs the CPU's thermal paste changed again, which is all there is to it really). The browser may need a setting, not buried down in about:config, for the max amount of hardware threads it's allowed to use or some way for it to not use over e.g. 75% of the whole CPU.
    Perhaps it shouldn't be your own concern if you're developing serious browser games, but if this ends up happening all over the regular web I can see it creeping up as a common issue.

  37. It's the only sane thing to do by Anonymous Coward · · Score: 0

    That's my view. We have the JVM for all Java languages, albeit controlled by Oracle now - Java, Scala, Clojure, Groovy..
    We have .NET for C#, F#, ClojureCLR etc.
    We have LLVM which is the stated original VM target for Web Assembly.

    What do we have for the web???
    F***ing Javascript. Of al the things, after decades of language devlopment and such a rich repository of languages, the one and only all-prevasive web language is Javascript. LLVM, and .NET have already started a target back end to Web Assembly.

    With these new backends, people won't be limited to the transpiling cul de sac that is Typescript.
    We wil have a genuine new platform - a true web platform. Adn people can still use Javascript. It's not going anywhere. It wil just be joined by many other languages.
    Javascript may remain the web language of chouce for many of us but not all, certainly not me.
    I read somewhere that there are 2 types of langes - ones people complain about ad ones nobody uses.
    Languages like Scala, Clojure, F# etc. are used and people do complain about them too. It's not just about JS. We need alternatives and let's face it, the we is used for practially everythig these days. There are instances when you would want something like C# for the web, and others when you want somethig like Javascript or Groovy.

    This will hapen eventually. And when it does we can be on the right or wrong side of history. Transpiling to javascript just isn't enough. Typescript will eventualy target Web assembly too.

  38. Re:What is webassembly? Never heard of it before.. by paulpach · · Score: 1

    >> 1) Javascript has awful performance ... perform many times faster than javascript.

    Not true at all. SIMD does a provides performance advantage, but that is hardware optimzation.

    It is more than that. Consider the following code fragment in javascript:

    function sum(values) {
            var result = 0;
            for (let i=0; i < values.length; i++) {
                      result = result+values[i];
            }
            return result;
    }

    should be a straight forward function right? should perform the same in c++ right?, well, not so fast. I could pass an array of integers, an array of floats, an array of strings, or an array of any combination of them and the function would still be valid. So at runtime, the code would have to check the type of each individual entry in the array to figure out what the + operator really means, and in each pass, the + operator might be a completely different function. In other words, the best compiler ever would have to come up with assembly that follows this pattern:


    function sum(values) {
            let result = 0;
            for (let i = 0; i < values.length; i++) {
                      tmp = values[i];
                      if (tmp instanceof int) {
                                result = addint(result, tmp);
                      } else if (tmp instanceof float) {
                                result = addfloat(result, tmp);
                      } else if (tmp instanceof string) {
                                result = concat(result, tmp);
                      } ...
                      else {
                                throw exception;
                      }
            }
            return result;
    }

    Actually that is an oversimplification, since the variable "result" would also be have to checked for type. It might have been turned into a string in the previous pass for example. You can see that is a lot of code that is generated to check the types if all I want is to sum up some numbers.

    Now consider a similar code in C or java or any other statically typed language:


    function sum(int values[], int length) {
            int result = 0;
            for (int i=0; i < length; i++) {
                      result = result+values[i];
            }
            return result;
    }

    The compiler knows that every single entry in values is an int, and no matter what "result" will remain an int. Therefore there is no need to check what type it is. The + operator can be simply replaced by an integer add instruction in assembly. And yes, a smart compiler could even use SIMD to optimize this code, but even without SIMD, any half brain compiler will do better than the best javascript compiler.

    Now you can actually see some numbers. V8 is an amazing javascript engine, and all cases except one its an order of magnitude slower than equivalent code in C++.

  39. Re:What is webassembly? Never heard of it before.. by Anonymous Coward · · Score: 0

    a huge ass plugin

    [hyphenation needed]

    A huge ass-plugin

    There, fixed it.

    You know the problems I've been having with plugins...