When writing code, each file containing a compilation unit or interpreted code will be able to be compiled or interpreted on all target systems. For example, main.cpp will work will all supported compilers on all operating systems and will contain internal logic for optimizing to the individual targets; there will be no main_win32.cpp or main_arm64.cpp. Similarly, if interpreted code is optimized to a target, appropriate control flow will exist such that the interpreter does not run code for a different target than the host.

If a particular target is known to not be supported, that should be documented and control flow should run to a failure point when compiling or interpreting for that target.

This ensures 2 things:

  1. That all logic contained in a file is visible from that file and readers of the code do not need to hunt down operational logic for each system of interest.
  2. That when cross-compiling, all files available are all files that are needed.

Following this convention imposes a penalty for lengthy optimizations. For the most part, this is intentional. Core logic should be conserved across targets as much as possible with only minimal deviations afforded to specific systems.