I am really only familiar with Python, in which I’m pretty sure that the .py becomes .pyc and then CPython translates .pyc into machine instructions.
How does this differ? Is an IR the same idea as Python’s .pyc?
strictly speaking bytecode isn't IR because typically it's not further transformed - IRs are designed to be further transformed. as with all things these aren't hard and fast rules (plenty of compilers run transformations on bytecode, and there are plenty of interpreters for some IRs).
> and then CPython translates .pyc into machine instructions.
What do you mean? CPython is a bytecode compiler and a virtual machine interpreting that bytecode. Or are you talking about the new experimental JIT?