Computer Things

  Back to the email

For every spec, there is a set of possible programs that satisfy that spec.

Then what's not a spec? ;)

Maybe a C program? But gcc -O0, gcc -O1, gcc -O2, and gcc -O3 will all produce different machine code for the same input "program". And not all of those resulting programs might satisfy the author of the original program (or should I say "spec"?), in particular, due to performance, but maybe other characteristics. So, one C program corresponds to a set of "actual programs", not all equally desirable. Thus, it's a spec.

Then you might say that the machine code is surely a program. Only the same x86(_64 or not) or ARM machine code gets translated by a processor to some microoperations, and different processors implementing the same machine code have different microarchitectures. And we have software emulation and binary translation (AOT and JIT), which produce different "real programs" with different properties for the same list of machine instructions. Thus, a "machine program" is actually a spec, which describes a set of possible "real programs" that can implement it.

And the same goes for transistors implementing a particular microarchitecture. I have no idea at what point this descent stops. If ever. :)