Live data from Hacker News

W3C recommends WebAssembly

w3.org

81–90 of 350 posts

Re: W3C recommends WebAssembly

#81
post #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 clo…

That sounds like the use case would be to insert some WASM component (that is a big heavy application / operation) into traditional web application framework as needed.

Less so an entire overhaul of web applications as it is a powerful tool to be deployed for things we don't do in the browser now because there is no way to / it would be a bear to do in JavaScript due to ... JavaScript being JavaScript ;)

Of course the amount of WASM to traditional JS or anything else could vary from application to application.

Granted we're predicting the future here so obviously it could be off.

Re: W3C recommends WebAssembly

#82

This feels like another step away from the free and open web many people are clamoring for. Distributing opaque binaries with websites instead of Javascript is a step past even the obfuscated minified javascript files meant to be confusing. At least those can still be debugged, stepped through, and explored freely by the end user if they want to learn or reverse engineer. Is there any tool or standard being worked on…

> Distributing opaque binaries with websites instead of Javascript is a step past even the obfuscated minified javascript files meant to be confusing. At least those can still be debugged, stepped through, and explored freely by the end user if they want to learn or reverse engineer.

If you really think this is true, look into Google's recaptcha blob.

Re: W3C recommends WebAssembly

#83

This feels like another step away from the free and open web many people are clamoring for. Distributing opaque binaries with websites instead of Javascript is a step past even the obfuscated minified javascript files meant to be confusing. At least those can still be debugged, stepped through, and explored freely by the end user if they want to learn or reverse engineer. Is there any tool or standard being worked on…

Dissassembled webassembly is probably way more readable than minified/packed js

Re: W3C recommends WebAssembly

#84
post #38

Earlier quoted context omitted.

> Distributing opaque binaries with websites instead of Javascript is a step past even the obfuscated minified javascript files meant to be confusing. At least those can still be debugged, stepped through, and explored freely by the end user if they want to learn or reverse engineer. That's not true. There's nothing "free and open" about the tracking code embedded in every modern site, or the javascript blobs you get…

I respect your point and semi-agree, but as someone who ran a small business in high school that usually involved reverse engineering obfuscated Javascript, I think you're overstating how hard it is to follow the logic of Javascript blobs. Yes, whole program flows can be insanely difficult to follow, but narrowing in on the logic of key functions is often what one needs when trying to learn from other's code.

So are you saying that reverse engineering javascript is easy? Or that it's easier than reverse engineering wasm?

I don't know much about web assembly, but x86, which is much more complicated with thousands of instructions, has been successfully reverse engineered basically since forever. There are decompilers that can automatically reconstruct source code in C or C++ from a binary blob.

Compared to javascript, the best you can hope for is to just format the code so its in a more readable structure, but that isn't going to untangle purposefully obfuscated logic. Add to that the fact that even a regular javascript program is an untyped mess, and it becomes clear that anyone specifically trying to confuse readers will have a very easy time of doing so. There are a lot of messy things you can do in javascript, almost COBOL levels of messy.

Also, I'm curious about this

> but as someone who ran a small business in high school that usually involved reverse engineering obfuscated Javascript,

What type of clients paid you to reverse engineer obfuscated javascript? Malware research? Something else?

Re: W3C recommends WebAssembly

#85
post #39

I really hope this can become a viable alternative to the JS-frameworks we have today for webapps and that more apps can be served via the web.

In what way viable alternative? JS performance is pretty good if you think of an admin interface or any business dashboard UI full of charts and stuff.

React for example shifting towards functional programming makes FE apps simpler and predictable.

If you dislike the HTML/CSS UI layer then WA is indeed an alternative. However you need to reimplement everything, like text selection, right click, focus, accessibility, dropdowns, etc, because all you have is a to draw on.

But! WA will eventually have DOM access, that will definitely open up the landscape to create new frontend frameworks.

Re: W3C recommends WebAssembly

#86
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…

You may like Lin Clark's posts on the subject: https://hacks.mozilla.org/2017/02/a-cartoon-intro-to-webasse... https://hacks.mozilla.org/category/code-cartoons/

I don't think it is a particularly great explanation of what WASM is.

>> Wait, so what is WebAssembly?

>> WebAssembly is a way of taking code written in programming languages other than JavaScript and running that code in the browser. So when people say that WebAssembly is fast, what they are comparing it to is JavaScript.

A better definition:

> WASM is a binary instruction format for a stack-based virtual machine[1]

This goes into some details that could answer the question raised in this thread:

> WebAssembly modules will be able to call into and out of the JavaScript context and access browser functionality through the same Web APIs accessible from JavaScript.

More useful details:

>> Engineers from the four major browser vendors have risen to the challenge and collaboratively designed a portable low-level bytecode called WebAssembly. It offers compact representation, efficient validation and compilation, and safe low to no-overhead execution. Rather than committing to a specific programming model, WebAssembly is an abstraction over modern hardware, making it language-, hardware-, and platform-independent, with use cases beyond just the Web. WebAssembly has been designed with a formal semantics from the start. [2]

More details from Wikipedia:

>> Wasm does not replace JavaScript; in order to use Wasm in browsers, users may use Emscripten SDK to compile C++ (or any other LLVM-supported language such as D or Rust) source code into a binary file which runs in the same sandbox as regular JavaScript code. ... There is no direct Document Object Model (DOM) access; however, it is possible to create proxy functions for this. [3]

I hope this helps.

1. https://webassembly.org

2. https://dl.acm.org/citation.cfm?doid=3140587.3062363

3. https://en.wikipedia.org/wiki/WebAssembly

Re: W3C recommends WebAssembly

#88
post #67
post #62

Earlier quoted context omitted.

> I think people starting to pump giant binaries to the browser As if that's not already happening today with obfuscated and minified javascript

Those aren't technically binaries, as much as people want to cling to the metaphor of javascript as "bytecode" and pretend no distinction exists between the two.

> and pretend no distinction exists between the two.

What's the distinction then? That obfuscated javascript can be looked at by people who don't know how to use a hex editor?

Re: W3C recommends WebAssembly

#89
post #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 clo…

> If you can't explain it simply, you don't understand it well enough.

Albert Einstein

Re: W3C recommends WebAssembly

#90

Earlier quoted context omitted.

In my opinion it’s been a long time since direct access to Javascript has been useful. Yes you can unminify javascript but it’s still more work than most people will go through (especially if the code was generated by a compile to javascript language)so for most people things aren’t really changing that much

Yes, it is a ton of work to step through and understand minified and obfuscated code, but it is a skill that many people learn and do if there is motivation. On your second point, I think the key is that the people who do have a reason to detangle the logic of minified JS can be very impactful. I consider open viewing of Javascript as similar to noncompetes in California. It allows one to view competitors source code…

Reading webassembly is not that difficult.

The main challenge is that variable and function names are not available, but minified js is no better in that regard.

Post reply on HN