Live data from Hacker News

W3C recommends WebAssembly

w3.org

231–240 of 350 posts

Re: W3C recommends WebAssembly

#231
post #193

Earlier quoted context omitted.

The change in dev culture worries me more than the change in technology. At least Flash sites used to be considered bad taste. Dare to grumble about something unnecessarily requiring gratuitous JS now, and you'll get berated as an out-of-touch Luddite who needs to shut up and get with the times.

My impression was the criticisms of flash stemmed from its security issues, it’s closed nature, it’s relative unfamiliarity (compared to popular languages of the time), and the nuisance that was making sure you had the right version running on your machine at any given time. Modern JavaScript addressed these issues, hence its popularity over Flash. This doesn’t endorse the gratuitous application of JS for fundamental…

One of the reasons of the downfall of Flash were those tiny Flash sites in the middle of a full screen page when we suddenly moved from small screens to 1366x768 or better. Many sites didn't have the resources to upgrade and started looking like something 100 years old.

Re: W3C recommends WebAssembly

#232

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…

> I think the key is that the people who do have a reason to detangle the logic of minified JS can be very impactful.

You don’t need javascript for this. People reverse engineer native binaries all the time. Reversing wasm isn’t much more difficult than minified javascript as my sibling commenter states.

Re: W3C recommends WebAssembly

#233

Earlier quoted context omitted.

>95% of the time, if you can't represent your app state as pure text, you're overcomplicating your design and haven't thought enough about your UX. This is a design opinion. I disagree with it. Minimalism is simply a design philosophy just like brutalism or complexity. The underlying mechanisms should be design agnostic. >HTML on its own is a render target. CSS is a completely optional secondary display modifier that…

This is not a design opinion to me. Unless your application state can be represented as pure text, it can not be efficiently conveyed to blind users. So we force you to do that. > It would be better if the web browser world had pixel level render targets We also have escape hatches when you need pixel controls: Canvas, and webGL which can be rendered to a Canvas. The only difference is that they're not the core that…

>In the browser, text is your pixel. Of course you are welcome to build things on top of that with CSS, images, and Canvas. More to the point, I'm not saying that 95% of the time you should abandon your design and make a minimalist terminal interface -- I'm saying that for 95% of the phone apps and native apps I see, HTML would be fine. There is a pretty good chance the design someone has come up with is already representable in pure text, and they just haven't thought hard enough about how to do it. I'm not saying design everything minimalist, I'm saying your design is probably already a lot more minimalist than you think, and it probably wouldn't be that hard to separate content from pixel-positioning and style for most apps.

This is your opinion, and your opinion deserves to be fulfilled. My opinion is that the web is a multimedia platform that can do combinatorial designs where text motion and visualizations can be combined into something like this:

https://neal.fun/deep-sea/

In my opinion what you see as 95% of all user interfaces is largely a because HTML and CSS are the rendering target not the other way around. There are less games and those types of UI interfaces on web browsers because HTML + CSS is bad for doing those things.

So if we have different opinions what's the best way to fulfill both? Libraries. One library for your text based philosophy and one for mine. The lower level technology should be agnostic to both of our opinions. What I don't like is having to submit myself to your design philosophy and write my canvas library on top of HTML + CSS.

webassembly makes logic language agnostic on the front end. It's time to do the same for the "render target"

Re: W3C recommends WebAssembly

#234
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.

WASM is essentially a more efficient version of Asm.js, which is just Javascript. WASM is a binary format. Asm.js is Javascript. They're equally obfuscated.

Re: W3C recommends WebAssembly

#235

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…

This might actually be a great direction to go.

I don't think there's any particular reason that WASM has to be more obfuscated than JS. You can already throw a WASM file into a bytecode-to-text translator which is about as useful as deobfuscating a minified JS file, and I assume decompiling/debugging tools will only get better in the future.

For a long time now, I've been thinking of a future where your OS properly isolates all the programs that run on it and even gives us the ability to have direct control over how programs interact with the rest of the system. OS's seem too mired in backwards-compatibility requirements to make big changes like that any time soon, but that's basically the way our browsers already work. Download some code, and execute it (relatively) safely because it's sandboxed from the rest of the system. Our browsers are basically the new OS, and this time around we can do it right using what we learned from OS's (and hopefully backport these browser features into the next generation of OS's).

For example, an app asks for a filesystem handle. You can hand it one that refers to a real location on your OS fs, or you can hand it a completely virtual fs that won't affect anything else on the system.

Whenever an app asks for a resource, being able to hand it a virtual or sandboxed one instead is a huge gain for user-control.

Re: W3C recommends WebAssembly

#236
The design goals of WebAssembly are the following:

Fast, safe, and portable semantics:

* Fast: executes with near native code performance, taking advantage of capabilities common to all contemporary hardware.

* Safe: code is validated and executes in a memory-safe [2], sandboxed environment preventing data corruption or security breaches.

* Well-defined: fully and precisely defines valid programs and their behavior in a way that is easy to reason about informally and formally.

* Hardware-independent: can be compiled on all modern architectures, desktop or mobile devices and embedded systems alike.

* Language-independent: does not privilege any particular language, programming model, or object model.

* Platform-independent: can be embedded in browsers, run as a stand-alone VM, or integrated in other environments.

* Open: programs can interoperate with their environment in a simple and universal manner.

Efficient and portable representation:

* Compact: has a binary format that is fast to transmit by being smaller than typical text or native code formats.

* Modular: programs can be split up in smaller parts that can be transmitted, cached, and consumed separately.

* Efficient: can be decoded, validated, and compiled in a fast single pass, equally with either just-in-time (JIT) or ahead-of-time (AOT) compilation.

* Streamable: allows decoding, validation, and compilation to begin as soon as possible, before all data has been seen.

* Parallelizable: allows decoding, validation, and compilation to be split into many independent parallel tasks.

* Portable: makes no architectural assumptions that are not broadly supported across modern hardware.

If webassembly is truly able to meet this goals, together with good debugging and tools, it will become the the universal way to represent computation across devices and platforms.

Really cool.

Re: W3C recommends WebAssembly

#237

Earlier quoted context omitted.

> It’s all compiling to HTML, CSS and JS in the end. I don't generally have a problem with this. I use JSX at work too. My take is it's just another templating system, I don't think it's special. I don't have anything against templating. To a certain extent, my point is that template systems are good -- put your two-way data bindings and special components in them. When I write JSX though, I make sure it renders out…

CSS files are in a league in their own for how badly they represent the state of my app. In no other data structure would we say "oh sure, lets arbitrarily name groups of key/value pairs in a nested hierarchy that may or may not match where they are applied. Also, its a global namespace so let's preface every name with our application name". At scale, CSS classes are really difficult to find when looking at your comp…

> because you literally can't build a good looking dropdown with normal HTML.

I want to push back against this in particular, not only because I think it does HTML/CSS a disservice, but because I've maintained codebases that took this approach and they're really bad to work with. You're trading a little bit of CSS annoyance for constant positioning/z-index errors -- and you'll need to update your positions whenever your page scrolls or a component grows... there are just so many ways for this to go wrong, and there's always an edge case that developers miss.

Nothing is absolute, but most of the time the proper way to do something like a custom dropdown selector or tooltip is to semantically group it with the component it's attached to, and then at most absolute-position one element to center it relative to its parent.

  
    
    
      Option One
      Option Two
    
  

  .Input { position: relative; }
  .Input__Options { position: absolute; /* etc */ }
  .Input__Options--hidden { display: none; }
I don't like everything about CSS, there are a number of problematic design choices in the language -- particularly specificity. I also wouldn't necessarily be against a new primitive for scoping CSS to specific DOM trees. But annoyances aside, overall CSS is pretty great, and on net the apps I maintain that make heavy use of CSS are easier to maintain and less buggy than the apps I work on that try to use JS code to accomplish the same tasks. Obviously that's anecdotal.

Again, this doesn't mean you can't compose your CSS in JS. But separation of concerns is not for you. The point is to let me as a user override or ignore your styles, and to keep your styles away from your core content. When you spit out HTML and CSS, you are spitting out an application interface.

You're really worried about where you write your CSS, and I couldn't care less. I just want devs to render clean styles that I can work with as a user, and to stop using JS mouseover events to poorly recreate a hover selector.

Re: W3C recommends WebAssembly

#238

Whatever you think about javascript, I love the historic separation between content and interactivity. I dislike that so many static pages won't load without JS and that we're moving further in that direction. I hope the evolution towards "browser as OS" doesn't hurt the content vs interactivity separation. Could we ever lose the HTML centered model? That could mean we lose hackability and the ability to write extens…

"I love the historic separation between content and interactivity. I dislike that so many static pages won't load without JS and that we're moving further in that direction. ..." This I agree with you.

I think JavaScript and WebAssembly are not so bad programming languages, but I do think that scripts in web pages are overused (regardless what programming language is used, which isn't the issue).

Opaque single page apps are also bad for URL. Also I often use curl when I want to download a file (or in one case, to stream audio), so do not want to have to deal with the web browser to do that.

Re: W3C recommends WebAssembly

#239

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…

Why should someone else's website code forced to be "free"?

Because otherwise it's not a website?

"By the end of 1990, the first web page was served on the open internet, and in 1991, people outside of CERN were invited to join this new web community.

As the web began to grow, Tim realised that its true potential would only be unleashed if anyone, anywhere could use it without paying a fee or having to ask for permission.

He explains: “Had the technology been proprietary, and in my total control, it would probably not have taken off. You can’t propose that something be a universal space and at the same time keep control of it.”

So, Tim and others advocated to ensure that CERN would agree to make the underlying code available on a royalty-free basis, forever."

Can you see how rude it is to not do the same ?

Re: W3C recommends WebAssembly

#240

Earlier quoted context omitted.

> It’s all compiling to HTML, CSS and JS in the end. I don't generally have a problem with this. I use JSX at work too. My take is it's just another templating system, I don't think it's special. I don't have anything against templating. To a certain extent, my point is that template systems are good -- put your two-way data bindings and special components in them. When I write JSX though, I make sure it renders out…

CSS files are in a league in their own for how badly they represent the state of my app. In no other data structure would we say "oh sure, lets arbitrarily name groups of key/value pairs in a nested hierarchy that may or may not match where they are applied. Also, its a global namespace so let's preface every name with our application name". At scale, CSS classes are really difficult to find when looking at your comp…

> because you literally can't build a good looking dropdown with normal HTML.

I disagree. Build a drop down field using the normal form field elements; it is up to the browser to render them in a suitable way. (Which way is suitable may depend on details which the author is unaware of.)

> The point is to let me as a user override or ignore your styles, and to keep your styles away from your core content. ... I just want devs to render clean styles that I can work with as a user, and to stop using JS mouseover events to poorly recreate a hover selector.

That I agree. Let the user to override/ignore the styles, or to use them without changing if that is what the user wish.

Post reply on HN