News for hackers. Stuff that matters.
Re:Experimental support for WebAssembly in V8 by AgentME on Tuesday March 15, 2016 @01:42PM (#11291484)
WebAssembly is a compact serialization of asm.js, not of arbitrary Javascript.
Re:Experimental support for WebAssembly in V8 by DonHopkins on Tuesday March 15, 2016 @02:44PM (#11291997)
That's true of version 1, but supporting arbitrary JavaScript is on the roadmap (step 3, "everything else" [1]). Which will be awesome!

What I'd love to be able to do with tools like Unity3D that compile C# and other CLR languages into asm.js, would be to pass JavaScript objects directly in and out of the C# code so you can manipulate the underlying JavaScript objects directly from C# with little or no overhead.

Right now of course you can implement JSON libraries in C#, but it's indirectly and inefficiently layered on top of the flat memory model of asm.js. I want to be able to use the native JavaScript objects and libraries directly from other languages like C# that compile into JavaScript. That would be ideal!

To do that, asm.js would need a way to store references to garbage collected JS objects somewhere, somehow, using proxies or handles represented in linear memory, opaque reference types [2], or some other magic like that, like Apple's JavaScript/Objective C bridging stuff [3].

[1] http://bytecrafter.blogspot.nl/2015/06/a-quick-overview-of-w...

[2] https://github.com/WebAssembly/design/blob/master/GC.md

[3] https://developer.apple.com/library/mac/documentation/Cocoa/...

Re:Experimental support for WebAssembly in V8 by geon on Tuesday March 15, 2016 @03:41PM (#11292405)
Interesting. But then it wouldn't really be compilation, but parsing + serialization. I guess the distinction is rather pointless.
Re:Experimental support for WebAssembly in V8 by ludamad on Tuesday March 15, 2016 @02:22PM (#11291828)
This conversation was confusing until I read this point