How Data Becomes Work
Architecture and Compatibility
You download an application and your computer refuses to run it. There is plenty of memory. The drive is half empty. Nothing looks wrong, but something is: the program was built for a different kind of CPU.
Not every CPU speaks the same language
You already know that a CPU carries out machine instructions. What nobody has mentioned yet is that there is no single set of them. Different families of CPU understand different instructions, and a program built for one family is gibberish to another.
Two families dominate current desktop, laptop, and phone
An app built from x86-64 instructions will not run directly on an ARM64 CPU. This is not a speed problem. The CPU does not understand those instructions without another layer translating them.
The architecture name alone does not tell you how fast a computer is. Both families appear in laptops and servers; ARM-based processors are also common in phones. For compatibility, the question is which instructions the program needs and which ones the CPU understands.
What you can do about it
Two things, really.
Get the right build. Native applications are usually built separately for each architecture, and the download page picks the right one for you, often without mentioning it. When it guesses wrong, or offers you a choice you did not expect, this is what it is asking about.
Run it through a layer that stands in the gap. Some systems can run software built for the other architecture by translating the instructions as they go. Apple did this when its computers moved from x86-64 to ARM64. It works well, and it is doing real extra work that a matching build would not need.
An app built for x86-64 will not start on an ARM64 laptop. What would actually help?
Where this leaves Python
A matching architecture is not the only thing software needs. It also expects a particular
An ordinary .py source file holds no native machine instructions, so the source itself is not built for x86-64 or ARM64. What has to fit your machine is the Python implementation. Any native extensions and system dependencies it uses must fit too.
That is the useful sense in which Python source is portable. A plain source file can often travel unchanged because compatible Python implementations have already been built for each supported operating system and architecture.
You wrote a plain Python file with no extra dependencies on an x86-64 desktop and email it to a friend with an ARM64 laptop. What do they need?
Every layer in this chapter has assumed something was arranging the whole thing: handing programs to the CPU, keeping them apart, deciding what runs next. Time to meet it.