6 ms·
Please, can we stop having this argument every time there is an article about webassembly ? WASM not any more obfuscated than any minified JS. Being a bytecode
by maeln 7y ago
Please, can we stop having this argument every time there is an article about webassembly ?
WASM not any more obfuscated than any minified JS. Being a bytecode doesn't make you "unfree".
You have access to the same tool to debug JS and WASM. And the WASM specification is open.
There is literally no difference between running JS or running WASM.
- deleted 7y ago[deleted]
- lukebitts 7y agoMaybe I’m misunderstanding something but WASM is meant to be compiled from other languages and that source is lost, unlike minified javascript, isn’t it?
- remcob 7y agoWould you consider the source lost if the (minified) javascript was compiled from TypeScript?
- lukebitts 7y agoI would. And fair enough, I think the web closed around me and I didn't even realize it. But we are all doing ok so far, so I supose wasm won't be that bad either.
- danShumway 7y agoYes, but you'd see similar issues (to a different degree) with languages like Typescript and JSX as well. Cross-compilation has been a thing for a while now -- WASM is the followup to ASM.js, which was already being used as a compile target for languages like C. Now, reverse engineering ASM.js is easier than reverse engineering WASM (although ASM.js is still a giant pain). And reverse engineering minified Javascript is even easier -- most competent JS engineers could debug a React project without source maps, even if it took them longer. But it's not clear to me that WASM makes the process meaningfully harder. As in, you're still going to want to use source maps like you use today, and it'll still be totally possible to figure out what a program is doing without the original source. It'll just be a pain. And the benefits to the web as an open, language-agnostic platform that can be used for memory-intensive tasks outweigh the downsides of needing to work harder to reverse engineer software.
- maeln 7y agoMinifying JavaScript is as destructive as compiling from any language to WASM. The original source are also lost when minifying JS. The fact that the transpilation/compilation target is the same langage doesn't mean its any less destructive.
- strictnein 7y agoA binary format is no more obfuscated than minified JS? What now? Going to need some clarification on how that's the case.
- strictnein 7y agoI mean... come on: https://medium.com/@pnfsoftware/reverse-engineering-webassembly-ed184a099931 https://medium.com/@pnfsoftware/reverse-engineering-webassem...
- jandrese 7y agoI guess he's saying that an unminifier tool is effectively no different than a decompiler, and both are basically unreadable without it. That said, I don't know of any webassembly decompilers, although I guess they must exist by this point. But also historically decompilers have been imperfect as some of the structure of the code is lost in the compilation process and has to be inferred, sometimes incorrectly, by the decompiler. Compare to a minifier where all you lose is the variable names, comments, and possibly helpful whitespace. All of the structure of the code is still there and there are no heuristics necessary to recreate something that resembles the original source.
- pumanoir 7y agoThat is correct, a minified JS will preserve most of the semantics of the original program. And since the original source can come from any language, how would one know which decompiler to use.
- MikeHolman 7y agoYou could already compile programs from other languages to javascript. https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS https://github.com/jashkenas/coffeescript/wiki/List-of-langu... Wasm was effectively an extension of asm.js. It makes the experience of compile-to-web better, but it isn't much more opaque than other projects.
- 7y ago
- kick 7y ago"RISC-V is open, you can't compile proprietary binaries for RISC-V."
- maeln 7y agoThat is not what I said, don't try to create a fake argument. You real sentence should be "RISC-V instruction set is open, therefor I can see whatever a binaries is doing via the instruction it is executing." Doesn't mean its free, doesn't mean its easy to reverse engineer whatever the binary is doing, but you have everything to do it.
- pumanoir 7y agoThis is a valid concern. Among many things it is much easier to audit higher level code than bytecode.
- maeln 7y agoWhat can't you do? How is it any easier to audit minified JS than a WASM blob ? Everytime this argument is raised there is no valid argument to explain why WASM would be much worse than the current state of JS.
- booleandilemma 7y agoTwo wrongs don’t make a right.
- maeln 7y agoThen please enlighten us and share with us what is wrong.
- pumanoir 7y agoMinified JS (even with single letter variables and all) is still a high level language which is much easier for humans to follow than bytecode. That was only an example of it being a valid concern. I actually love WASM (specially the s-exp representation) and have implemented a compiler that compiles to it, but it's important to listen to valid concerns even if we really like a technology.
- linuxftw 7y ago> can we stop having this argument every time there is an article about webassembly No, we can't, it's a valid criticism, it's not going to go away. Minified JS is bad, webassmbly is worse.
- maeln 7y agoWhat is the criticism exactly? Saying WASM is worse than minified JS is factually wrong. We can debate about minified JS if you so desire but its a different debate.