702
Python! (lemmy.ml)
submitted 3 days ago by tfm@europe.pub to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] HiddenLayer555@lemmy.ml 26 points 3 days ago

Python's core implementation is in C though. It's just a fancy way to call C libraries.

[-] whimsy@lemmy.zip 33 points 3 days ago

You could say this about a lot of things...

[-] RvTV95XBeo@sh.itjust.works 1 points 2 days ago

Pizza's core implementation is in C though. It's just a fancy way to call C libraries.

Today I learned pepperoni is a C library.

[-] ddplf@szmer.info 12 points 3 days ago

I code in JS, so I'm something of a C dev myself!

[-] Natanox@discuss.tchncs.de 9 points 3 days ago

Beginning your sentence with "I code in JS" really makes any follow-up statement sound sane in comparison.

[-] noddy@beehaw.org 3 points 2 days ago

Aschhually the most used JS engine is made in C++ (v8)

[-] MoonMelon@lemmy.ml 3 points 2 days ago

Python is actually pretty baller with string operations too since so much of the C has been heavily optimized.

[-] vrighter@discuss.tchncs.de 1 points 3 days ago
[-] Saleh@feddit.org 6 points 3 days ago

It might not be a language but a skill issue if your python code performs significantly worse than your C code

[-] thebestaquaman@lemmy.world 3 points 1 day ago

That completely depends on what you're doing. If you're doing tasks that python can completely offload to some highly optimised library written in C/C++/Fortran, then yes. However at that point you're not really comparing Python to C anymore, but rather your C implementation to whatever library you used.

A fair comparison is to compare pure python to pure C, in which case you need to mess up the C-code pretty bad if Python is to stand a chance.

[-] Ephera@lemmy.ml 1 points 1 day ago

I do think, it's fair to use Python code which uses C under the hood in benchmarks, because it does often match reality. But then it also has to be realistic code. If it's just a single line of Python code, which calls into C and then everything happens there, then there is really no point for you to use Python.

Python only makes sense to use, if you do write some amount of glue code with it. And then it does require significantly more skill to write performant code than it does with many other languages, as lots of costly abstractions are hidden from you. And it often also requires more effort, since you might not find performant libraries, since so much of the ecosystem only has performance as an afterthought. Reality is messy, which is why realistic Python code still tends to do terribly in benchmarks, whether it calls into C or not.

[-] thebestaquaman@lemmy.world 2 points 1 day ago* (last edited 1 day ago)

100 % agree here. If you're testing an actual use-case, it's fair to compare realistic python to realistic C. However, I would argue that at that point you're no longer benchmarking Python vs. C as languages, but Python vs. C for that particular use-case.

this post was submitted on 07 Aug 2025
702 points (97.8% liked)

Programmer Humor

37681 readers
402 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS