Slashdot Mirror


Will WebAssembly Replace JavaScript? (medium.com)

On Tuesday Firefox 52 became the first browser to support WebAssembly, a new standard "to enable near-native performance for web applications" without a plug-in by pre-compiling code into low-level, machine-ready instructions. Mozilla engineer Lin Clark sees this as an inflection point where the speed of browser-based applications increases dramatically. An anonymous reader quotes David Bryant, the head of platform engineering at Mozilla. This new standard will enable amazing video games and high-performance web apps for things like computer-aided design, video and image editing, and scientific visualization... Over time, many existing productivity apps (e.g. email, social networks, word processing) and JavaScript frameworks will likely use WebAssembly to significantly reduce load times while simultaneously improving performance while running... developers can integrate WebAssembly libraries for CPU-intensive calculations (e.g. compression, face detection, physics) into existing web apps that use JavaScript for less intensive work... In some ways, WebAssembly changes what it means to be a web developer, as well as the fundamental abilities of the web.
Mozilla celebrated with a demo video of the high-resolution graphics of Zen Garden, and while right now WebAssembly supports compilation from C and C++ (plus some preliminary support for Rust), "We expect that, as WebAssembly continues to evolve, you'll also be able to use it with programming languages often used for mobile apps, like Java, Swift, and C#."

49 of 235 comments (clear)

  1. No by Anonymous Coward · · Score: 5, Informative

    From the web assembly web page:

    Is WebAssembly trying to replace JavaScript?

    No! WebAssembly is designed to be a complement to, not replacement of, JavaScript. While WebAssembly will, over time, allow many languages to be compiled to the Web, JavaScript has an incredible amount of momentum and will remain the single, privileged (as described above) dynamic language of the Web....

    1. Re:No by Xtifr · · Score: 5, Informative

      It's being developed by Microsoft, Google, Apple, and Mozilla, and has been demoed in beta versions of Chrome and MS-Edge already. Mozilla is merely the first out the door with an official release.

    2. Re:No by JDG1980 · · Score: 3, Interesting

      No! WebAssembly is designed to be a complement to, not replacement of, JavaScript. While WebAssembly will, over time, allow many languages to be compiled to the Web, JavaScript has an incredible amount of momentum and will remain the single, privileged (as described above) dynamic language of the Web....

      That's disappointing. JavaScript is an absolutely terrible language, and it's insane that it has been the only choice for client-side Web scripting/programming up until now. Hopefully this is just diplomatic BS. Once WebAssembly is updated to support access to the DOM (the current version can't do that), then there is no good reason for anyone to use JavaScript for anything ever again.

    3. Re:No by tgv · · Score: 2

      Imagine the people who write buggy Javascript writing C++. A recipe for disaster.

    4. Re:No by Anonymous Coward · · Score: 2, Interesting

      Javascript has gotten a lot better in recent years, but it's still pretty bad.

      However, it has lead to a massive explosion in free and open frameworks. You get the source when you use them by nature. It's pretty impressive.

      WebAssembly will put a stop to that.

    5. Re:No by michael_wojcik · · Score: 2

      Once WebAssembly is updated to support access to the DOM (the current version can't do that), then there is no good reason for anyone to use JavaScript for anything ever again.

      Sure, sure. Why have crap web pages serve crap scripts written in one crap language, when they can serve crap binaries written in any of several crap languages?

      "Binaries" in the sense that WebAssembly serves scripts in compiled form. So in addition to letting incompetents demonstrate their failures by attempting to create "web applications" in, say, C++, WebAssembly prevents us from easily viewing those scripts and working around them with, say, Greasemonkey. Or determining that we don't need them, and can safely block them with NoScript. And so forth.

      Sure, you can minimize and otherwise obfuscate Javascript. And there's asm.js, which was basically WebAssembly version 0. But certainly on the sites I use, most Javascript is either unobfuscated or just the minimized version of a third-party library that exists in unminimized form, so it's easy to reconstruct what it's doing.

      There's rarely a compelling reason for Javascript now. But I see even less of one for WebAssembly, personally. I don't want games and scientific visualization and all sorts of other rubbish running in my browser, thanks anyway. I want to use it to read stuff, and once in a while to rant.

  2. First Webassembly malware post! by slazzy · · Score: 3, Funny

    Yeah!

    --
    Website Just Down For Me? Find out
  3. The cloud by Anonymous Coward · · Score: 5, Insightful

    This new standard will enable amazing video games and high-performance web apps for things like computer-aided design, video and image editing, and scientific visualization...

    But I don't *WANT* to do that shit in a web browser. I want it to live on my local computer where companies can't charge me $5, $10, or $250 per month or I lose access to all my critical data.

    I'm still astonished that one of my clients is running a Linux mail server and it works perfectly for them. Their total cost over the ~8 years they've been running it has been about $1,000/year, and most of that is paying for us to add new users, create mailing list/groups, and remove fired employees.

    Their first year on the Exchange 358 cloud bullshit would have cost them approximately $15k in licensing.

    1. Re:The cloud by Anonymous Coward · · Score: 3, Funny

      It's cute that you're your small town IT guy, but real businesses where people deal every hour with more money than you make a year require professional software, and that's where the quality of advanced offerings from Microsoft shine.

    2. Re:The cloud by Anonymous Coward · · Score: 2, Funny

      You had me up until "Microsoft."

    3. Re:The cloud by jellomizer · · Score: 2

      How would this technology stop that.
      We had Time computing where we paid for access to the mainframe.
      Then we had SaaS where we hosted the app remotely.
      Now we have cloud where the services are more distributed.

      Nothing is stopping you from installing your own web server and use these apps on your intranet. But most people don't like paying thousands of dollars for software anymore.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    4. Re:The cloud by Pinky's+Brain · · Score: 5, Insightful

      Since small businesses make up most of the economy I hope we don't run out of small town IT guys.

      The professionals seem comparatively completely fucking useless.

    5. Re:The cloud by aaarrrgggh · · Score: 2

      And what is their lost time in dealing with spam, inability to properly and effectively share calendars, etc.?

      Email is one thing where hosting makes sense. We had gmail for our company free for over a decade, and recently went "premium" to add a few features. Smartest business decision we made.

      On the other hand, Asterisk locally was arguably our second best IT decision. 10-year cost under $15k, compared to $65k for a comparable hosted solution.

      You have to understand when hosted solutions make sense, and when rolling your own in-house is cheaper and more sustainable.

    6. Re:The cloud by lucm · · Score: 3, Interesting

      Their first year on the Exchange 358 cloud bullshit would have cost them approximately $15k in licensing.

      For a service similar to a Linux mail server, that means they have 250 users (Office365 = $5/mailbox). I don't know how fast you can drive to their office but if their Linux mail server crashes or gets stolen, that's 250 people with no email for as long as it takes for you to fix the problem.

      On the other end, if the office loses internet connection (which would also make a Linux server useless), those users can still access their Office365 email from their phone or home internet connection.

      Email is a commodity and it's a no-brainer to outsource it to a provider that benefits from economy of scale and state-of-the-art data centers staffed 24x7.

      --
      lucm, indeed.
    7. Re:The cloud by AchilleTalon · · Score: 4, Insightful

      Even if I share your comments, the original point about Web Assembly has nothing to do with what the poster complained about. I mean, Web Assembly doesn't introduce that problem, it is already there for decades. So, I welcome Web Assembly for what it is, a mean to increase the performance of applications in the browser. Now, should we or shouldn't we have complex applications in the browser and which ones is another matter.

      However, the browser is a convenient way to distribute applications inside an enterprise. In that case, you don't have thousands of unknown parties trying to hack your browser and making it crawling instead of running.

      I would probably prefer enterprise applications based on Web Assembly than on Flash or even mostly Javascript.

      --
      Achille Talon
      Hop!
    8. Re:The cloud by rtb61 · · Score: 2

      It seems the 'professional' plugging M$ cloud are just really, really lazy and greedy. Take the credit and the pay and blame M$ when it all blows up, which it inevitably will. The bigger your company the sillier you are to trust the cloud because it will fail, it absolutely guaranteed will fail and catastrophically so. Never ever forget, they will take short cuts to inflate profits, they will pry into what they store because it is literally worth billions in insider information, the cloud serves you web interests and they more about you web business than they do and they are your competitors and that is really stupid.

      Big enough and I would stop trusting ISPs and roll my own, it just makes not sense to trust outsiders in the digital age with anything. Once you are big enough, you grow your IT infrastructure sufficiently to contract out elements to others. The worst thing you can ever do in business is feed your competitors, you should be doing the exact opposite starving them out of existence.

      --
      Chaos - everything, everywhere, everywhen
  4. Re:Hard to argue against Betteridge here by luismontbau · · Score: 5, Informative

    Well, Google Chrome 57 also incorporates WebAssembly, and soon, so will Safari and Edge. If you're interested in the future of the web, I suggest you read all the articles, they are quite interesting. I think it's the only chance the open web has against walled app gardens.

  5. Re:Hard to argue against Betteridge here by Espectr0 · · Score: 2

    I take it that you don't know that WebAssembly is made by a joint team of all major browsers?

  6. Miss out on apps not ported to your OS by tepples · · Score: 2

    But I don't *WANT* to do that shit in a web browser. I want it to live on my local computer

    What's better: using a JavaScript or WebAssembly app in a web browser, or not being able to use an app at all because it's native but doesn't happen to have been ported to your device's operating system?

    1. Re:Miss out on apps not ported to your OS by epyT-R · · Score: 4, Interesting

      What's better: using a JavaScript or WebAssembly app in a web browser and having it fuck up your workflow when it magically changes/disappears one day, or having to run a specific OS to run a native, local application that's there forever until you choose to abandon it?

    2. Re:Miss out on apps not ported to your OS by Is+Don+the+new+Ron · · Score: 2

      But I don't *WANT* to do that shit in a web browser. I want it to live on my local computer

      What's better: using a JavaScript or WebAssembly app in a web browser, or not being able to use an app at all because it's native but doesn't happen to have been ported to your device's operating system?

      This has a huge downside too. A web app lives and dies on the whim of the developer, which can go bankrupt or be DDoS'd out of existence overnight, while a program installed on your desktop can last as long as the hardware can be upgraded or replaced, which in the case of the most common desktop architecture can span well over a generation.

      Now I realize that practically all apps and programs are in part locally installed, if not permanently then in some disk cache. But the incentive for a developer to package an app so that it can run only after it phones home is much, much greater. After all, how many people run an web browser offline?

      So, yes, this is going to be a game changer. If this takes off, expect future versions of your favorite proprietary office suite or graphics editing program to behave more like YouTube videos than traditional desktop software. Remember that there's practically no difference between downloading and streaming a YouTube or Netfilx video but these companies still put up technical barriers to prevent users from viewing videos offline.

      --
      Deja vu: In the 80s we had a 70ish actor as POTUS, a woman PM in the UK, and a bald leader of that other nuke superpower
  7. Re:Maybe in the long term by Richard_at_work · · Score: 5, Interesting

    Meh, not so much - its the *default* language for clientside web interaction right now, and thats the *only* reason it has the establishment that it has.

    The only thing that would have to happen for Javascripts domination to be threatened is for multiple browsers supporting something better, and thats happening with WebAssembly. Once developers realise they can stick to their language of choice and cross compile to WebAssembly, thats pretty much game over for JS - think of all the reasons touted for using Node.js, just this time think about them being used against JS...

    I wouldnt be at all surprised to see a significant shift start to happen in the next 18 months.

  8. No by thegarbz · · Score: 2, Insightful

    But a longer answer is: 99.999% of the Javascript out there is not slow but waiting on some server to send back content.

    Yeah if you're crazy enough create a image editor or a game that runs only in a webbrowser then maybe you would consider this. But no it won't replace Javascript.

  9. Chrome too by campuscodi · · Score: 5, Informative

    Google also officially added support for WebAssembly in Chrome 57, released 3 days ago, btw

    1. Re:Chrome too by ledow · · Score: 2

      Yeah, but that EpicZenGarden demo doesn't work in Chrome.

      I get an error after about 2 minutes of downloading hundreds of megs: Uncaught TypeError: Cannot read property 'getParameter' of undefined

      Doesn't matter how good your demo is if it doesn't work on other software. The old "web browsers don't support standards the same way" problem strikes again.

  10. JS "programmers" are too incompetent for that by gweihir · · Score: 4, Informative

    WebAssembly will primarily allow real coders to write applications that run in browsers. No JavaScript wannabees need to apply.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    1. Re:JS "programmers" are too incompetent for that by Anonymous Coward · · Score: 5, Insightful

      SO much this.

      The reason JS gets so much hate is not because the language itself, it's the horrific fucking developers that (ab)use it.
      Most of them abstract the damn language away under shit like jQuery that adds a metric fuckton of overhead to the language.

      It's not even amateur small-time devs either, it's huge ones too.
      So-called Enterprise-quality code, full of high-overhead code for very little functionality, said overhead only there to prevent IDIOTS from making mistakes.
      Google even do it. Youtube, Gmail, Maps, all slow as fuck now. Try run ANY of those on a machine from even 5 years ago, never mind 10. They are even slow on modern hardware for NO FUNCTIONAL REASON, just lazy developers writing high-overhead code for obfuscation / low-transmission cost reasons. (yet it would be far easier to compress your code and decompress it on client end, then run THAT, insanely faster too)
      The HTML5 video system is so slow it is funny, especially since most major browser vendors are pushing for its replacement as primary content source for video over Flash. The piece of shit spec has barely any support for hardware emulation on old or NEW hardware. The levels of inconsistency in HTML5 video is nuts. I've seen old machines handle it fine, yet something from past 2 years choke on it. It is a horrible, horrible spec not even remotely close to being complete.
      As much as I hate W3C for their monolithic nonsense of yesterdecade, they were 100% correct when they said HTML5 wouldn't be complete until 2020~. 100% correct indeed. The amount of syntactic sugar in that spec to cater to retards that refuse to learn the language is only going to make things even slower.

      It happens in loads of other languages as well.
      PHP another common one. The PHP community is horribly stupid as a collective. (including ITS own developers!)
      Python is another. Python suffers even more so because it is ridiculously high-overhead NATIVELY, it is horrendously slow. I have no idea why people can stand it. Even for prototyping it is bad. (more so because the syntax is horribly different from most languages)

      Idiots are ruining the programming community.
      They've made the entire industry horrible to live in.
      If you know anyone considering programming, tell them fucking no and get in to computer science instead. Or mechatronics or something else interesting. That one in particular will be a very good one since robotics is a hugely growing industry.
      Programming is a dying area. It's saturated with IDIOTS that are too lazy to learn languages, so ask "smarter" people on Stackoverflow or similar sites.
      There's literally summer courses in programming that teach people to ASK questions on stackoverflow! (fucking India)

    2. Re: JS "programmers" are too incompetent for that by denis.goddard · · Score: 2

      Parent is the best post I've seen on Slashdot in a long time. Kudos. Word. Also, Perl6 is the language the Web *should* have used

  11. Re:Native code running in the Browser? by NoNonAlphaCharsHere · · Score: 5, Funny

    Yaaaaayyyyyyyyy!!!!!!
    I, for one, cannot wait to load webpages with near-native busy-wait code written by some amateur to do really really useful shit, like check every 7 seconds if there's been an update to their homepage (a la Huffington Post).

  12. Re: Native code running in the Browser? by Zero__Kelvin · · Score: 3, Informative

    This has nothing to do with Active X, and furthermore your implication that if Microsoft tried and failed at something then nobody else need try is absurd.

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  13. Re:Native code running in the Browser? by Anonymous Coward · · Score: 2, Informative

    No, Native Speed. Not native code. It can't do things javascript doesn't do, it does things javascript can do, but much faster.

  14. Well, could Java replace javascript? by EtaCarinae · · Score: 2

    So what's the principle difference between this and Java byte code?

    1. Re:Well, could Java replace javascript? by ledow · · Score: 2

      This doesn't run as an NSAPI plugin.

  15. Re:Real-time bidding by religionofpeas · · Score: 2, Insightful

    So with WebAssembly, they can spend even more CPU power on collecting bids.

  16. Re:WebAssembly engines as VMs for scripting by Wootery · · Score: 2

    Do something similar with generation of LLVM bytecode, and you can remove the need for actual binaries for most purposes

    Not really, no. Not with C.

    C has platform-specific behaviour of primitive types, and uses macros for platform-specific conditional-compilation. Not something that translates well to bytecode, and certainly not to LLVM bitcode.

    and also tweak OS designs so that many security properties can be enforced at the language level more easily

    Not really. If you want something like array bounds-checking for C, or runtime checking for signed integer overflow, GCC can take a pretty good stab at that already. Just use the right flags.

  17. Looks good to me by steveha · · Score: 5, Informative

    I read through the fine articles and even watched a couple of the videos. Overall this looks like a good idea to me.

    The basic idea: WebAssembly is an assembly language for a virtual machine, which is very easy to translate into native code. It was designed to be compact so it will download quickly; in particular they chose a stack-based virtual architecture so that an "ADD" instruction implicitly adds the top two numbers on the stack, so "ADD" and similar operations are always single bytecodes. Also, while JavaScript only has a single "number" type which is implicitly float, WebAssembly has multiple built-in native types including 64-bit integer.

    It should be no less secure, and no more secure, than JavaScript. However almost all the overhead of an interpreted language is gone: instead of just-in-time compilation, detecting "hot spots" and optimizing, and de-optimizing when assumptions are invalidated, all the browser has to do is translate the virtual machine code into native code and run it.

    For the initial release (i.e. right now) WebAssembly does not support garbage collection. This is a sensible decision given what it is and what it does, but they said they will look at giving it some GC abilities in future releases.

    I like the original idea that JavaScript would always be human-readable and people could learn by studying the code from the sites they visit. However, this idea is not really active now. It's common practice to run JavaScript code through a "minifier" that packs it to make it as small as possible so it will load quickly, and minified code isn't very friendly to read. There are tools available to somewhat beautify minified JS, but I'm certain that there will be tools to "decompile" WebAssembly and produce something sort-of readable. So while in this one area WebAssembly is not quite as nice as JavaScript, I don't think it's a significant thing, and it's not even remotely enough to make me oppose WebAssembly.

    Developers will be able to take existing code in languages like C, C++, etc. and compile them into this portable virtual machine language, and web browsers will be able to load and run them quickly. People will be able to write browser apps that run at near-native-speed and they will run on all the major web browsers and on whatever CPU you have (x86 and ARM for now). I don't really see a downside and I see lots of upside.

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
    1. Re:Looks good to me by steveha · · Score: 3, Informative

      the small benefit of JavaScript is that we can disable it and/or prevent certain function calls if you want to (e.g. my browser asks me if alert() is allowed to trigger or intercepts audio() and video() tags etc etc.

      All I know about WebAssembly is what I read in TFA but I'll bet you that it will still be possible to block API calls exactly the same way. In fact, if my understanding is correct, WebAssembly doesn't come with any API calls; it will need to ask JavaScript to do things like pop up an alert().

      Here, have a link I Googled up for you. Here's you you do an alert() from WebAssembly: you import alert() from JavaScript and call that.

      https://gist.github.com/cure53/f4581cee76d2445d8bd91f03d4fa7d3b

      So whatever you are doing right now to forbid alert() would continue to work when your browser downloads WebAssembly code.

      If you're going to obfuscate calls even further into machine code and allow for code to run directly on a CPU and manipulate memory without the capacity for inspection, you've given up all control.

      I've already made my position on that clear. Bytecode is less readable than minified JS but not by that much.

      Plus I don't actually pick apart all the minified JS my browser is running and inspect it in advance. And I figure with GMain and such my browser is running a lot of minified JS.

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    2. Re:Looks good to me by steveha · · Score: 3, Informative

      allow for code to run directly on a CPU and manipulate memory

      I missed this the first time around. WebAssembly is sandboxed exactly like JavaScript is. It is neither more secure nor less secure than JavaScript.

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
  18. Lack of One Rich American Called Larry Ellison by tepples · · Score: 2

    The first difference I see is that wasm is not encumbered by Oracle's licensing restrictions. In addition, wasm is designed such that traditionally unmanaged languages like C++ can compile to it, whereas the JVM and CLR impose type system constraints that make it hard to define how to compile something like standard C++.

  19. Web Assembly versus the cloud by raymorris · · Score: 2

    I also like to save my work locally. I don't like to do everything via the cloud. Let's be specific about what that means:

    The cloud:
    The real work of the application is done on some company's servers. Your machine is only the UI.

    Web Assembly and asm.js (and C, C#, Swift etc):
    The application runs on your local computer. The whole thing is on your computer, not just the UI.

    Javascript is rather slow (thousands of times slower than C), so you don't do video editing in Javascript, Javascript sends your data off to some server that does the actual work. C, C#, Swift, and Web Assembly are fast, so they can do video editing locally, without sending anything to any server.

    In C, C#, Swift, or Web Assembly you *could* write an application to send the completed output to Dropbox or Google Drive, but there is no need to do that. You can save your work locally if you want to.

    The only required difference between the traditional applications you're accustomed to and Web Assembly applications is that Web Assembly applications don't have to be installed. Both do the work locally, and can save the work locally - even on a device with no network connection. Obviously to get the application in the first place, any application, you need either a network correction, a USB stick, or some other way of getting the code to your computer.

  20. Re:Firefox - jack of all trades, master of none. by tepples · · Score: 2

    Those other things are better suited for local applications. Ya, I know: but, but, but ... no buts.

    Good luck rewriting said "local applications" from scratch when the available "local applications" are made for a platform other than the one you use. Even with a cross-platform UI toolkit such as Qt, an application's developer still has to make a conscious business decision to compile, test, and ship for each platform.

  21. Re:Package management? by Pinky's+Brain · · Score: 2

    That's more because of cargo cult and copy paste programming.

    It always amazes me how bad programmers like me can throw shit at a wall without any real in depth understanding and have it stick.

  22. It will be slow anyway by Blaskowicz · · Score: 3, Interesting

    Obviously this will allow much faster "apps" but we all know what that means. Tons of "features" i.e. yet more bloat and "innovation" i.e. new version of shit that looks like it's for cell phones and runs 4x slower.
    Javascript engines got a lot faster a few years ago and all we got was a ton of garbage and google making their "Maps" excruciatingly slow unless you run brand new hardware. Also, javascript Doom got taken off the internet for copyright infrigement and all the games are on Android Google Play anyway.
    Devs, stop masturbating to your i5/i7 laptop and your Samsung S7 and don't forget to also test on sensible specs like 1GHz and unsupported AMD graphics. People aren't interested into upgrading every other year to a computer that can run Crysis just to do the same things we did back in 2005 or so.

  23. Re:Native code running in the Browser? by Mr0bvious · · Score: 2

    Not quite true.

    Amongst other things, Web Assembly can do multi thread support (posix style) and actual sockets.

    For anyone wanting to port existing apps/libraries to the web, this is a significant step.

    --
    Never happened. True story.
  24. Disappointing outcome by wllang · · Score: 2

    I worked on this development for over two years, since before the WebAssembly CG was created, and have been demonstrating some of the best performance from asm.js and wasm style code, and I believe the process and outcome has been somewhat of a failure. There are some positive outcomes, such a set of operators, but this seems just a small step from asm.js (adding some 64-bit operators etc).

    At the end of this process it became clear that seeking a single virtual machine or encoding was not a good outcome, because it means that the web community is stuck with the lowest common supported feature set. It seems that the key enhancement that was required was a translation layer from the deployed binary to a VM that might be somewhat specific to particular web browsers, plus a build process. This would have allowed the major web browsers to offer different competing solutions and web developers could still target code to them by having the translation layer rewrite for each. While this can be done in part with the wasm 1.0 version released, I do not believe this is well supported because it needs to work very well with streaming and caching.

    Caching can work well with named sources and their versions and the dataflow that produces the translated output and the compiled output. For these products to be safely shared across origins the web browser needs to control the inputs into this build process - a defined and sandboxed build pipeline was needed. Scheduling of the builds could also be far better managed by the web browser using global knowledge that is not practically available to each context.

    Optimizing memory accesses is also critical. The key sandbox requirement is to ensure that accesses to the linear memory are contained so safe. To achieve near native performance requires some design attention to this challenge. My impression is that the design of wasm assumed only that memory protection would be used to efficiently catch accesses that are out of bounds. Early on I had been demonstration very good performance using a pointer masking technique, so to mask off the high bits and have the VM derive that the index is within bounds, and even for translated C code this was giving very good performance. For code that uses tagged points and naturally masks off these tags it could mask off the high bits at the same time almost for free. For this to work well requires that the memory be a power of two plus a spill area, and that the masking be baked into the code, and this could be done in a translation layer if the linear memory size were negotiated and an input into the pipeline. The WebAssembly project just would not accommodate this use case, my patches across JS compilers were stalled and some still sit there today with no progress in the past two years.

    With pointer masking it helps to move the masking before small offsets are added to indexes, so that the machine index+offset instruction addressing modes can be used, and this helps hoisting the masking and reduces register pressure etc. One complication is that this only works assuming the index is non-negative so the offset does not wrap the index. Some C code would break without extra care. Emscripten refused to merge patches to improve support for this, claiming that it was not a good approach. Guess what, wasm adopted a similar memory access offset restriction, that indexes must be positive! There is a lot more to optimizing this, and I see little progress in the past two years. I can still demonstrate some of the best performance.

    Another memory related optimization is to be able to place the base of the asm.js/wasm linear memory at absolute zero in the address space, so that a register is freed from having to point to this base, and so that the machine instruction addressing modes can be better exploited to help the code. I had demonstrate how much this helped well before the WebAssemembly CG was created. Practically many systems already protect access to the low pages, so for code to use this strategy it would need to avoid using th

  25. the single, privileged *DYNAMIC* language, that is by rodia · · Score: 2

    Maybe my english isn't good enough, but if "dynamic" means "dynamically typed" here, then the sentence as a whole doesn't mean too much. WebAssembly (wasm) is clearly a target for mostly statically typed, compiled languages. And future plans point to direct access to the page DOM and other Web APIs. If this becomes real, I will happily forget about JavaScript for ever..

  26. Inner Platform Effect by CnlPepper · · Score: 3, Informative

    I'm just going to leave this here: https://en.wikipedia.org/wiki/...

    If you want native speeds, use the OS. This is doing nothing more than complicating development - now rather than just OS differences you have every possible permutation of OS and browser to deal with when bug fixing.

  27. Creative Cloud, MSN Messenger, Copy, Xbox Live by tepples · · Score: 2

    A web app lives and dies on the whim of the developer, which can go bankrupt or be DDoS'd out of existence overnight

    So do some kinds of native app if they can no longer connect to the developer's server that provides user license verification, communication with other users, or communication with your other devices running the same app. Examples include applications in Adobe Creative Cloud (once your subscription expires or once Adobe stops offering a particular application), MSN Messenger (which was shut down in favor of Skype), and the "Copy" file sync client (which was discontinued), respectively. Another example is any game for the original Xbox (2001) that uses Xbox Live.

    After all, how many people run an web browser offline?

    The goal of things like Service Workers is to make this practical. Google has lately been promoting "Progressive Web Apps".

  28. One Rich American Called Larry Ellison caused this by tepples · · Score: 2

    So, in the end, it's another competitor to Java, and the question I have is why is that necessary?

    It's necessary because a company with the corporate culture of Oracle Corporation acquired a company with the corporate culture of Sun Microsystems. All four major web browser publishers are expected to contribute independent implementations of the WebAssembly virtual machine to the public. The license for the Java spec, on the other hand, prohibits distribution of incomplete work-in-progress implementations to the public, forcing all reimplementations to be developed in private by a single entity.

    In addition, the Java virtual machine has several limits that reportedly keep it from being an efficient target for a C++ compiler.