News for hackers. Stuff that matters.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by tuckerconnelly on Tuesday February 09, 2021 @01:10PM (#26080691)
Python feels noticeably slower than Node.js, particularly when running scripts with large amounts of imports. I now pretty much always use JavaScript for, well, scripting. Not sure why Python and Ruby are considered go-tos there.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by arcturus17 on Tuesday February 09, 2021 @01:23PM (#26080850)
Because not all scripting has strict performance requirements, and as much as I love JavaScript, Python blows it out of the water in scripting ergonomics and semantics IMO.

Opening / reading / writing files, parsing args, making HTTP requests, etc. which are extremely common scripting operations are easier with Python, and the end result tends to be much more succinct thanks to its syntax (this applies to all Python code compared to JavaScript, but I'd argue it's especially valuable in shorter scripts).

Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by haswell on Tuesday February 09, 2021 @01:21PM (#26080821)
I’ve been scripting in Python since 2003. Node wasn’t mature/viable at the time.

Edit: didn’t exist at the time!

Python is my go-to because I know the ecosystem well and can go from zero to done with minimal effort and research.

Node has since (come into existence) and matured, and while it may be better/faster in some situations now, I haven’t encountered a project that has compelled me to switch.

I suspect the answer to your question boils down to a combination of: familiarity, preference, individual productivity, and pragmatism.

This will likely shift over time.

Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by franciscop on Tuesday February 09, 2021 @01:28PM (#26080912)
Node.js was created in 2009, so it wasn't even born in 2003:

https://en.wikipedia.org/wiki/Node.js

Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by Sohcahtoa82 on Tuesday February 09, 2021 @06:06PM (#26083722)
Node.js not existing probably contributed significantly to its non-viability in 2003. ;-)
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by haswell on Tuesday February 09, 2021 @01:30PM (#26080936)
Good catch. Brain fart on my part.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by wongarsu on Tuesday February 09, 2021 @01:20PM (#26080803)
Python gives you better escape hatches for typical compute-heavy work (lots of libraries use C under the hood), and Python has a better multi-threading story than Node.js.

But I guess the biggest differentiators are really the ecosystems and standard libraries. Node.js is certainly catching up, but Python has generally a better selection of high-quality libraries for tasks beyond the web.

Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by tuckerconnelly on Tuesday February 09, 2021 @02:49PM (#26081714)
Lack of library support is probably the most valid reason here. Most of the other reasons people have posted seem like opinions on ergonomics. I think those held true 10 years ago, but modern JavaScript feels very minimal and lisp-y and is more enjoyable to program with than Python IMO.

What libraries or escape hatches to you actually use in your daily work that are exclusive to Python? The ones I'm familiar with would probably be OpenCV and the whole machine-learning family of libraries (sci-kit, spacy, tensorflow, etc).

Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by brrrrrm on Tuesday February 09, 2021 @01:31PM (#26080951)
I believe libraries like v8pp are helping to shrink the gap with C library integration.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by rootusrootus on Tuesday February 09, 2021 @01:25PM (#26080865)
For a lot of workloads, performance is less important than maintainability. Python's cultural and technical adherence to an ideal code structure makes it a good candidate for long-haul code where CPU-bound performance isn't going to be a factor.

IMO the opposite end of that particular scale is Perl.

Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by offtop5 on Tuesday February 09, 2021 @01:18PM (#26080788)
Eh, when it comes to scripting, performance is almost never a concern.

Different tools are best for different jobs, for example if you need to run some basic NLP jobs pythons going to be much better.

Re:Node.js 14 is over 20x faster than Python3.8 for fib(n) by nullcat on Tuesday February 09, 2021 @01:15PM (#26080750)
Python as an implementation is slow but python as a language is much better designed then javascript. That is the main reason why they are gotos.