Thanks ECMAScript,
You've Ruined Us All
Robots are coming for your JavaScript.
By James Kyle
Robots. You've probably heard of them. It’s possible you even think they're cool with their self-driving cars and DRM-based coffee-makers. Well you should be terrified, because they are going to take over and we only have ourselves to blame.
Artificial Intelligence will be taking center stage in the next century and it will drastically change our lives; and by drastically, I mean the robots are going to enslave us all.
Don't believe me? Well why don't you ask these smart dudes:
If I had to guess at what our biggest existential threat is, it’s probably [artificial intelligence].
— Bill GatesThe development of full artificial intelligence could spell the end of the human race.
— Stephen HawkingWe need to be super careful with AI. Potentially more dangerous than nukes.
— Elon Musk
Read that last one people. NUKES, he said.
Today robots are used everywhere we look, it’s only a matter of time before the machines gain self-awareness and eliminate us all.
The only thing that is currently saving us from certain demise is that the robots are still trying to figure out the internet. Sure, they can crawl static pages, and track you around the web, but there is absolutely no way they understand the 6,000 different frameworks we have created trying to make our resumes sound better and get those sweet sweet GitHub Stars.
But there’s an uprising against our last line of defense.
Today hundreds if not thousands of developers are beginning to use new language features of JavaScript. These new changes are such a huge improvement to the language that it’s actually starting to look usable… to robots.
Does that sound insane? Well let’s take a look at some examples.
import {death, destruction} from 'beep-boop';export const ROBOTS_HATE_PUPPIES = true;
This is the new module system in JavaScript. It was intentionally designed to be “statically analyzable” which is code for “Robots understand this”.
If you look again, you'll notice there is even constants. Humanity cannot afford to have robots knowing which data is immutable and which is not. If everything is a variable, then these robots going to be much more confused.
Here’s another example:
let doubleNums = nums => nums.map(n => n * 2);
doubleNums([1, 2, 3]) // > [2, 4, 6]
Just look at how little code it took to double those numbers. It’s going to be a huge problem if robots get to be that efficient. If we make them write out function all of the time, then everything they want to do will take just a little bit longer.
The robots won't even have to worry about context, because those fancy arrow functions don’t have their own context making it super easy for machines to understand.
Still not convinced? Here’s one last example for you:
class Robot extends Evil {
constructor() {
this.typeOfEvil = 'robot overlord';
super(...arguments);
}
createBlackHole() {
return 1/0;
}
}
var robot = new Robot();
robot.createBlackHole();
Classes? You have to be kidding me! That was the one thing that every single framework had their own implementation of, and now we're just going to make a single design that they can all be based upon?
We need to hunt down the people responsible for this and hold their feet to the fire.
I'm looking at you tc39 committee. Do you even realize what you've done? Did you have to go and add a module system and classes in the same go?
I honestly don’t trust that “committee”, I heard that Yehuda Katz is half-robot, and I'm fairly certain Crockford only created JSLint to dictate robot code style to be like his own so he could have command over them. I'M ONTO YOU DOUG!
It’s only a matter of time before Rick Waldron switches his robot army to io.js and loses control over them; and then what? Are we just going to roll on our backs and give up? No, I say we stand up and fight them. His robots are pretty small, we can probably take them.
The good news is that humanity still has a chance to survive. We can go back and re-divide the JavaScript community into 30 different compile-to-js languages. We can create 50 new frameworks every weeks, and destroy all of the super easy to understand documentation we've created.
Maybe, just maybe, we'll be able to buy ourselves a year or two of free will.