News for hackers. Stuff that matters.
Re:Swift is a more convenient Rust by arghwhat on Friday September 06, 2024 @06:09AM (#41464640)
Not to praise Swift, but Swift and Xcode are unrelated projects. Saying that Swift is inconvenient because of Xcode issues is like saying C++/C# is inconvenient because of Visual Studio.

You can install Swift on Linux if you want and code away, just like with Rust - but as it hasn't really caught on for anything other than building apps for the Apple ecosystem, it's not a particularly normal thing to do.

Re:Swift is a more convenient Rust by x3ro on Friday September 06, 2024 @06:17AM (#41464687)
The defacto standard matters. The vast majority of Swift programmers will be using Xcode, and I definitely immediately think of the pains I've had with Xcode when I hear Swift. For example, I don't know of any other good IDE environment for Swift, though maybe there is one.

You could also argue that e.g. Rust is not cargo, but almost every Rust programmer will be using cargo. Sure I could use something else, but why would I? Of course the analogy is not perfect, because the "why would I?" is clear for Xcode: it's bad and macOS only :D

All I'm trying to say is: defaults matter. Most people will not be writing Swift in VS Code (on macOS).

Re:Swift is a more convenient Rust by nelup20 on Friday September 06, 2024 @07:47AM (#41465260)
Yep, I've only started using Swift a couple of months ago, but Xcode just isn't pleasant to use imo (though I'm probably spoiled by Jetbrains' IDEs), and the Swift extension for VS Code is clunky.

I'm still really sad Jetbrains decided to sunset AppCode :(

So the quality of tooling/IDEs is definitely a factor, I just don't see myself using Swift outside of the Apple ecosystem when there are so many other alternatives.

Re:Swift is a more convenient Rust by arghwhat on Friday September 06, 2024 @07:34AM (#41465166)
You don't use Xcode to write Swift, you use Xcode to write Apple apps which you happen to do in Swift. No matter the language, you need Xcode to write those apps.

Equalling Xcode and Cargo makes no sense. A similar situation to Xcode and Swift would be like Visual Studio and C# on Windows. Many developers use these tools, but they are not the language ecosystem, and the Cargo equivalents are entirely separate (Nuget, Cocoapods).

Re:Swift is a more convenient Rust by eptcyka on Monday September 09, 2024 @06:49AM (#41487190)
If you argue about nomenclature, yes, Xcode and cargo fit into entirely different categories. However, they are still comparable you can't feasibly escape either to develop Swift or Rust apps the way most people develop them.
Re:Swift is a more convenient Rust by yunohn on Friday September 06, 2024 @06:14AM (#41464665)
I’m pretty sure you need Xcode to compile Swift on macOS.
Re:Swift is a more convenient Rust by robjwells on Friday September 06, 2024 @06:21AM (#41464711)
You can install a Swift toolchain on macOS without Xcode, but Xcode is the “blessed” route and listed first on the swift.org getting started instructions. https://www.swift.org/install/macos

However, it can be a bumpy ride. For example: “swift test” (via the CLI) doesn’t work if Xcode is not installed. https://github.com/swiftlang/swift-package-manager/issues/43...

I would just emphasise that the OP was about _convenience_ and Swift-without-Xcode on macOS is not smooth sailing.

Re:Swift is a more convenient Rust by latexr on Friday September 06, 2024 @07:20AM (#41465073)
Everyone who has installed Homebrew has the official CLI Developer Tools (Homebrew installs them for you), and everyone who has those has a way to compile Swift.

Even if you don’t have Homebrew, the first time you try to run `swift` in a Terminal you’ll get a GUI prompt which lets you install the Developer Tools in two clicks.

Or you can run `xcode-select --install` (comes preinstalled, no Xcode needed).

Re:Swift is a more convenient Rust by acar_rag on Friday September 06, 2024 @06:18AM (#41464696)
Absolutely not, you just need to use swiftc: https://theswiftdev.com/the-swift-compiler-for-beginners/