Sure, there are people who want to tinker with it for fun, but outside of that what is the point in having Swift on Linux and Windows?
You can't use it to build mac or iOS apps on Linux because the important libraries aren't there. There is no cross platform UI and Apple isn't likely to port and support theirs from macOS. If you are into servers then you have plenty of better languages options with established ecosystems. Maybe there are some command line apps on macOS which can now be ported to Linux/Window, but beyond that, what is the point? Where is Apple trying to go with this?
It's a fully fledged programming language. An open-source programming language, at that, with a lot of community input and involvement.
Not a macOS or iOS app creation DSL.
It's also quite pleasant to use, and has already seen a few uses beyond macOS and iOS apps, including some backend development (Vapor, Kitura, SwiftNIO, probably others).
So you could use it to write command line tools. To write Linux or Windows apps. Or to write servers. Just like any other programming language.
Personally I have some significant experience with maybe 5 different languages, which is already more diverse than the average software dev as far as I know. But I still wouldn't be comfortable to judge something like this.
For instance, I haven't worked with Swift, but I find it hard to believe it's much better than, say, C#, Scala, or Typescript, regarding those metrics. Do you have experience in those languages?
It's subjective, naturally. I don't know if I'd be that enthusiastic, but I definitely like it a lot.
My main languages are Python and C++. I've also used Java, C#, Javascript but not Typescript, among others.
In my opinion Swift does a pretty good job at striking a balance between expressiveness/usability, safety and performance. If it gets more traction under Linux (including a larger ecosystem and better tooling around it) I'd definitely consider it for projects where Python could become a bottleneck but C++-level performance is not absolutely required.
On the other hand, other languages in a similar niche - Rust, Go, even D or Nim? are already more established outside of iOS/MacOS, so I don't know. My experience with Swift has definitely made me more interested in learning Rust, which seems quite similar in some respects.
Sounds like you describe the state of Swift at least three years ago. SourceKit just doesn't crash anymore on me anymore, ever. Compile times are quite good for me nowadays, still not as fast as Objective-C but then again you don't get compile time guarantees for free.
The exponential issue was still there in version 4 and I think 5 as well. Didn't say SourceKit crashed, but it was virtually useless because it functioned like a crap version of the language parser.
So what's particularly hard on the compiler are hard coded sets of data that have mixed types. For example a dictionary that reflects a JSON response that also has nested dictionaries.
It helps if you test declare it like:
let json: [String: Any] = [ /** lots of fields here */ ]
String concatenation: could you give me a specific piece of code that fails? It could be that I really never write code that triggers the problem. Using the + operator to concatenate strings has some performance issues though.
I'm not telling you're crazy, I just noticed that things got so much faster in the past two years.
The string concatenation issue was that if you do a ++ b ++ c... When that got to about 6 variables that single line alone took a minute to compile. Go to 10 variables and just give up on ever seeing a result. I used to try it in online Swift REPLs and it was still happening with whatever was most recent a bit over a year ago.
I use it for all kinds of things, like computer graphics and various tools in my CLI-driven workflows.
I find it nice to work with, because it has a lot of the nice features Rust does, like affine types, 1st class optional handling, decent single-threaded safety guarantees, and it has a very nice, ergonomic interface. Generally the performance characteristics are not what you would get with Rust, but I am generally more productive in Swift because I don't have to worry about the low level details.
There's definitely some downsides - cross platform support being one of them - but if I'm just working on a tool for me myself to use, I will generally reach for Swift because it's pleasant to work with. I would be happy if I could use it for projects which need to be deployed across different platforms.
This is basic foundation building. It's true there aren't too many good use-cases for Swift on Windows or Linux now. But that can't really start to change until Swift has decent support for Windows and Linux.
Of course, it will take a lot more than this for Swift to catch on outside of its home territory. This is just one necessary step.
More broadly, I think we're still in the middle of the language wars, where the limitations of the historically dominant languages (like C, C++, Java, Javascript) have created openings for one or more newer languages. I think Apple and other Swift proponents would like Swift to become one of those newer established languages and take steps like these to at least keep it in the running.
They’re looking to build demand over time by making Swift available in as many places as possible.
And this is the Swift Open Source team, not Apple specifically. It’s not an Apple business decision (aside from lowering the learning hurdle for new iOS projects)
They provide some sources, but they are not complete and are more to look at than to use.
I figure this got through the approval process because it could plausibly get developers to pay attention to apple without letting others exit the apple ecosystem.
Apple has to ensure that Swift is adopted as widely as possible to ensure that enough people in the world are theoretically able to submit apps to their store.
Sure, there are people who want to tinker with it for fun, but outside of that what is the point in having Swift on Linux and Windows?
You can't use it to build mac or iOS apps on Linux because the important libraries aren't there. There is no cross platform UI and Apple isn't likely to port and support theirs from macOS. If you are into servers then you have plenty of better languages options with established ecosystems. Maybe there are some command line apps on macOS which can now be ported to Linux/Window, but beyond that, what is the point? Where is Apple trying to go with this?