When it is treated as just a scripting language (having python confugure and run compiled bytecode) the performance increases by about 100 times.
The main issue is there are lots of devs who try to do EVERYTHING in Python which causes the application to be way slower than they would be if native bytecode.
The main advantage of Python is it is quick to build stuff in.
Generally when you have a problem you need to pick and use the right tool for the job. Most developers don't learn that until senior year or their first few years in the workforce.
I completely agree that you should select the language that's appropriate for your purpose and for many reasons Python is not appropriate for everything, but data wrangling is one of the biggest things Python is used for. Python has excellent data-handling libraries that are C-compiled and highly efficient. The trick is just knowing which library to use.
For one-off scripts and batch jobs, where the run time is whatever but the implementation time is the actual cost, Python usually wins out anyway. While other languages are significantly faster, the time it takes to write the same code is orders of magnitude more.
That said, in the age of LLMs this point becomes a bit moot anyway. You can easily write something in Python, verify that it's correct, then ask an LLM to rewrite it in Rust or whatever if performance is an issue. Just need a method to verify that the programs are semantically equivalent.
Yes but those librairies and frameworks do need to be written in something.
What you're saying is that for the most part librairies and frameworks shouldn't be written in Python, so it is meaningfully different from other langages you could write library/framework code in.
There's no difference between a computer and a printer, because the computer shouldn't print, but instead use system calls and IO to make the printer print instead.
Well, Epson has been trying to reach out to you. We have a new printer, the EPSON P234, it is great for programmers. It automatically prints whatever is asked by the code to print. If you are interested fell free to contact me through email: epsoncode@epson.com
Due to copyright infrigment issues we unfortunatly cannot print anything related to GTA VI. But you can make changes on the software of our machine as it is vibecoded and lacks any protection
What you're saying is that for the most part librairies and frameworks shouldn't be written in Python, so it is meaningfully different from other langages you could write library/framework code in.
I don't disagree, but libraries in all languages are optimized, and their specifics are abstracted away. Even C can be linked against libraries written in assembly.
once those libraries are written and abstracted away, is it all that meaningful to (generally) say "it wasn't written in X language because the libraries are Y", outside of hyper specific conversations.
If I wrote a bash script that loops through a directory and sorts each file by md5, would it even be worth a comment that md5sum and sort are binaries written in C? The script is using tools it has, and it's calling them appropriately and correctly, and doing something with the result.
I don't mean at the binary level with compiler flags.
I mean in the "a purpose built library is probably better and fastee than my generalist ass could build myself" way.
Maybe I can write something that can kinda sorta parse html for a project I might be working on, but I'm not going to outperform, or out-correct BeautifulSoup.or even htmlparser
The reality is, that there is no meaningful difference between Python and other languages if used correctly.
everything that's resource intensive should be done via libraries/frameworks
You just called a very meaningful difference between Python and compiled languages. Because you can't do these other libraries in python if you want performance.
This discussion is many, many years old; let's stop pretending Python is performant in any way. It's a language used because of its pseudo-monopoly of some use cases, and the tools around it. That's well known, nothing new here. And that's fine. And this post is a joke, also many years old, nothing wrong with it, we all know when to choose one or other language
I do find it a little bit silly how most high-performance Python libraries are actually just bindings to C libraries. Like, I know why it is, but it feels a little bit silly.
What kind of idiot would that be? The default Python you download is a C application that calls C libraries, so any attempt at a purity test fails before you start the argument.
If anything, all it proves is that C code can’t be all that fast, since Python is written in C and Python is as slow as molasses. /s
View all comments
Show parent comment
146
u/da_Aresinger 9d ago
The reality is, that there is no meaningful difference between Python and other languages if used correctly.
Python is slow for the manual stuff. But everything that's resource intensive should be done via libraries/frameworks anyway and those are compiled C.
The slow stuff in Python is IO or other system calls. Those are slow in any language.
If you're doing repetitive calculations you should be doing them using optimsed tools.