Pitch: System in the toolchain

My team writes a lot of multi-platform tools and for a while we adopted a policy of "just import SystemPackage everywhere" to simplify our code. That worked well until swift-subprocess came along and we wanted to use it as well, because it does the "use System on Apple, otherwise SystemPackage" dance and then we needed to make sure all of our FilePath usage came from the matching module.

So having this fundamental module be included with the toolchain is the right choice to me. It also leads me to wonder if other packages like swift-collections will see a similar outcome eventually (I know that Foundation uses it internally, so I guess it would only matter if Foundation wanted to vend APIs that used those collections). I feel like this is a good direction to go in general while avoiding growing a massive standard library since a lot of folks pitch something and say "it should be in the standard library" when they really just want "it should be easy to access out of the box".

The one drawback, of course, is having new features being locked behind new OS releases on Apple platforms. I know that vendor-specific releases and back-deployment are outside the scope of Swift Evolution, but if swift-system is added to the toolchain I hope efforts would be made to back-deploy as much as is feasible for those of us who still need to support OSes a few releases back.

18 Likes