3 ms·
JavaScript is surprisingly fast and can easily outperform Ruby, Python, and PHP. It can at times keep up with or exceed Java, which is extremely popular. How ma
by astrodust 10y ago
JavaScript is surprisingly fast and can easily outperform Ruby, Python, and PHP. It can at times keep up with or exceed Java, which is extremely popular. How many gigawatt-hours of power are spent on an annual basis to run trashy, completely unoptimized PHP scripts? But okay, blame JavaScript.
Sure, you can piss all over JavaScript for having been shitty and slow, but it's not like that any longer. A lot of people worked very hard to dig it out of that ditch it was born in and make it into something that performs well.
It does everything Java promised and a whole lot more. This is not the world anyone predicted would happen.
> ...we are now re-implementing all sorts of desktop software in JavaScript...
Have you stopped to ask yourself why? It's cross-platform. It's ubiquitous. It's fast enough. Name another language that's as effortless to get started with, that's as insanely portable, that can be distributed easily through innumerable delivery channels. Java? Nope. C++? Hardly. C? Not really.
It's easy to sit in an armchair and bitch about how crappy things are, how much "power" we have lurking in these machines, and yet do nothing to tap into it.
What language do you use most frequently? What improvements could be made to that? No language is at its performance peak, not even long-time performance champions like C++ or C. There's still tons of room for compiler optimizations, for new libraries that better vectorize things, for better design patterns that make use of multiple cores better.
This is all at the language level as well. What about kernel issues? Linux is far from flawless. BSD could us improvements. That's not to say there aren't people working to make these things better, to push performance.
If these things are hard, that's the answer to why things aren't improving to your satisfaction.
- flukus 10y ago> Sure, you can piss all over JavaScript for having been shitty and slow, but it's not like that any longer. A lot of people worked very hard to dig it out of that ditch it was born in and make it into something that performs well. And yet electron apps are still shitty and slow. Funny how you only compare javascript to languages that have always performed poorly on desktops and not something apps are actually built in, like c/c++/c#.
- astrodust 10y agoThe original versions of things built with NodeWebKit and Electron were unbearably slow, it's true, but they've come a long way. If you want to build a cross-platform desktop application with any of C, C++ or C# knock yourself out. Someone using Electron will have good-enough prototype within weeks while you're still working on your build process. Where you can focus on one OS you can get better results with a pure C++, Objective-C, or Swift result, but when going cross-platform it massively complicates things. Today JavaScript is a pretty good answer to that problem, and performance is adequate enough people are willing to pay the price in terms of footprint. Software that exists but is suboptimal is better than software that doesn't exist but is hypothetically better. If you don't like those applications and think you can knock out something better in C++, by all means, but you've got quite a hill to climb. Microsoft Visual Code, as one example was written deliberately using Electron even though Microsoft obviously has some amazingly talented C++ people who can build cross-platform applications: Microsoft Office and a compiler. I don't think they took that decision lightly.