To say this is a bold and controversial proposition is quite an understatement. It seems like JS is expanding like an octopus, taking over everything. So how can I make such a bold claim?
How did JS ever get so popular in the first place? Hopefully no one can dispute that it is for a single reason: it’s the only way to script in the browser. I mean, I know there’s TypeScript and CoffeeScript and so on but they still end up transpiling to JS. Hopefully no one is going to claim there would be such a thing as Node if millions of coders hadn’t already been fluent in JS out of necessity.
But soon that’s not going to be the case anymore, because WebAssembly is coming on line. If you don’t know what that is, it’s binary code, compiled on the server side, that can be downloaded and run just like JS. Right now WASM is no direct competition for JS. In demos so far, it’s used to create a graphics window through OpenGL in order to make blazingly fast online games.
But even as they say that, they are putting in hooks for manipulating the Document Object Model. For that matter, who needs the DOM if you have a full interactive app in a window? Certainly it’s easier to make some text boxes or dropdowns or whatever you need than a first person shooter.
Making an app in WebAssembly is still really hard. First of all it can only currently be made from an app in close to the metal languages like C, C++ or Rust. And even if you know one of those languages there are no commercial or easily accessible public apps for making a WASM program easily from your source code.
Right now they wouldn’t, but that’s going to change.
But if you’re going to go to all that trouble, why not just write a binary app and compile it? Big companies like Google and Facebook certainly must be thinking that. They can hire programmers to do whatever they want. So why hire frontend developers when they could just hire C++ programmers?
Furthermore WASM is going to become more and more accessible. The WebAssembly team is already working on making it compile from garbage collected languages like Java. And as demand rises, there will be more and more tools to make creating WASM easier and easier.
And demand will rise if more and more major sites are written using WASM. Everyone wants to do what Google is doing, even if it’s complete overkill. If you don’t believe me look at the demand for Hadoop.
The other day I was scheduled to have a Zoom conversation with someone online. But I forgot that I had a new phone and hadn’t downloaded Zoom or Facebook Messenger, which is how they usually send me the link. I texted them to wait a minute, and went to the Google Play store and downloaded and installed both apps in less than two minutes. That’s not quite as fast as downloading a web page, but it’s getting there.
And when there is no more need for JS on the client side, do you really believe anyone’s still going to want Node servers? Yes, Node is great for throwing up an app quickly. But there are other languages that are just as good for that, like Python and Ruby on Rails. (It would be hilarious if I was wrong just about this and JS became primarily a server-side language.)
What if WebAssembly turns out to have the same security concerns as Java applets? It’s possible, but even if that happens something else will come along that does the same thing. The web was never made to create fully functional apps. It was just a way of sharing data, a successor to the GOPHER protocol. It became what it is because that’s what people needed, and there was no better alternative. Soon there will be.
Don’t get me wrong. When it comes to programming languages, what is dead may never die. They say you can still make a good living as a COBOL programmer from all the legacy systems still running it. Without even looking at it I’ll guess there is probably some thriving ALGOL community out there.
So there will always be some JS out there. But I predict its time as one of the main languages of the Web is going to come to an end. It won’t be fast. I’m talking over the scale of 15 or 20 years. So there, I said it. Fight me.