9 ms·
What is WebAssembly? (2015)
- crdoconnor 11y agoSounds like it's opening up a whole new world of potential exploits.
- Rusky 11y agoNo more than the typical bounds checking done for asm.js byte buffers. It's nothing like NaCl.
- jacobolus 11y agoNote, this is from last June. It was submitted a few times, but apparently only one had a comment: https://news.ycombinator.com/item?id=9742556 https://news.ycombinator.com/item?id=9742556
- kristaps 11y agoI read the news back in June, but haven't followed WebAssembly since, any interesting developments lately?
- csvan 11y agoThe V8 team recently announced that they will be implementing WASM. https://groups.google.com/forum/#!topic/v8-users/PInzACvS5I4 https://groups.google.com/forum/#!topic/v8-users/PInzACvS5I4
- _alexander_ 11y agoI read this article several times, however I still have't understood how JS and WASM will be live together? If I can use C/C++ with static typing(of course if I can do DOM manipulation from my C/C++ program) why I should use JS?
- spicyj 11y agoWhy would you ever use any language over C/C++? Different abstraction levels, type systems (or lack thereof), ecosystems of libraries, even syntaxes all contribute to a decision in choosing a language. You might not like JS personally but there are plenty of things to like about it and many other people do. In practical terms, browsers will support JS forever for backwards compatibility even if all new code is written in WASM.
- _alexander_ 11y agoPersonally I really like JavaScript and I use it many years.
- koder2016 11y agoWhat happens when a monopoly is broken? A healthy competition ensues. The "misunderstood" language will still be used by devoted fans, the rest of developers will be able to have their pick as it should have been to begin with.
- ethbro 11y agoThere was an article on the history of Internet standards that I really liked that noted the most effective and adaptable standards had all essentially been API-like rigidly-defined-but-simple boundaries. The relationship between WASM and JS seems to be "js/js virtual machines are a de facto standard, so let's not repeat the mistakes of Java plugins and instead build off that foot-in-the-door."
- nv-vn 11y agoBecause using C or C++ for a website frontend would make your code 10x longer and more likely to have bugs.
- JupiterMoon 11y agoIs this assertion actually based on any data?
- castell 11y agoWhat's the difference between asm.js and WebAssembly? "The initial implementation of WebAssembly support in browsers will be based on asm.js and PNaCl". PNaCl? https://en.wikipedia.org/wiki/WebAssembly https://en.wikipedia.org/wiki/WebAssembly , https://en.wikipedia.org/wiki/Asm.js https://en.wikipedia.org/wiki/Asm.js So is WebAssembly mere an asm.js v2 where all browser vendors agreed on a standard?
- lmm 11y agoNo, it's a (LLVM-based) bytecode representation. http://nativeclient.googlecode.com/svn/data/site/pnacl.pdf http://nativeclient.googlecode.com/svn/data/site/pnacl.pdf
- kevingadd 11y agoWebAssembly doesn't actually have anything to do with LLVM. There's a LLVM backend that can generate it, but that's no different from how emscripten acts as a LLVM -> asm.js pipeline.
- antome 11y agoMore specifically, asm.js can be seen as WebAssembly alpha, and will exist as a shiv until most browsers can run WebAssembly. Both WebAssembly and asm.js can be compiled through emscripten.
- deleted 11y ago
- barrkel 11y agoFTR, Turbo Pascal also allowed you to write in assembler - the built-in assembly was well integrated with the language, too, doing things like referencing record offsets symbolically. If you could live with the limitations, it was pretty nice.
- shultays 11y ago>A new language: WebAssembly code defines an AST (so does JavaScript) represented in a binary format. You can author and debug in a text format so it’s readable. Heh, since every binary executable has a non-compiled source code somewhere out there, can we call them readable too?
- Manishearth 11y agoI don't think that's what they're saying; they're saying that wasm has a somewhat-readable textual representation. Not a precompiled/decompiled program, a one-one mapping from the AST to the text format. Or something. Think of it like how assembly is to machine code, but probably more readable.
- Rusky 11y agoThe intent is exactly like assembly/machine code, though they haven't really nailed down the format yet. Current implementation(s?) just use s-exprs, though I don't think they want that to be the final form.
- amelius 11y ago> No built-in automatic garbage collector This is cool, because this means people will implement their own garbage collection mechanism, which could lead to interesting innovations.
- yunti 11y agoThey plan to build a standardised garbage collector at a later stage so support other languages that require this so they can compile straight to web assembly.
- amelius 11y ago1. If people can implement their own GC, then they can make it fit exactly their specific use-case. For example, a GC for Haskell might be totally different from a GC for JS. 2. If web-assembly incorporates a GC, then it will become needlessly complicated. 3. Unnecessary complication in web-assembly means also unnecessary room for security flaws. (4. What good is a web assembly if you can't implement an efficient garbage collector in it?)
- Rusky 11y agoWebAssembly's GC isn't just some arbitrary new GC, it's the JavaScript GC. The benefit there is so wasm apps can integrate with JS and the DOM directly the same way things like Python or Ruby plugins written in C integrate with those GCs. Nothing prevents wasm apps from using their own GC as well.
- kodablah 11y agoIn addition to the other commenter mentioning it will use the JS GC of the browser for #2 (which has tons of manpower behind), the issue with #4 is that you would need threads w/ shared memory [1] which seems as far out as a native GC. Also, for #3, it's not "unnecessary" for a multitude of developers and languages. Web development without (at least optional) GC is going the wrong direction. 1 - https://github.com/WebAssembly/design/issues/104 https://github.com/WebAssembly/design/issues/104
- jlebrech 11y agoI just want a web framework that works like QT or GTK, or even a framework as a desktop that can be styled/themed independently of function. WebAssembly should give us opportunity for this.
- moron4hire 11y agoNo, that's not really what it's about. Perhaps you're think of something more like NW.js or Electron.
- robmcm 11y agoI think they mean a framework that is like QT to build web apps, not a web framework to generate native apps like QT.
- ju-st 11y agoWhat about https://en.wikipedia.org/wiki/PrimeFaces https://en.wikipedia.org/wiki/PrimeFaces ?
- IvanK_net 11y agoI am still a little skeptical about this new language. It is not so hard to to write optimizable JS. And when you need a real performance boost, most of such tasks are parallelizable, so you can use low-level WebGL or WebCL.
- nv-vn 11y agoThis isn't meant to replace the code you're writing, but rather serve as a target architecture for compilers. It may also end up speeding up your JavaScript if you compile it down, but the biggest difference will be to the current "compile-to-javascript" languages (TypeScript, Elm, Dart, etc.)
- robmcm 11y agoThe overhead of creating and transferring data between web workers can be very limiting, especially when we are talking about low level, high performance operations.
- corysama 11y agoNo browsers support WebCL. I believe Mozilla has stated that they prefer to wait to get WebGL compute shaders so that they can end up with one system to maintain instead of both. In my experience, carefully optimized JavaScript is still 10x slower than equivalent C++. C++ to JS brings that down to 2x.
- neikos 11y agoAnother thing to block in my browser I suppose.
- wtetzner 11y agoWhy? It's functionally equivalent (at least for now) to asm.js, which is just a subset of JavaScript.
- msandford 11y agoThis sounds great, but it's going to make it so, so much easier to spy on people and hide all kinds of nastiness in web applications. Worse is that tons of web applications that get exploited won't be understood by the people who run them. Wordpress is a total minefield right now and it gets hacked all the time. What'll happen once they have a module that compiles up web assembly output for all the other modules running to speed things up? EDIT: wordpress the thing you install yourself, not wordpress the hosted app
- moron4hire 11y agoHow is this at all different than now?
- msandford 11y agoRight now most javascript is readable-ish and if you see something totally unreadable, that's a good indication it's probably malware. Once you have machine code that's not terribly human readable it gets a lot easier to hide things.
- moron4hire 11y agoI take it you don't know what a minifier is or how it can save upwards of 50% of your payload size.
- Semiapies 11y agoThere's no real size difference if you gzip it at the webserver.
- moron4hire 11y agoThat is incorrect. Theoretically, it should be true, but in practice it is not. You get the most savings by minifying and gzipping.