A during back, I made a half-observation, half-joke on LinkedIn.
The awesome JavaScript toolchain rewrite barged in. The older tools that helped cement the language's location in our stacks became uncool, if not suspicious. Their sluggish achievement took the accuse for slowing downward millions of lines of code on their way to production. It's increasingly difficult to keep track of the chill kids on the block. Their names power not be catchy, but their commitment is captivating: speed, and a lot of it.
It's a different period to be a JavaScript developer. The tongue has never been additional ubiquitous, yet it seems to be losing dirt in its own backyard. The tools are faster, the setup easier, the abstractions thicker. We write, configure and delay less. We bundle, container and hotfix more. What happens between our code and the end merchandise becomes easier to ignore.
The benchmarks are all beaming green. The row charts are trending up, down, or sideways—whichever direction method small calls at 3 AM. So why am I current to ruin the party?
The tongue that wouldn't die
For a tongue (in)famously written in ten days, JavaScript managed to accomplish the unthinkable. It liberated its birthplace, the browser, and started swallowing everything about it. The reply was predictable: Who in their correct intellect would compose their server and tools in JavaScript? It turned out, many many many would. JavaScript made it onto phones, gaming consoles, microcontrollers and your fridge. If it understands bits, it can run JavaScript.
Despite its popularity, JavaScript never had it easy. Not lengthy following its inception, attempts to fix, or fairly substitute it altogether, were already in motion. Microsoft endowed Internet Explorer alongside VBScript and JScript, their own JavaScript flavour—not to be confused alongside J-Pop and JRPGs. In the 90s, everything echoed cooler if it started alongside J. Macromedia, and afterward Adobe, littered the net alongside Flash intros and games powered by ActionScript. Google bet on Dart for the forthcoming of Chrome before relegating it to Flutter.
Projects specified as CoffeeScript added several syntactic sugar to the JavaScript cup. When we weren't trying to substitute JavaScript, we were occupied patching it from the outside. jQuery unified a web phase whose browsers were barely on speaking terms. Lodash filled glaring gaps in the language's arrays and objects. Moment.js made dates person else's problem.
JavaScript wasn't sitting motionless during everyone plotted its demise, either. Within its sole thread, it was fairly busy. Browser vendors, standards bodies and the community kept pushing the tongue forward. ECMAScript releases brought lengthy awaited tongue features. TC39 kept the proposals coming, and browsers gradually learned to concur on what JavaScript was expected to do. Over time, its norm archive became small embarrassingly sparse.
Then came TypeScript, and JavaScript's caput was eventually on a argent platter. Or so it seemed. TypeScript succeeded anywhere the others unsuccessful by accepting one inconvenient truth: JavaScript wasn't going anywhere.
You could enhance it, conceal it, compile to it or objection concerning it. You fair couldn't get rid of it.
The superpower we're giving away
One tongue to regulation them all is the two a blessing and a curse. We spent decades talking concerning the curse. Somewhere alongside the way, we forgot concerning the blessing.
As JavaScript continued to spread, it started dining its own dog food. Node.js enabled a slew of tools to appear and conquer the ecosystem. Linters, bundlers, formatters and test runners were speaking the identical tongue as the code they linted, bundled, formatted and tested.
If, or fairly when, item bankrupt in that toolchain, the average JavaScript developer would be capable to inspect the code. Maybe they'd comprehend the bug. If they'd had their eight hours of sleep, perchance they'd fix it. If they were emotion combative, perchance they'd present a drag request. At the extremely least, they knew adequate of the tongue to confidently accuse the bug on the maintainers.
And that familiarity travelled amazingly well. The identical tongue followed developers from the browser to the server, and eventually nearly everyplace in between. JavaScript accelerated the increase of full-stack engineers, or perchance full-ecosystem engineers. Whether anyone can really expert the two ends of the stack without achieving demigod position is a conversation for another day. But JavaScript made the passage considerably easier. Engineers could bring alongside their cognition of the call stack, prototype-based bequest and the unlucky fact that typeof null === "object" to nearly any project.
People built complete careers and businesses about this catch-all ecosystem. The fact that most of it was and continues to be open origin and free certainly helps.
JavaScript won the browser wars, and multiple key battles elsewhere. Then Rust and allies showed up for the trophy and the commemorative photo.
In chase of milliseconds
Rust, Go and Zig are taking complete increasingly ample parts of the JavaScript toolchain. And there's an apparent logic for that.
They're fast. Really fast.
We're compiling JavaScript alongside Rust to create JavaScript that runs inner an motor written mostly in C++.
Nobody wants to gaze at a build procedure lengthy adequate to form an affectional attachment to the advancement bar. But whenever the replacement for an already-fast tool advertises itself as ten times faster, I commencement wondering what we're expected to do alongside all those precious milliseconds it fair handed us back.
Take an additional sip of coffee?
More importantly, what did we commerce for that speed?
Rewrite a bundler in Rust and you haven't lone made it faster. You've additionally shrunk the pond of JavaScript developers who can keep it. The new tool motionless looks akin a duck and quacks akin a duck, but it's a distinct beast altogether. Its internals retreat rearward a dreary box that small group clasp the keys to. The origin may motionless be open, but the entrance to contributions is closing.
Maybe that's a absolutely sensible trade-off. But it is a trade-off. And we don't appear particularly curious in that flank of the benchmark.
Not everything that shines is gold
Sometimes it's rusty.
Software engineering has continually suffered from a particularly acute case of shiny entity syndrome. Languages have their moment. Frameworks rotate into fashionable. A few prosperous projects established a pattern, companies allocate in it, gathering talks follow, laptop stickers get handed out and abruptly a specialized decision becomes the chief marketing point.
"Written in Rust" starts sounding small akin an implementation item and additional akin a feature.
Success breeds imitation. One tool gets rewritten and becomes dramatically faster. Another follows, and another. Peer force mounts. Soon enough, being written in JavaScript starts to appearance small akin the apparent choice for JavaScript tooling and additional akin a losing bet.
We're laying increasingly faster tracks for a steam train that likes to obtain its time.
None of this method those compiled languages are the incorrect tools for the job. Quite often, they are exactly the correct ones. But there's a difference between the correct tool for this job and the correct tool for all job that looks vaguely akin to any the competition is doing.
Once the shiny new tool additionally happens to top the benchmarks, resisting it becomes considerably harder. Speed provides the specialized argument. Trendiness takes attention of the rest.
Destination unknown
Our chase of faster JavaScript has taken us to fairly a particular place.
We're compiling JavaScript alongside Rust to create JavaScript that runs inner an motor written mostly in C++.
Perhaps that's the natural development of mature ecosystems, and JavaScript doesn't need to swallow the complete stack to remain relevant. Languages can coexist and motionless thrive. The web was built on at smallest three of them, before many additional joined in.
Taken individually, all stage makes ideal sense. Taken together, they item location additional interesting. We're putting a significant amount of engineering into optimising everything about JavaScript during JavaScript itself remains the destination. We're laying increasingly faster tracks for a steam train that likes to obtain its time.
The item concerning speed is that it doesn't continually justify a gentle journey whenever the train itself isn't designed to keep up. Sooner or later, faster tracks volition create small and small of an impact. And someone, much smarter than me, volition have to ask the difficult question: how far can we go before rebuilding the web from the dirt up starts looking akin the saner option?