News for hackers. Stuff that matters.
Re:Why WebAssembly Is Faster Than Asm.js by msoad on Wednesday March 15, 2017 @09:29PM (#13881602)
Without a GC WASM is very hard to use for regular web development tasks. When GC infrastructure lands lots of mind-blowing stuff will happen. Things like JVM and .NET running in WASM.

A lot of web people don't realize magnitude of impact WASM will have on the web.

Re:Why WebAssembly Is Faster Than Asm.js by dualogy on Wednesday March 15, 2017 @11:07PM (#13882141)
> Without a GC WASM is very hard to use for regular web development tasks

Well yeah.. it's an assembly language, the sort you inline in your C (or some other) programs to squeeze critical code paths.

Doing your virtualdom or form validation in assembly probably wasn't a core design goal, no matter all the scripters that get so easily hyped about wasm. But consider usecases such as real-time interactively adjustable filters on currently-playing page-embedded media objects, 3d editors that let the user run (non-shader) algos on the current model such as geometry simplification.. all kinds of use-cases come to mind where wasm can really drive richer, faster, more powerful browserbased apps than were possible without it.

Re:Why WebAssembly Is Faster Than Asm.js by Ajedi32 on Thursday March 16, 2017 @10:27AM (#13885251)
> Doing your virtualdom or form validation in assembly probably wasn't a core design goal

It wasn't part of the MVP, but it most definitely is a design goal for future iterations. See: https://github.com/WebAssembly/design/blob/master/GC.md

Re:Why WebAssembly Is Faster Than Asm.js by muizelaar on Wednesday March 15, 2017 @10:29PM (#13881912)
To get good performance on running JVM or .NET WASM will probably need more than just GC support. JVM/.NET JITs rely on inline-caches that aren't currently expressible in WASM. There are ideas about ways to make this work, but it will be a while.

The other thing preventing the use of JVM or .NET is that porting the runtimes over isn't easy. i.e. You can already run this bytecode in a browser but it isn't widely used. (http://jsil.org/, https://github.com/decatur/j2js-compiler, https://github.com/plasma-umass/doppio, https://github.com/mozilla/pluotsorbet etc)

Re:Why WebAssembly Is Faster Than Asm.js by voidlogic on Wednesday March 15, 2017 @10:43PM (#13882000)
Personally, I am more excited about the possibility of Go supporting WASM as a target: https://github.com/golang/go/issues/18892

I already write backends in Go, the hope of writing frontend code in Go is really exciting. All the JS people are going to say, "with node JS is already there", but this misses that I (and a vast number of other developers) hate JS with a burning fiery passion.

Re:Why WebAssembly Is Faster Than Asm.js by throwawaysbdi on Thursday March 16, 2017 @01:09AM (#13882698)
Yes! Go has a really small runtime I think a lot of us can't wait till Go is usable in browser.

Every developer I know hates JavaScript. I think the only ones that like it are honestly people that haven't used much else. Literally everything about the language including tooling and module systems around it is a garbage fire.

I tried to use Node and it gives stupid shitty error messages all the time and blows up if anything hangs for 200ms because it only supports a single thread. It's honestly pretty crap compared to more mature runtimes in C#, Java, Go, Python etc...

I think what's happened is that a bunch of front end HTML guys that only use JS have been introduced to fire water and they're going nuts about it

Re:Why WebAssembly Is Faster Than Asm.js by skybrian on Thursday March 16, 2017 @03:26AM (#13883181)
Go has a small runtime? It says here [1] that "hello world" in Go 1.7 is about a megabyte. That's huge by web standards. Even if they cut it in half.

GopherJS apparently struggles with binary size too [2] (though that's not WebAssembly).

[1] https://blog.golang.org/go1.7-binary-size [2] https://github.com/gopherjs/gopherjs/issues/136

Re:Why WebAssembly Is Faster Than Asm.js by voidlogic on Thursday March 16, 2017 @08:18AM (#13884382)
I think its fair to point out that:

  1. without concurrency
  2. if GC end up being provided by the execution environment
  3. without the need to support networking and file-system (assuming this has to go through JS)
The go runtime for WASM could potentially be much smaller than the size of the standard server side runtime.
Re:Why WebAssembly Is Faster Than Asm.js by voidlogic on Thursday March 16, 2017 @03:10PM (#13888093)
I forgot to note, if lots of page use this runtime and its loaded as a separate cacheable asset with a long TTL, the chances of it being cache are pretty great. Go didn't get popular for FE and I was writing a webapp FE in it I might stick it local storage too...
Re:Why WebAssembly Is Faster Than Asm.js by thomasrognon on Thursday March 16, 2017 @09:31AM (#13884810)
You're in a bubble. I've used QBASIC, C, C++, various .NET languages, Java, Python, list goes on and on. I've led desktop app, firmware drivers, kernel driver, security architecture projects, list goes on and on.

And guess what? I've been doing a ton of web dev over the past 5 or so years and I love it. I use React/Webpack/Node/ES201x/Typescript/etc. It's great.

When you're in a bubble, you like things for the beast you know, and hate things for the beast you don't know. There are a ton of devs out there that do not hate JS, and it sure as hell isn't out of inexperience.

Re:Why WebAssembly Is Faster Than Asm.js by voidlogic on Thursday March 16, 2017 @10:18AM (#13885181)
EDIT: I just realized you were replying to the over zealous fellow that replied to me and not me. Sorry. Time for coffee.

>You're in a bubble.

Come on, I made a qualified statement, I didn't even say most devs.

> I've used QBASIC, C, C++, various .NET languages, Java, Python, list goes on and on. I've led desktop app, firmware drivers, kernel driver, security architecture projects, list goes on and on.

I have a fairly similar history, ASM, QBASIC, C/C++, Java, Go, .NET (C#/VB), Haskell, Scheme, Prolog etc. I have also worked on systems software and applications.

I've worked at consulting firms, fortune 500s and startups and I have to say if you haven't run into my sentiment before commonly, I would assert that it is you who are in the bubble (sorry). I don't think you have to agree with my opinion, but to reject it as being common is absurd.

I don't hate JS out of lack of familiarity, in fact I have spent a lot of time porting node apps to Go and discovering all their terrifying callback spaghetti, concurrency bottle necks and inconsistent typing during single variable lifetime.

Re:Why WebAssembly Is Faster Than Asm.js by scriptproof on Thursday March 16, 2017 @04:37AM (#13883451)
I have used many languages, including Python, and I like JavaScript. It depend of lot of what you want to do with the language. If all the programmers you know are doing the same sort of tasks, such as server side scripts (the goal of Go), they have no reason to like JS.
Re:Why WebAssembly Is Faster Than Asm.js by Ace17 on Thursday March 16, 2017 @02:03AM (#13882880)
> Without a GC WASM is very hard to use for regular web development tasks. I don't get it.

If you're going to target the web and need a GC, why not use hand-written Javascript? (or any variant like Typescript/Purescript if you want additional compile-time checks like type-safety/immutability).

Re:Why WebAssembly Is Faster Than Asm.js by runeks on Thursday March 16, 2017 @02:44AM (#13883047)
I don't get it. Why not just write the GC in WebAssembly?
Re:Why WebAssembly Is Faster Than Asm.js by skybrian on Thursday March 16, 2017 @03:29AM (#13883190)
Then you have to download it as part of the web page. It's hard to beat shipping the runtime with the browser.
Re:Why WebAssembly Is Faster Than Asm.js by Ajedi32 on Thursday March 16, 2017 @10:43AM (#13885390)
I wonder if this could be solved with a better caching system for dependencies shared between multiple sites. Maybe some kind of content-addressable cache?

If your users only have to download the language runtime once, the idea of using a runtime for a popular language on your site doesn't seem like such a bad idea. Popular runtimes could even be pre-cached and shipped with the browser.

Re:Why WebAssembly Is Faster Than Asm.js by Ericson2314 on Thursday March 16, 2017 @10:02AM (#13885047)
Also for code composition it's great if everyone is using the same VM primitives
Re:Why WebAssembly Is Faster Than Asm.js by Touche on Wednesday March 15, 2017 @10:37PM (#13881961)
What's the benefit of JVM in wasm over compiling JVM langs to js?
Re:Why WebAssembly Is Faster Than Asm.js by dawidloubser on Thursday March 16, 2017 @06:07AM (#13883821)
I think you're missing the core use-case of WASM. It's not for general app development, which will stay with JS.

It's meant to provide plug-able, high-performance functions for heavy computational tasks - crypto, game rendering, heavy in-browser data analysis, etc etc.

I double JVM in WASM makes sense at all - though somebody will probably do it in anyway. WASM is not meant to be good at Garbage Collection, etc. It's not a design goal at all.

Re:Why WebAssembly Is Faster Than Asm.js by flukus on Thursday March 16, 2017 @01:41AM (#13882798)
.Net has adopted the go approach, the GC is compiled into a real executable, pretty sure there have been way's to do this for years with java too.
Re:Why WebAssembly Is Faster Than Asm.js by hackcasual on Wednesday March 15, 2017 @09:45PM (#13881669)
I would think of WASM the same way you'd think about JNI. It provides a way to have processor intensive integrate with a broader system.
Re:Why WebAssembly Is Faster Than Asm.js by jagger27 on Wednesday March 15, 2017 @09:40PM (#13881647)
The web and desktop computing.
Re:Why WebAssembly Is Faster Than Asm.js by paulddraper on Wednesday March 15, 2017 @10:28PM (#13881909)
Isn't that JS?