3 ms·
That is never going to happen. This is a constant theme on Reddit at r/programming. It is based upon nothing but fear of web technologies (yes, I literally me
by austincheney 8y ago
That is never going to happen.
This is a constant theme on Reddit at r/programming. It is based upon nothing but fear of web technologies (yes, I literally mean fear as a raw and savage emotion) and a lack of understanding what WASM is. It is best to think of WASM as an embeddedable VM for JavaScript rather than opposed to JavaScript. https://webassembly.org/ https://webassembly.org/
First of all JS cannot ever be replaced by WASM. This is a stated project design goal of WASM. You have to understand that Web Assembly is there to fill the proprietary application add-in void of things like Flash using open standards safely in a way that is technology agnostic. Web Assembly is not there to serve as a crutch for people afraid of web technologies.
Secondly, there will never be direct DOM access from WebAssembly for security reasons. While that is the nail in the coffin on this matter there is the more practical consideration that developers, even those who write JavaScript full time for a living, tend to be deathly afraid of touching the DOM. If this were a reality the inevitable overhead (think of all the dependencies, frameworks, and abstractions developers cannot live without because the DOM is scary) would likely be just as high, or higher, than writing your own DOM library embedded within your WARM instance.
Thirdly, you can have a DOM interface in a WASM instance. This is part of the web components API, but DOM trees created for the WASM instances are islands to the WASM instance created from external JavaScript - https://medium.com/coinmonks/develop-w3c-web-components-with-webassembly-d65938284255 https://medium.com/coinmonks/develop-w3c-web-components-with...
- steveklabnik 8y agoDirect DOM access is certainly happening; it’s the thing that the wasm people are working on next. (Well, its prerequisites...) I agree with you that that doesn’t mean anything with regards to “killing JS” or anything.
- kristiandupont 8y ago>there will never be direct DOM access from WebAssembly for security reasons You should contribute this knowledge: https://github.com/WebAssembly/proposals/issues/16 https://github.com/WebAssembly/proposals/issues/16 >developers, [...], tend to be deathly afraid of touching the DOM I truly have never seen this. In fact, I'd say I often see a rather careless culture of doing DOM manipulation here and there because it solves an immediate problem, albeit by short-circuiting the abstractions that may be in place and are now a bit more fragile. I am writing JS in the entire stack at the moment and I am mostly happy with it. I don't think that ability will go away but I look forward to the day where I can do the same in Rust or F# or whatever. And it doesn't seem unlikely to me that one day we will see wasm becoming the foundation in browsers, with JS running on top of it like any other language.
- austincheney 8y ago> I truly have never seen this. In fact, I'd say I often see a rather careless culture of doing DOM manipulation here and there because it solves an immediate problem, albeit by short-circuiting the abstractions that may be in place and are now a bit more fragile. Uggghhh, somehow you have somehow never seen DOM fear while simultaneously describing your own DOM fear. To say this behavior is prolific underscores the prolificness of it. --- Some anecdotal stories of DOM fear: I remember trying to hire my replacement when I was the A/B test engineer for Travelocity. This was when jQuery was at its religious height before querySelectors were a standard. jQuery wouldn't work well in this context because it was too slow, required an external library, and developers spent more time debugging their crappy jQuery code than simply solving the business problem. I remember warning applications they could not use jQuery in this position and it would not be available for consideration in the interview. Half the candidates dropped out. Before I became the A/B test engineer for Travelocity I remember a principle engineer telling me they had to use jQuery because the DOM was too hard. Its because of stupid crap like that the company had no trouble promoting me to more senior positions. I remember being temporarily banned from an IRC channel because I described jQuery as slow. They are thousands of times slower on all browsers except Firefox where they are millions to billions times slower. It sounds like there should be more to this, such as a demonstration of bad behavior on my part, but I promise describing jQuery as slow was all it took to elicit an immediate emotional response that touched on multiple people. I remember being continuously flamed on Reddit for describing that WASM is not a DOM replacement. I have since deleted my Reddit account. On Reddit's r/programming the emotions are especially raw on this subject. I remember going into job interviews for JavaScript development and opening the conversation with my thoughts on jQuery or DOM access. Every time the interview would have to recollect themselves from being immediately disoriented and completely lost. Strange as that sounds it never stopped me from winning the job. I could go on and on, but fear of the DOM is real. People justify all manners of strange behaviors to qualify their defensiveness on this matter to the point of exercising extreme effort to avoid the subject at great expense to their business products and even their career decisions. Its really weird because the DOM is the standard and its stupid simple.
- danShumway 8y ago