r/ProgrammerHumor • • Aug 26 '20

Python goes brrrr

Post image
59.2k Upvotes

789 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Aug 26 '20

Semantically, you are correct. However, if you go and read the V8 (or really, any performant implementation) source code, there is a separate integer type. Why? So that the JIT compiler can compile parts of the code to use integer arithmetic instead of floating point. Because it's just that much faster.

1

u/maweki Aug 26 '20

Yeah. We're not talking about an implementation detail of some VM or interpreter though. We're questioning whether some operator defined in the languages spec behaves as expected given the typing rules from the language spec.

And as you point out correctly, the semantics of the language should not depend on the implementation.