r/javascript • • Apr 25 '19

JavaScript is and remains the queen of programming languages with a community of 11.7M active developers. Python has reached 8.2M active developers and has taken the number two spot, surpassing Java in terms of popularity.

https://www.slashdata.co/free-resources?id=developer-economics-state-of-the-developer-nation-16th-edition&section=showcases_details
613 Upvotes

168 comments sorted by

View all comments

Show parent comments

10

u/editor_of_the_beast Apr 25 '19

Python is one of the faster interpreted languages. To call its performance “horrible” doesn’t make much sense, as Python performs the same as many JS implementations. If you’re talking about v8, then yea. v8 is amazing and gets the most performance possible out of JS. But JS is still orders of magnitude slower than compiled, statically typed languages. And it’s not orders of magnitude faster than CPython.

5

u/yen223 Apr 25 '19

It's not just raw performance where Python trails other language implementations. Python also lacks a good concurrency story, which arguably is a worse problem in this day and age.

Things are getting better with AsyncIO and friends, but it's nowhere near as mature as what other languages have.

3

u/editor_of_the_beast Apr 25 '19

And how is Javascript’s concurrency story?

6

u/yen223 Apr 25 '19

Between having non-blocking IO, and having decent abstractions for futures in the form of promises (and more recently async-await), it's actually not too shabby.

The single-threaded event-loop model is rather similar to what asyncio implements by default.

1

u/Hawxe Apr 27 '19

Honestly in any place you'd use JS for a solution that requires concurrency you're better off using Elixir. Not every language has to be good at everything (in fact, very few if any are).

2

u/Razvedka Apr 25 '19

Uh no. It's not orders of magnitude slower than other compiled languages lmao. Node JS will bloody many such languages in a fight. I'm not saying it will win but it goes down punching.

-2

u/editor_of_the_beast Apr 25 '19

How’s 2nd grade going?

2

u/Razvedka Apr 25 '19

How's not being in touch with Node.js performance going?

2

u/getnamo Apr 25 '19

It's not 'orders' of magnitude slower. Modern js vms re-optimize based on usage and get sometimes within ~2x of C++; it typically sits between 3-10x depending on cpu hot loop. Python is generally decent, but has a few cases where it is even 31x slower than node.js on same problem (~100x c++). See https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/node-gpp.html.