4 ms·
I mean, the whole "{} + [] == 0" thing is cute and all, but isn't that just tip-of-the-iceberg hilarity? Isn't the real problem with javascript that it's slow a
by nothis 10y ago
I mean, the whole "{} + [] == 0" thing is cute and all, but isn't that just tip-of-the-iceberg hilarity? Isn't the real problem with javascript that it's slow and messy?
- sdegutis 10y agoI was under the impression modern JS interpreters JIT to machine code and are fast. Kind of like how Java was slow in 1995 but today is kind of amazingly fast. Which I guess implies that there are two ways a language can become fast: one is by being designed for speed, and another is by becoming extremely popular/useful and having tons of millions of hours of thought and work put into making it faster.
- kybernetikos 10y agoJS engines have improved by about 2 orders of magnitude in speed for actual use over the last 10 or so years. They've outpaced Moores law.
- goatlover 10y agoProbably because the head guy working on V8 had lots of experience with virtual machines going back to Self in the 80s. But it's kind of silly to say that JS VMs have outpaced Moore's law, given that interpreted JS was very slow to begin with. It's not the same as a compiled languge improving by that much in the same time. Basically, JS wasn't leveraging much of the computer's power until V8 came along.
- kybernetikos 10y agoIt seems that you're complaining about some perceived meaning in my comment, but I'm not sure what it was. Having written significant pieces of code in javascript over the last 13 years, I've benefitted massively from those speed increases, and while I'm aware of a number of reasons that they have occurred (including but not limited to the v8 engine - I remember reading excitedly about tamarin, tracemonkey and the like), I don't think it's silly to point out the sheer magnitude of the improvement. I'm not trying to say that JS is going to save us from Wirth's law or anything, I'm just trying to give people context on what a huge jump it has been.
- nothis 10y agoOkay, but we can always replace "slow" by "slower than" and in a desktop environment (which the article is about), we could still compile C++ code to run natively and outperform JavaScript any day. The whole brouhaha about JavaScript being fast stemmed from it suddenly not being 10 times slower than native code in benchmarks. But it's still slower. By using JavaScript you are, out of the box, sacrificing about 20% of your performance for the comfort of using it. In some cases, maybe only 10%. In others 50%. I can totally understand how that's a trade-off one is willing to make in many cases. But for desktop apps, I kinda want them to run at full speed. Like, a 0.2 second delay can get annoying if it comes at the wrong time or stacks with something else. And somehow, you can feel that in many hyper-modern apps that are so many layers removed from the hardware, the devs probably don't even know where it touches it.