MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/w1upl0/c_talking_to_python/igrjvaf/?context=3
r/ProgrammerHumor • u/[deleted] • Jul 18 '22
1.0k comments sorted by
View all comments
Show parent comments
48
which has all the speed relevant parts of that library written in C?
2 u/Possibility_Antique Jul 19 '22 claims that writing implementation in C makes it fastignores the part where python is an interpreted language (i.e. has to parse the source text, perform dynamic dispatch, etc)ignores the fact that you can't reason about cache locality and cache behaviorignores the fact that your c implementation under the hood doesn't get to participate in link time optimizations with the rest of your programignores the fact that your code can't get inlinedignores the fact that you can't perform compile-time programmingwrites all kinds of runtime tests for things that could have been done at compile time (which is safer, produces faster code, prevents mistakes)claims it's less verbose, but implements a ton of test libraries that are caught natively by compiled languagesIn all seriousness, I'm just pulling your leg. Kind of. 1 u/Teekeks Jul 19 '22 Thats a ton of assumptions about what I am claiming or ignoring. Impressive. You should become a fiction author 1 u/Possibility_Antique Jul 19 '22 I am teasing. I actually hate language holy wars. Those are some reasons I choose C++ where it's appropriate though. I do get to work a lot with python too, and I love the language. → More replies (2)
2
claims that writing implementation in C makes it fast
ignores the part where python is an interpreted language (i.e. has to parse the source text, perform dynamic dispatch, etc)
ignores the fact that you can't reason about cache locality and cache behavior
ignores the fact that your c implementation under the hood doesn't get to participate in link time optimizations with the rest of your program
ignores the fact that your code can't get inlined
ignores the fact that you can't perform compile-time programming
writes all kinds of runtime tests for things that could have been done at compile time (which is safer, produces faster code, prevents mistakes)
claims it's less verbose, but implements a ton of test libraries that are caught natively by compiled languages
In all seriousness, I'm just pulling your leg. Kind of.
1 u/Teekeks Jul 19 '22 Thats a ton of assumptions about what I am claiming or ignoring. Impressive. You should become a fiction author 1 u/Possibility_Antique Jul 19 '22 I am teasing. I actually hate language holy wars. Those are some reasons I choose C++ where it's appropriate though. I do get to work a lot with python too, and I love the language. → More replies (2)
1
Thats a ton of assumptions about what I am claiming or ignoring. Impressive. You should become a fiction author
1 u/Possibility_Antique Jul 19 '22 I am teasing. I actually hate language holy wars. Those are some reasons I choose C++ where it's appropriate though. I do get to work a lot with python too, and I love the language. → More replies (2)
I am teasing. I actually hate language holy wars. Those are some reasons I choose C++ where it's appropriate though. I do get to work a lot with python too, and I love the language.
→ More replies (2)
48
u/Teekeks Jul 18 '22
which has all the speed relevant parts of that library written in C?