Claim: cross platform experience for Swift has become quite good

This is just a (mostly) positive remark ("my two cents") mainly targeting those who once tried to use Swift on Linux or Windows or were missing an IDE on those platforms. Maybe they would like to try again...

I have the impression that the cross platform experience for Swift has become quite good overall. I am successfully compiling Swift and deploying Swift code on Linux and Windows. The Swift Package Manager in particular has been working really well on Windows for some time now. For writing code on Linux or Windows, we have the following possibilities (sorry if I missed another solution):

(The first solution is free, the other is not free.)

And yes, not everything is perfect. Apple being the "Benevolent Dictator" of Swift (borrowing a term from Python) is two sides of the same coin:

  • On the one hand, Apple ensures that tremendous work is being done on Swift, as Swift is so important for Apple's systems.

  • On the other hand, and despite Swift being open sourced, Apple makes the final decision in many cases or is developing some new stuff in private first (I hope I am not too crude with this observation). And other platforms than Apple's might not have the same importance for Apple (and I know, there is a lot of work to be done).

So there might still be some issues when using Swift on non-Apple platforms (e.g. not all of Foundation is supported outside of Apple's platforms), but I have the impression that the Apple forks are taking the cross-platform task seriously (take e.g. this post by Ted Kremenek). It should also help that Apple is using Swift in many places now (including servers, I would guess that those are still mainly Linux servers), and many frameworks are not wrappers around Objective-C frameworks any more, including Foundation if I understand it correctly (see this excellent interview with Ben Cohen, especially at the end).

...And yes, maybe the cross-platform idea should be taken even more seriously (???), e.g. the Windows port is still "attributed" to @compnerd – kudos to @compnerd for the good work he is (and hopefully will be) doing, but maybe it is time for the Swift project to be committed to the Windows port "no ifs and buts"? ... As I said, only my two cents.

15 Likes

don’t forget Atom with atomic-blonde!

1 Like

Please note this new blog entry on swift.org by @adam-fowler about the excellent Visual Studio Code extension.

1 Like

Swift on Linux: I completely agree!

Being able to link in the standard library statically (while making the final file size much bigger) has been really helpful in shipping production system services and CLI tools. Dynamic standard libraries are great in theory, but until we have ABI stability on non-Apple platforms with Swift they have no business being used in a production environment except in certain edge cases where you might ship two executables that both link against the standard library.

Swift on Windows: So many things are "broken" right now (Swift 5.7 release version).

You can't link anything statically at least with the current SPM build tools. Using structured concurrency is ill-advised until some fixes are in place, REPL is broken. There are no official recommendations for how to actually distribute an executable on this platform. @compnerd has done brilliant work, but this is entirely a hobby endeavor for them, and Swift on Windows really just needs full-time people at Apple working on this. Imagine how ubiquitous Swift could be if it truly had first-class Windows support. We must bring this beautiful language to the masses!

2 Likes

Static linking as well the REPL are (for me) not the main points on Windows, they might take some more time which is OK for me if else the Windows distribution is in fine shape.

Also not always perfect.

Distribution on Windows (besides static linking) is not a problem. Update: See how this currently looks.

Apple should help with some difficult prerequisites like missing optimisations in LLVM. For more, I think Apple would have to see a clear advantage for them with Swift on Windows.

The problem still remains: there is no official recommendation or obvious way to ship a Windows executable to an end user.

This is only a matter of bringing the information onto the Swift website. Then it is "official". There is a Swift Website Workgroup which is discussing about its content.

1 Like

Update: CLion is not an option any more (“With the 2022.3 release, we’re sunsetting the AppCode IDE and the Swift plugin for CLion”).