I think a language that's simultaneously productive at this two extremes is impossible, but it was their goal.
[1] https://developers.slashdot.org/story/17/01/23/085232/slashd...
“In short, I would NOT say that Swift is an extremely compelling systems programming or scripting language today, but it does aspire to be great for this in the years ahead.”
Jan 2017
I can see it as a backend/systems language. It is not a scripting language.
The issue is the stewardship of the ecosystem.
The fact the Foundation library is closed source is a complete joke in this day and age.
Apple’s lack of effort towards fostering a broader community for its language is a comedy of errors.
A Swift developer will spend much time dealing with undocumented closed source packages.
It’s almost comedic how retro it is. It’s like coding in the 1980s.
Foundation is open source https://github.com/apple/swift-corelibs-foundation
> Our primary goal is to achieve implementation parity with Foundation on Apple platforms. This will help to enable the overall Swift goal of portability.
The Apple versions of foundation have to be compatible with the Foundation/CoreFoundation equivalents. They also have more than a decade of binary compat to maintain
And Foundation itself isn't written in Swift, a good portion is written in C.
> A significant portion of the implementation of Foundation on Apple platforms is provided by another framework called CoreFoundation (a.k.a. CF). CF is written primarily in C and is very portable. Therefore we have chosen to use it for the internal implementation of Swift Foundation where possible. As CF is present on all platforms, we can use it to provide a common implementation everywhere.
https://github.com/apple/swift-corelibs-foundation/blob/main...
Swift needs some work to get there. There are a huge number of gaping holes, but these would be a start:
- scripting: a native RegEx literal type
- systems: replace Codable with something easier to use/more performant
- systems: better logging interface
Edit: formatting
On the other hand, the Smalltalk model would not have worked for SwiftUI. It really feels like Apple has bet the farm on the next generation of libraries/frameworks.