Now you can write import Foundation
, and if you do not happen to use details of the old Foundation where the implementation differs, you can compile a simple program as-is and it runs on Mac, Linux, and Windows. And because currently some details of the implementation differ, you want to have the new Foundation so that a failing of the compilation or a different behaviour does not happen (where it is not expected for some other, more explicit reason).
If you then use something like import NewFoundation
(or an import of a part of it) on macOS, this will not compile on Linux or Windows because the new Foundation is then not a part of the toolchain and has to be included as a package. So a very simple program “from the book” will compile on macOS, but will not compile on Linux or on Windows.
You then will have to choose explicitly that your little simple program should be cross-platform, so you include the new Foundation as a package, what is kind of silly for running it on macOS, because there the new Foundation is part of the system. So you start using conditional imports and conditional uses of packages. This is very fun for a beginner I guess…
Simple command-line programs that do not anything platform-specific should work in a simple manner on all supported platforms. And there should be some way to have “control” over the versions of the new Foundation that you address (whatever that actually means).