If it doesn’t really catch on and just ends up being mostly (ab)used for nefarious purposes, I can imagine the major browsers dropping support in a few years. They did with technologies like Flash and Java applets before, and those had had much wider adoption previously.
On the other hand, if someone comes up with a good programming language for modern Web-style applications that compiles down to Wasm for the client side and the ecosystem around it reaches escape velocity, that looks like an opportunity to disrupt a trillion dollar industry to me.
Such things used to seem unrealistic, but there is so much money in web development, the current state of the art is so bad in numerous ways and almost everything is currently so short-lived (by wider programming industry standards) that I don’t think it’s completely out of the question to move the goalposts to an entirely different playing field any more.
I’ve been thinking about this a lot in the last few years, and recently did a deep dive on Rust wasm.
I think it’s unlikely to be a single new language that replaces the current JS hegemony. My bet is that wasm makes it possible for any backend language to embed frontend logic, and each language will have framework(s) to take advantage of this capability in idiomatic ways.
I want to avoid specific language comparisons because they tend to veer into religious territory and shed more heat than light, but perhaps I can just note that Java, Rails, Elixir, Python and may others have great productive backend frameworks which could easily be extended to build and ship wasm to clients.
(I think the model of the new JS framework Fresh is interesting to hold as a comparison for what sort of thing you can do with unified FE/BE stack; shipping client JS only when the specific page needs interactivity is one cool feature for example. But with wasm you’re free to pick any point along the MPA - SPA spectrum.)
> if someone comes up with a good programming language for modern Web-style applications
I posit this has already happened and the language is Typescript.
I don't see how a different language could meaningfully disrupt TS at this point. I don't actually even see what there is to disrupt, to be honest. TS is great and really productive, and scales to large teams well. What language has the potential to be 10x better than it?
TypeScript is better than JavaScript in most situations. JavaScript is all that remained after the plugin-based alternatives were killed off. It’s not that TypeScript is a terrible language, but being a better language is a low bar to clear when you consider that we have 20+ years of extra experience since the early days of JS and a new language also wouldn’t inherit all the baggage.
Things that IMHO have the potential to create a profoundly better language for developing web applications include:
• A more expressive type and effect system
• A more capable module system and better dependency management
• A more comprehensive standard library
• Integral support for building distributed systems and modelling communication within them
Given those kinds of changes and avoiding a lot of the baggage, I think there is also room for a simpler, more systematic, more consistent syntax, which would be good for both human and computer readers. The latter is important because if it’s easily machine-readable then it’s easier to build tools, and building good tools around a programming language is a key factor in growing a large and sustainable ecosystem.
I don’t know what being “10x better than TypeScript” would mean quantitatively, but I find it easy to believe that a language could arrive within say the next 5 years that required less than half the time to develop the same functionality, produced less than half the defects that would need fixing later, and ran several times faster under realistic conditions.
I agree that improvements are possible in the areas you've listed, my point was that I don't believe they'd be significant enough to get the 2x productivity you later mention. They're all, in my view, at or above the 80% good enough mark for the current paradigm of what a web app is or needs to do, and any further improvements would yield rapidly diminishing returns. I think the fact that JS has been used for 20+ years, and now TS for most of the last decade, is partly (not wholly) because of this.
That's unless the paradigm of most web apps fundamentally shifts - ie your distributed systems point.
Don't get me wrong, if such a 2x productivity increase over TS is possible I'd love to be wrong here and see that happen - not least just out of pure interest of how that language could be so much better, because clearly I'd be learning a lot there :-)
Perhaps time will prove you right, though (in the nicest possible way!) I hope you’re wrong.
Personally, I’m optimistic that we can do much better than 2x on the important metrics as mainstream programming languages and the programmers using them adopt ideas that already exist in more obscure languages, programming research, and development teams that don’t necessarily publish their experiences openly.
I think some of the potential gains come just from making it easier and therefore quicker to read and write our own code. Better syntax, more expressive language features, a more comprehensive standard library, and eliminating some of the historical baggage like how null/undefined are handled could all help a lot compared to today’s TypeScript, IMHO.
There are also other areas, such as safety and making it easier to work with other code from within or outside our own organisations, where today a huge proportion of a typical TypeScript developer’s time is probably wasted on things like wrangling dependency trees that could be much smaller and better managed, investigating preventable defects that currently reach later stages in the development process before they are noticed, and writing unit tests for negative cases that would be unnecessary if the language itself designed out those possibilities.
Something that struck me a little while back is just how unimaginably large this part of the programming industry has become. We’re talking about millions of developers working on web applications and companies collectively worth trillions of dollars. How much would even a 10% long-term improvement in developer productivity be worth to the world? What about 200%? What about 1000% or more? Personally, I think we still have a long way to go before we run into any inherent limits on developer productivity, and we’re learning more all the time.
I wonder if the Ethereum merge (moving away from mining) will cause a drop in that misuse? I know a lot of the abuse are hidden crypto miners. There's going to be so much computing power shifting to the other coins (dropping the ROI) that there won't be much worth mining that can be done in the browser.
Until threads are included in WASM its security model is essentially the browser sandbox and scope limitation (WASM modules cannot access the global object nor call arbitrary functions)
Essentially WASM can be transpiled to Javascript (or ASM.js more likely) almost line by line and it would have almost the same security.
Flash and Java applet were so dangerous because the plugins introduced a ton of new APIs that skipped the browser sandbox. Wasm introduces no new API.
For non browser environments WASM mostly brings static validation, opaque external references, and bound checking on linear memory access.
If it doesn’t really catch on and just ends up being mostly (ab)used for nefarious purposes, I can imagine the major browsers dropping support in a few years. They did with technologies like Flash and Java applets before, and those had had much wider adoption previously.
On the other hand, if someone comes up with a good programming language for modern Web-style applications that compiles down to Wasm for the client side and the ecosystem around it reaches escape velocity, that looks like an opportunity to disrupt a trillion dollar industry to me.
Such things used to seem unrealistic, but there is so much money in web development, the current state of the art is so bad in numerous ways and almost everything is currently so short-lived (by wider programming industry standards) that I don’t think it’s completely out of the question to move the goalposts to an entirely different playing field any more.