Hacker News new | ask | show | jobs
by sametmax 2983 days ago
I have coded with both, and practically, yes, they are. The only place where JS would beat Python would be a big loop with number crunching, which you would do with numpy anyway. Or pypy, which is 50 times faster than V8.

A desktop app would not see any difference. A sysadmin script neihter. Data analystics is made using numpy/scipy/pandas. Web sites bottleneck are incredibly rarely the server side scripting language, and when it is, you go rust/go.

But for our current debate, electron VS PyQT, well yes, the C++ does the heavy lifting and you get to use Python only for the stuff it is good at. Win-win.

The problem with using PyQT is making an exe or making fancy graphics is harder than in electron.

Everything else, and I do mean everything else, is easier and more performant with PyQT.

3 comments

> pypy, which is 50 times faster than V8.

Ehhh V8 is pretty competitive with C for number crunching. Where are you getting that 50 times figure from?

threads.
http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-...

If you're using parallelism for non-IO-related reasons, then in either language, you'll probably end up using multiple processes rather than multiple threads.

I like neither python nor JS, by my experience is more like the parents. Once you step outside of the highly optimized C that much of the standard python is written in, it is not a very fast language.

V8 has been running many many laps around cpython for the use cases I have been using it for, and PyPy has generally been slightly slower.

You can't say that "a desktop app/sysadmin script/website/etc would not see any difference" without knowing what the app was doing. An app like VSCode has a ton of shit to do.

However, the real problem with PyQT is that Python is relatively garbage compared to JS and that's why it's not nearly as popular as JS.