4 ms·
Understanding WebAssembly text format
- hdhzy 9y agoI don't see a way to embed debugging info inside/alongside wasm binary code. I still remember debugging Java that does not store parameter names in byte code resulting in weird generated names vs .NET that stores this info. Maybe a source map for Web Assembly?
- dman 9y agoThe fact that wasm function names dont show up in chrome is my current top pet peeve
- hdhzy 9y agoAre there any plans for Node.js to handle WebAssembly? This way we could get native libraries compiled directly to wasm avoiding problems with linking native libraries to current version of node, etc. Of course not all libraries could be converted to WebAssembly...
- sjmulder 9y agoI hope we don't move in that direction. It would be a waste of perfectly fine CPU cycles and memory. Admittedly natively built modules pose a tooling challenge but we've been doing that for decades. WebAssembly could serve as a cross-platform fallback.
- copperx 9y ago> It would be a waste of perfectly fine CPU cycles and memory If history teaches us anything, is that we WILL move in that direction.
- hutzlibu 9y agoProgrammers time is still worth much more than cpu time ...
- sjmulder 9y agoThat argument makes sense when we're talking about languages that improve productivity at the cost of efficiency, but consider that we are now talking specifically about code already written in a compiled language. There is no need to run say, libpng, in a virtual machine outside the browser.
- hdhzy 9y agoYou could upload wasm to npm and distribute code like that, no need to compile it on target machine. While node.js generally does not have problems with that I've seen missing tools/MS Build on Windows machines.
- copperx 9y agoThat used to be kind of true, but now # cycles/sec has hit a brick wall.
- Ajedi32 9y agoYes. In fact, it already does, you just need to pass `--expose-wasm` to Node: http://thecodebarbarian.com/getting-started-with-webassembly-in-node.js.html http://thecodebarbarian.com/getting-started-with-webassembly...
- kodablah 9y agoHere are my string-to-sexpr [0] parser and sexpr-to-ast parser [1] for the text format. There are some oddities such as forward function names and the fact that the binary form doesn't have a lot of these shortcuts, but overall it is very straightforward. 0 - https://github.com/cretz/asmble/blob/e9cdfc3b0feafc3d4f76b9de5f6c71d1b6bcb9b0/compiler/src/main/kotlin/asmble/io/StrToSExpr.kt https://github.com/cretz/asmble/blob/e9cdfc3b0feafc3d4f76b9d... 1 - https://github.com/cretz/asmble/blob/e9cdfc3b0feafc3d4f76b9de5f6c71d1b6bcb9b0/compiler/src/main/kotlin/asmble/io/SExprToAst.kt https://github.com/cretz/asmble/blob/e9cdfc3b0feafc3d4f76b9d...