The ~/Library
folder and invisible files in the user's home directory have both been a part of the Mac since the original version of Mac OS X (and earlier in OpenStep).
So there’s a long tradition on the platform for Mac apps to use ~/Library
and for command-line tools to use invisible files. In a sense, this lets Mac-centric apps be Mac-like and lets Unix-centric / command-line tools be Unix-like.
One of the goals of Swift is to be available on many platforms, not specifically tied to macOS, with this goal reaffirmed as part of the focus of Swift 6:
Swift scripting seems to be very much in the category of command-line / Unix-style usage which fits better with the established convention of hidden files, with the added benefit that it works in a way familiar to many platforms, including macOS.
I definitely understand wanting to do things in a manner that suits the platform, but in this case it seems like the proposal is following how macOS has done things since its inception.
EDITED to add formatting