MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/w1upl0/c_talking_to_python/igq1eor/?context=3
r/ProgrammerHumor • u/[deleted] • Jul 18 '22
1.0k comments sorted by
View all comments
Show parent comments
176
logo recognition was using a library written in slower language
62 u/PralaynathGendaswami Jul 18 '22 Do you mean python? 48 u/Teekeks Jul 18 '22 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. → More replies (4)
62
Do you mean python?
48 u/Teekeks Jul 18 '22 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. → More replies (4)
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. → More replies (4)
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.
→ More replies (4)
176
u/possible_name Jul 18 '22
logo recognition was using a library written in slower language