4 ms·
I don't understand this fear of webasm. Anyone can run their javascript through minifiers, or compile C++ to asm.js right now. Webasm doesn't move the needle o
by AboutTheWhisles 9y ago
I don't understand this fear of webasm. Anyone can run their javascript through minifiers, or compile C++ to asm.js right now. Webasm doesn't move the needle of obfuscation much at all. The binary format can be turned into the textual ast representation directly.
http://ast.run/ http://ast.run/
- v_lisivka 9y agoSame holds true for machine code: Anyone can run their C trough minifiers or compile to machine code right now. Machine code donesn't move needle of obfuscation much at all. The binary format can be turned into textual asm representation directly. Currently, difference in performance between asm.js and WebAsm is about 5%. It doesn't looks like performance gain or portability are main reasons to select WebAsm over JS. IMHO (I'm developer myself), main reason is better obfuscation of the code.
- AboutTheWhisles 9y ago> Anyone can run their C trough minifiers I don't know of any programs that are distributed as C to be run directly like javascript. > Machine code donesn't move needle of obfuscation much at all There are two very fundamental mistakes you are making when equating webasm to raw processor instructions. The first is that webasm even its binary format is still organized in a abstract syntax tree, so its instruction are not flat, they are in a hierarchy. The second is that webasm doesn't take care of the input and output. Right now it doesn't even interface with the document object model, so all the IO is still done through javascript.
- dymk 9y ago> I don't know of any programs that are distributed as C to be run directly like javascript. https://github.com/kripken/emscripten https://github.com/kripken/emscripten
- AboutTheWhisles 9y agoThat's not what emscripten does. It compiles C to javascript and the program is distributed as javascript, not C.
- hood_syntax 9y agoIs executable size not a good reason? Also, I don't know how you think there's a noticeable difference of readability between minified asm.js and textual wasm for the average person. It might be more difficult for a programmer to read the wasm, but I can't imagine that "disassembled" asm.js is particularly readable in the first place (and both are completely incomprehensible to a non expert)
- v_lisivka 9y agoNo, because size is about same after compression. Average person see no difference at all. Moreover, I tested tank demo right now, and asm.js version is about 6% faster at loading (1.99s vs 2.12s from cache at Firefox 57.0/Fedora 26).
- conradev 9y agoI think the main reason is https://caniuse.com/#feat=asmjs https://caniuse.com/#feat=asmjs vs https://caniuse.com/#feat=wasm https://caniuse.com/#feat=wasm
- v_lisivka 9y agoAsm.js is just JS. "No support" means just "No ahead of time compilation for JS in engine." If you are trying to point that wasm is supported better on iOS, then look at performance tests: https://arewefastyet.com/#machine=29&view=breakdown&suite=asmjs-ubench https://arewefastyet.com/#machine=29&view=breakdown&suite=as... . At many tests, Safari is faster than other browsers at asm.js microbenchmarks.
- ShabbosGoy 9y agoI still don’t understand the primary use case or benefit over JS. Looks a lot like a solution in search of a problem. Maybe it can be used for DRM?