Live data from Hacker News

W3C recommends WebAssembly

w3.org

71–80 of 350 posts

Re: W3C recommends WebAssembly

#71
post #19

Does anyone have any good intro resources for WebAssembly for noobs? I've read articles here and there seen some in person demos, and honestly struggle to understand what it is / how it would / works relative to the current state of JavaScript frameworks. Often I'm approaching it from a JavaScript framework (React/Vue/Angular) approach as I'm a bit of a noob to the industry and that's generally my day job working on…

> Does anyone have any good intro resources for WebAssembly for noobs?

Wasm proper isn't really a technology for noobs. This is like asking "Does anyone have an introduction to x86_64 machine code, the ELF linker spec and the SysV ABI for noobs?". It's sort of the wrong part of the problem. What you want in that case is "C programming on linux for noobs".

So try googling for "emscripten tutorial" or (if you swing closer to rust) "wasm-bindgen tutorial". There are lots of other languages with wasm targets too, but quality tends to vary a lot.

But really IMHO the reason to use wasm isn't performance. Javascript interpreters are REALLY good these days for routine code. You use wasm when you need to target a big codebase in some other language to a browser, either because it's already written or because the problem area for the code isn't well suited to JS.

Re: W3C recommends WebAssembly

#72
post #8

This is bad for frontend JavaScript being "open" for review, right? Companies will ask their developers to deliver WASM resources in the name of performance. As a notable side-effect, it will become harder to review how websites work. Yes, I'm sure there will be reverse-compilation tools for WASM, but still.

JavaScript is often delivered minified without the corresponding original sources. If preventing reverse engineering is a goal, it could even be obfuscated, which certain sites already do. In practice, there's nothing that WebAssembly offers that could hinder analysis even further. If websites want to be transparent they could provide the sources (akin to providing unminified/unobfuscated JavaScript).

Reversing very heavily obfuscated Javascript is doable. If you want to fully reverse a 1000 line obfuscated file you're probably looking at a day or two of work, depending on how in depth you want to go.

Re: W3C recommends WebAssembly

#73
post #43
post #23

Hopefully this also means that Javascript is going away for good

I think people starting to pump giant binaries to the browser will lead to JavaScript leveraging its strengths and getting even better.

I don't get why binaries should be more bandwidth-intensive than JS.

I guess in a sense you already have the JS engine installed with, say, Chrome, which is essentially a runtime.

Why can't other runtimes come prepackaged? What am I missing here?

Re: W3C recommends WebAssembly

#74
post #34

Earlier quoted context omitted.

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.

Maybe 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?

Would you consider the source lost if the (minified) javascript was compiled from TypeScript?

Re: W3C recommends WebAssembly

#76
post #52
post #19

Does anyone have any good intro resources for WebAssembly for noobs? I've read articles here and there seen some in person demos, and honestly struggle to understand what it is / how it would / works relative to the current state of JavaScript frameworks. Often I'm approaching it from a JavaScript framework (React/Vue/Angular) approach as I'm a bit of a noob to the industry and that's generally my day job working on…

When was the last time you were able to unminify a javascript file that you wanted to investigate and were able to make sense out of it?

[deleted]

Re: W3C recommends WebAssembly

#78
post #34

Earlier quoted context omitted.

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.

Maybe 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?

Yes, 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.

Re: W3C recommends WebAssembly

#79
post #34

Earlier quoted context omitted.

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.

A binary format is no more obfuscated than minified JS? What now? Going to need some clarification on how that's the case.

I mean... come on:

https://medium.com/@pnfsoftware/reverse-engineering-webassem...

Re: W3C recommends WebAssembly

#80
post #34

Earlier quoted context omitted.

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.

A binary format is no more obfuscated than minified JS? What now? Going to need some clarification on how that's the case.

I 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.

Post reply on HN