Now wipe away the collective trauma we have working with XCode on Mac with it's tooling and people might consider Swift for other uses.
Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
It's not just the compiler. It's all the libraries.
The inverse is true as well for Kotlin being supported on iOS.
Finally!
And it can fuck right off.
What's your problem with it? I read parts of the documentation and it seemed like a very elegant language combining good features from many other languages.
This is true for basically every language though. If you read the documentation for c++ it doesn't sound like the work of the devil. You only learn that after you start.
Swift is a modern language that offers good performance paired with a lot of safety features you’d otherwise go to Rust for (type safety, memory safety, concurrency safety,… although memory safety based on ARC is slower than Rust’s approach, and Swift makes it easier to disable safety features). Personally I like it more than Rust because the syntax is a bit cleaner and it has exceptions.
The problem is, using it on e.g. Linux is a completely different experience from using it on Apple platforms and it doesn’t really transfer over. Apple devs will use Xcode and all the Apple tooling and will get used to Apple APIs. On Linux you don’t have Xcode, you rely more on Swift Package Manager for dependencies than on Apple platforms, you suddenly have to learn what part of the libraries you’ve been using are Swift standard library and what parts are Apple only or are from the Objective C runtime that’s not used on Linux, and the ecosystem is much smaller.
A lot of things that also mean that code written for Apple doesn’t often work on Linux unchanged, not because of Swift as such, but e.g. before Swift had Regex you’d use the one from Objective C, which just works on Apple, but isn’t there on Linux.
I haven’t tried it for Android development but I imagine it’ll have similar issues.
I mean, this sounds like less of a headache then my latest attempt to setup rust in native windows (hello linker errors).
That being said, "the tool chain is a pain in the ass to setup" is a real problem IMO. MSVC makes me want to jump out the window every time I'm forced to use it at work.
If you're going to cause me more of a headache then go/python/zig to setup (which is basically none) I'm very quickly going to look for an excuse to stop using you.
For rust the cross compilation may be useful, if you need a windows binary but can write te program in Linux.
So again what’s the problem with swift?