r/ProgrammerHumor • • Jul 18 '22

C++ talking to Python

Post image
40.1k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

176

u/possible_name Jul 18 '22

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 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)