The default implementation of Python is CPython. It's always been byte code running C written machine code. There's even Cython to write Python that compiles into C code.
Yeah, it's great for that. I built an automated video test system for Comcast back in 2018 that was heavily-threaded C++ code with a Pybind11 API to send requests and retrieve responses to the backend. The system was responsive in real time as long as you didn't saturate the image recognition thread pool.
Youre known for being a wrapper for the C/C++ applications real developers used to make Machine Learning, you goddamn hack (Ive recently had to start maintaining a python microservice and I'm getting real heated about how shit python is)
That isn't quite the same. C/C++ compile into assembly, which means the code is fully converted. Python is typically simulated by an interpreter, so the code itself doesn't compile into any lower-level language. When they say it "wraps C/C++ code", they really mean that instead of simulating the python byte code, the interpreter runs a library that wasn't written in python at all.
Yeah but isn't a lower-level language, it's a machine-friendly format of the language. The main point is that by virtue of being interpreted, it is inherently different to languages like C/C++ or Rust.
No, that's not how it works. It's a wrapper because all complicated stuff is implemented in a real language and you wrap it with Python. No one does this with assembly.
Well, do you (live!) rewire your house to turn on the lamp in the kitchen, or add a switch that you can press and have it turned on/off instantly?
Sure, it may be "more efficient" to have a single real wire go to the lamp directly instead of the inefficiency of a switch. Oh and I don't like touching live wires either (heh, this analogue works quite well)
The Python script was ready week ago, took 5 minutes. Rust programmer first took 3 days to tell EVERYONE how much better it will be in Rust, then started coding and got bogged down for 2 days in a forum discussion on how to best secure memory for a "hello world!" string.
Meanwhile the Julia developer was done a week ago like the Python developer. Took 5 minutes all the same, and it ran faster than the eventual Rust implementation. No one gave a flying shit and used the Python implementation anyways because it's more familiar.
Comparing a language that gets compiled into native machine code to a language that typically compiles to and interprets byte code at runtime. Is there a point to this meme?
This sub has always been mainly posted to by first-year cs majors who spew out the same unfunny memes ad infinitum. OP likely just heard about either python or Rust for the first time and thought it would be funny to repost a meme about rust being faster than python.
I wonder /r/ConstructionWorkerHumor would be full of first year mechanical engineering students, who try to flex on each other for using a superior type of drill or hammer.
It's true but I find it way more annoying that every post has someone in the comments complaining that the humor is too common denominator. It's based on upvotes, of course the top posts will be the ones that most people can understand. The math memes sub has the same issue, every thread has a critic.
Plus why bring the mood down? I suspect some of the complainers feel validated by criticizing newer people.
I would say that the problem isn't that it is common denominator; it's that it's a sortof uninteresting take.
Sometimes, the speed of execution is important and you need to use a lower-level language to achieve that. More often--at least in my experience--the speed benefit is minor compared to the increased effort & complexity that going to a lower-level language would entail.
If your code is going to spend 99+% of its wall time waiting around for stuff to happen, going a millisecond faster in those few instances where it needs to do something probably isn't going to matter. In those cases, using a language with higher expressiveness (i.e., one that takes fewer lines of code to accomplish the same take) is a perfectly rational decision.
Nuance isn't best expressed in meme form, of course, but the sentiment in the top level meme feels like it'd fit well as the center of a bell-curve meme where the ends are "python's fine for most stuff".
I got fileted once upon a time over NFA/DFA here. Kid just took his very first combinatorics class, and the schmuck in me wanted to give him a high five but my tail was too far between my legs after the three paragraph dissertation.
Nah lol, ime it's always the ones close to retirement who repost this shit into the humor channel, somehow they never tire of endlessly repetitive memes
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.
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.
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
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 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.
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
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
the compilation vs interpretation difference is honestly not as big as between the language semantics making the program include information on static value types with fixed sizes, in contiguous memory vs chains of references to "objects" with boxing required even for things like numbers, each with a vtable, stored in non-homogeneous containers. so, as u/frivol mentioned, its more about the type system (or, the type system up to the degree as to which it can be pessimistically, with 100% sureness, be used by the implementation) and the data layouts that the type system (and more generally the information provided by "definitions" in the program, and the assumptions that can be made about it, e.g. "closed system", immutability) results in. python functions could be overriden at any point by an outside module loaded dynamically, and the implementation has to consider that as "standard behavior", so it cant "just inline the function", specially if its generic but cant be monomorphized since the type of the argument isnt known for certain even if its typehinted since it could either not be consistent with the typehint, or be a subclass with an overriden method (and python methods dont even need to marked virtual, its just duck typing all over).
I think python and rust are more alike than most languages. The defining similarity is that people try to do things in both languages that should not be done in them.
I am still astounded by the performance of JavaScript for this exact reason. They took an interpreted language and turned it into an extremely fast JIT-compiled language (it’s no C or Rust but it compares favorably to Java and C# in some implementations)
Python is rarely intended for end users. It's used for stuff like tooling, rapid prototyping, and as a simpler wrapper for native libs, where its own speed doesn't matter. For that stuff it is an amazing tool, and saying "Python bad" just because it isn't as fast as other languages just shows how people have no idea that different jobs require different tools. Dunking on Python for being "slow and bad for end users" is like saying horses are useless animals cause they can't even fly
C and Rust would each spend a panel asking the kernel to do things. Yaknow, the kernel really is the one doing most of the work, why do we not see more love for the kernel? Every programming language seems to be good at just two things: 1) Wasting CPU cycles; 2) Begging the kernel to do something for them.
That's not how the kernel works? Most of an application lives and runs in userspace while kernel calls are only done for stuff like IO or memory allocation
If you needed a syscall to the kernel for EVERY operation no language would be fast, tell me you understand nothing about operating systems without telling me
Python is slow but that's not a problem for a scripting language which is used for data pipelines, prototyping, and teaching coding basics to high schoolers. No one sane is using it where performance matters, like microservices. Oh, wait.
Also, I found some stuff on yt where a guy actually had to put in quite a lot of effort to make some math stuff run faster in C/C++ (not sure which one anymore) because python just used really optimised C libraries in the background. Not an expert and this is only anecdotal, but I think worth mentioning here, too.
probably. I think I watched that channel in the past and it fits the topic. I just can't remember exactly and don't wanna spend half an hour trying to find the exact video
If you factor in the cargo build time of compiling 200 crates down the dependency chain, Rust will probably start speaking only after Python has said hello and goodbye.
Especially when you factor in development time vs execution time. It's super quick to develop in compared to many languages, and you can always come back and optimize specific slow things down the road if you have bottlenecks.
Python is a great scripting language, but I hate that it is used in production code... it is slow, it obfuscates too much, it fails on runtime due to things a compuled language would fail at compile time....
I think it's because Python while easy to write, it's ecosystem feels completely braindead at times because of all the abstraction layers. As someone who transitioned to Python from writing native C, the amount of thought taken away from me gets irritating.
Take variables for example, writing variables without an explicit type feels messy (I know you can do type declaration but that's more of a bandaid fix). Then I'm genuinely not a fan of the "Pythonic way to code". It's oversimplified and makes critical thinking feel like slop.
The dynamic-but-also-not-dynamic typing is fucking infuriating. It makes it so you need to check for types manually anyway, and dealing with user input is a hassle.
got recommended to me in my home feed (cause I switched to linux like 8 months ago) and I still kinda found it funny so i stayed
For a little more context: I tried picking up programming back when I was like 7 and stuck with it for nearly 5 years. by then, I was really burnt out, and realized it wasnt my thing.
Python can be lightning fast when you use the right libraries. Obviously it's written in c++ or something on the back end, but it's still python being written by the end user.
Comparing the speed of a dynamic interpreted language to a static one that compiled machine code.. Let's next make a joke about how much faster a car is that a horse.
You're right, that is the order of magnitude of improvement that Rust brings over Python. You can still ride a Python around for fun but adults go to work in Rust.
ITT people who write code for a living or as a hobby seemingly unable to grasp that programming languages have use-cases and are rarely if ever universally applicable.
people is also unable to grasp "language efficiency" is way less relevant than what they think it is
in modern CPUs a single RAM lookup consumes 200+ CPU cycles just waiting for the response, let alone a network request querying a disk on a server somewhere (I'm looking at you fragmented microservices)
that kind of architectural optimization is way more important than "I'm using C because JavaScript is less efficient"
Python is only really slow if you have no idea how to use it. Sure it’s never going to beat compiled lower level languages like rust or cpp, but if you use and build proper libraries for your application in python it’s often a lot closer in performance than most people think
Shall we conveniently forget that rust gets compiled for eternity? Also make rust icon bigger.
I've made tools that prevents running `rm /tmp` etc and runs $0.unsafe if args are not sus, it takes ~10 times more space than core-utils' rm. And it's lucky day if you try to make something with bevy and endup without wasting many gigabytes.
fixing legacy python scripts is hell because you spend more time waiting for pip install than actually coding. meanwhile rust devs brag about their borrow checker saving them from segfaults while i stare at a yaml indentation error for three hours. shit world we live in where runtime errors are preferred over compile-time anxiety. i just want my code to run fast enough to close my laptop before battery dies
I one wrote a Rust project which called a Python server and I had a variable called PYTHON_SKILL_ISSUE_DELAY, because otherwise python could just not keep up
The python server was part of the project and running on the same machine without rate limiting, but the rust program called it twice in a row, which it couldn't handle
This is a brain dead take by people. Python can call C libraries or Rust libraries anytime. It more easily integrates with custom kernals (CUDA). OP is the slow one IMO.
Do hard compute tasks using the right libraries, or use your own well written libraries and you can get all the performance you want in python. It's also 10x more readable.
Oh, and the compiler writes all the real code anyway...
I'm going to push back on this and say that high-performance Python is totally possible. There's Cython which is super fast and if it's numerical code, you can use numba.
And obviously Python has very good C-interop. Rust has interop too, but it doesn't place nicely with the the borrow checker.
I have written pure python libraries that use numba for JIT compilation that have been performance comparable to C++ and Rust libraries for the same task. It is certainly quite possible. Sure one might be able to wring out a little extra performance with a compiled language, but not very much, and likely with quite a lot of effort.
615
u/ProgramBrave718 12h ago
Python after saying it's name to Rust - "I am known for machine learning. But, devlopers call me slow"
313
u/Cxvvtgupvvdi 12h ago •
from shitWrittenInC Import callHyperoptimizedMethod
530
u/YamroZ 9h ago edited 5h ago
The Python script was ready week ago, took 5 minutes. Rust programmer first took 3 days to tell EVERYONE how much better it will be in Rust, then started coding and got bogged down for 2 days in a forum discussion on how to best secure memory for a "hello world!" string.
2.4k
u/Memorius 12h ago
Comparing a language that gets compiled into native machine code to a language that typically compiles to and interprets byte code at runtime. Is there a point to this meme?
160
u/Percolator2020 12h ago
This wasn’t even funny when it was an IE joke.
133
u/IAmASquidInSpace 12h ago
Haha, Python slow, comedy genius! Never heard that before! So original! Haha!
56
u/deanominecraft 12h ago
more accurately python would spend 2 panels asking its friend C to answer the question for it.
16
u/MiloBem 8h ago
Python is slow but that's not a problem for a scripting language which is used for data pipelines, prototyping, and teaching coding basics to high schoolers. No one sane is using it where performance matters, like microservices. Oh, wait.
7
u/cicciograna 6h ago
I remember when the butt of this joke was Internet Explorer.
21
u/JockstrapCummies 11h ago
If you factor in the cargo build time of compiling 200 crates down the dependency chain, Rust will probably start speaking only after Python has said hello and goodbye.
22
u/JAXxXTheRipper 10h ago
If you don't have a time-sensitive project, this doesn't matter in the slightest. Speed is rarely the deciding factor.
I'd rather work on a python project than on rust tbh. Rusts syntax is just ew
18
u/RhuanPacheco 9h ago
Why are you crying so much over Python memes? When a JS meme gets posted for the millionth time, there isn't nearly as much complaining...
12
u/Educational-System48 10h ago
I've never had a problem where the bottleneck was Python being slow.
12
u/lostUd_ 7h ago
as someone who finds programming to be incredibly boring and will avoid computer science by all means necessary, I find this sub pretty funny
12
u/HikariAnti 6h ago
This meme is actually pretty accurate because Rust programmers will tell you that they are Rust programmers without you ever asking.
26
u/R15H1_3 12h ago
Bro hadn't even finished importing the libraries yet.
3
u/Unlucky-Durian-2336 9h ago
I still remember "knock knock" Java joke from years ago.
3
u/Lowmax2 4h ago
Python can be lightning fast when you use the right libraries. Obviously it's written in c++ or something on the back end, but it's still python being written by the end user.
10
u/steadyfan 11h ago
Comparing the speed of a dynamic interpreted language to a static one that compiled machine code.. Let's next make a joke about how much faster a car is that a horse.
16
u/Dhruv_Malaviya 12h ago
Python was still importing the conversation
5
u/RedAndBlack1832 5h ago
Me when scripting language used for scripting and rapid development:
it doesn't need to be fast, and when you want something done fast, you call into a C/C++ library
6
u/irishcoughy 2h ago
ITT people who write code for a living or as a hobby seemingly unable to grasp that programming languages have use-cases and are rarely if ever universally applicable.
2
u/RED1869 4h ago
Python still being there when Rust is long gone
2
u/heckingcomputernerd 4h ago
If you account for compilation time, you can swap rust and python in this meme lmfao
2
u/Buyer_North 3h ago
same as C++ with Rust
2
u/Trang0ul 44m ago
- Knock, knock!
- Who's there?
- ...
- ...
- Python!
- Knock, knock!
- Who's there?
- C++ !
- Knock, knock! Assembly!
5
u/tigrankh08 10h ago
piton bad 😡
peak r/ProgrammerHumor
3
u/liggamadig 6h ago
Well, the computer's time is cheaper than mine so I'll continue using Python.
3
u/SrWloczykij 6h ago
The world was a much better place when Rust bros were still hiding in their cellars.
4
u/StarLan7 11h ago
Is this still funny?
3
u/not_perfect_yet 5h ago
This is inaccurate, Rust should be unreadable. ;)
3
u/Koltaia30 10h ago
Reality: Reverse roles. Python goes: "How rude". Rust: "Compilation failed: you tried to store a returned reference or something"
2
u/Sirico 7h ago
We need this tool by Friday...
2
u/TactfulOG 2h ago
r/programmerhumor try not to compare different use case languages for 1 fucking day impossible edition
2
u/alliewya 5h ago
Claude, rewrite this meme in rust, make no mistakes
2
u/danfay222 5h ago
Python is only really slow if you have no idea how to use it. Sure it’s never going to beat compiled lower level languages like rust or cpp, but if you use and build proper libraries for your application in python it’s often a lot closer in performance than most people think
1
u/Anthonyg5005 10h ago
I haven't seen this image in years
1
u/Fancyness 7h ago
made me chuckle
1
u/SenorX000 7h ago
1
u/Relevant_Research_98 4h ago
Shall we conveniently forget that rust gets compiled for eternity? Also make rust icon bigger.
I've made tools that prevents running `rm /tmp` etc and runs $0.unsafe if args are not sus, it takes ~10 times more space than core-utils' rm.
And it's lucky day if you try to make something with bevy and endup without wasting many gigabytes.
1
u/knowits 3h ago
fixing legacy python scripts is hell because you spend more time waiting for pip install than actually coding. meanwhile rust devs brag about their borrow checker saving them from segfaults while i stare at a yaml indentation error for three hours. shit world we live in where runtime errors are preferred over compile-time anxiety. i just want my code to run fast enough to close my laptop before battery dies
1
u/Understanding-Fair 3h ago
I've met both these people IRL
1
u/jakechance 2h ago
Something was said, not good! https://youtu.be/MzkWyhzwO1Q
1
u/Ok_Actuary8 2h ago
FUCK YOU TONY!
1
u/throwawayaccountau 2h ago
Now do it with Chinese Python.
1
u/HaDeS_Monsta 11h ago edited 9h ago
I one wrote a Rust project which called a Python server and I had a variable called PYTHON_SKILL_ISSUE_DELAY, because otherwise python could just not keep up
1
u/AngusAlThor 11h ago
Ridiculous... Python would take several hundred panels to respond.
1
u/ouijiboard 10h ago
The Ol' internet explorer meme. How you've changed.
1
u/Krustenbaecker 9h ago
I read with 1Hz temperature sensors and store them. No reason to do this faster.
1
u/Successful_Noise_347 8h ago
Python is not slow. It is just waiting for the C library underneath to finish.
1
u/Dry-Refuse-8132 6h ago edited 6h ago
This is a brain dead take by people. Python can call C libraries or Rust libraries anytime. It more easily integrates with custom kernals (CUDA). OP is the slow one IMO.
Do hard compute tasks using the right libraries, or use your own well written libraries and you can get all the performance you want in python. It's also 10x more readable.
Oh, and the compiler writes all the real code anyway...
1
u/Alternative_Act_6548 5h ago
not a rust fan, but that is funny
1
u/kiochikaeke 5h ago
It's been 0 hours since the last "python is slow/python is just calling C"!
The record is 0 hours!
1
u/SLOOT_APOCALYPSE 3h ago
..............J A V A has........... (Minutes go by) Updated..... Successfully
1
u/zyxzevn 3h ago
It is the reverse. Rust will still be compiling....
0
u/bw_mutley 11h ago
It is 2026, GTA 6 just launched, and we are still arguing for PL war.
0
u/Own_Recommendation49 6h ago
The amount of salty people who are python shills is hilarious
0
u/hraath 5h ago
Not shown: rust showing up and python staring at it wonders what it's doing for an hour type checking and compiling
-1
u/pstwndnd 10h ago
Python is the Internet Explorer of programming languages.
-1
u/an_alex_at_a_time 9h ago
Every conversation with women that I've matched online aka bots went the same way lol
-1
u/slaymaker1907 8h ago
I'm going to push back on this and say that high-performance Python is totally possible. There's Cython which is super fast and if it's numerical code, you can use numba.
And obviously Python has very good C-interop. Rust has interop too, but it doesn't place nicely with the the borrow checker.