News for hackers. Stuff that matters.
Re:Swift is a more convenient Rust by robjwells on Friday September 06, 2024 @06:05AM (#41464620)
One way that Swift is certainly not more convenient than Rust is the tooling. I use a 2018 MacBook Air, using macOS 12, which is now unsupported by Xcode. Meanwhile SourceKit-LSP is treated as very much a second-class citizen. But Rust 1.81 and rust-analyzer build and run just fine.
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/
Re:Swift is a more convenient Rust by dlachausse on Friday September 06, 2024 @07:11AM (#41465026)
It looks like MacOS Sonoma (and the latest Xcode) should work on your Mac.

https://support.apple.com/en-us/105113

Re:Swift is a more convenient Rust by mrtksn on Friday September 06, 2024 @06:23AM (#41464726)
Just get something with Apple Silicon, even the 4 years old M1 Air with 16GB of ram would be huge upgrade. The tooling is fine, it's just that you are using the really old tools.
Re:Swift is a more convenient Rust by homebrewer on Friday September 06, 2024 @06:31AM (#41464769)
Is upgrading every 5-6 years to be able to write code considered normal in the Apple world? I'd been comfortably writing code in several languages using latest toolchains on a decade-old Intel machine just a few months ago, and was forced to upgrade because one of the components died. Otherwise I'd be using it for at least five more years.
Re:Swift is a more convenient Rust by jdmoreira on Friday September 06, 2024 @06:36AM (#41464804)
> Is upgrading every 5-6 years to be able to write code considered normal in the Apple world?

Yes, pretty much

Re:Swift is a more convenient Rust by zer0zzz on Friday September 06, 2024 @06:49AM (#41464882)
I thought this was pretty normal for anyone writing code in larger code bases in these slow to compile languages in the first place…
Re:Swift is a more convenient Rust by SSLy on Friday September 06, 2024 @06:35AM (#41464791)
frankly, late intel macs just sucked with their power-to-capability ratios. progress since M1 haven't been that incredible.
Re:Swift is a more convenient Rust by sgt on Friday September 06, 2024 @06:38AM (#41464821)
I mean.. upgrading every 5-6 years is pretty normal outside the Apple world too, if you are a professional programmer. I don't expect my mom to upgrade her computer that much (she's happy with her 2011 (!) model iMac).

But for those of us who use a computer every day, surely it makes sense to stay a bit cutting edge and it won't break the bank either since it is literally our income.

Re:Swift is a more convenient Rust by timeon on Friday September 06, 2024 @06:41AM (#41464840)
Is it sustainable?
Re:Swift is a more convenient Rust by kaba0 on Friday September 06, 2024 @07:19AM (#41465060)
The curve has flattened a lot - on mobile phones it is extremely noticeable, but I would say that apple’s M series is also the last significant jump in the laptop world (because laptops weren’t really ‘mobile’ before with such a bad battery life). So, yeah, I would say it can be reasonably sustainable.
Re:Swift is a more convenient Rust by mrtksn on Friday September 06, 2024 @06:46AM (#41464864)
I don't see why would anybody complain that the tools they bought 10 years ago don't magically do the things that the new tools are doing. It's not like the old tools stopped doing the things they do, right?

Anyway, you sel the old machine and get the new one is pretty normal as the Apple devices tend to hold value.

Re:Swift is a more convenient Rust by tcfhgj on Friday September 06, 2024 @08:13AM (#41465446)
We are talking about Software though.

It's not really sustainable to throw buy new stuff all the time when there's not a technical reason for it

Re:Swift is a more convenient Rust by mrtksn on Friday September 06, 2024 @08:42AM (#41465626)
That still doesn't mean that the tooling is bad
Re:Swift is a more convenient Rust by gr__or on Friday September 06, 2024 @07:23AM (#41465092)
let the record show that we're talking about 6 years
Re:Swift is a more convenient Rust by mrtksn on Friday September 06, 2024 @07:53AM (#41465303)
Which is about the same time it takes a high school student to get his masters degree in computer science, get into a FAANG and get promoted.

6 years is a lot. It runs about 14$ a month if you throw away you tool at the end. It's probably more like 10$ since you are likely to be able to sell that tool at reasonable price since its Apple.

Re:Swift is a more convenient Rust by dannersy on Friday September 06, 2024 @06:36AM (#41464800)
Buying a computer is not a reasonable response to a comment about bad tooling.
Re:Swift is a more convenient Rust by mrtksn on Friday September 06, 2024 @06:48AM (#41464876)
The comment says that the old tool doesn't do this new thing. The new tools do the new things.

How is it that buying the new tool to do the new thing is unreasonable and expecting the old tool to do the new thing is reasonable?

IMHO if the new tools are good and the tool you have is not good it doesn't mean that the tooling is bad, it means that the tool you have is bad and the solution for this is to obtain a new tool.

Re:Swift is a more convenient Rust by dgellow on Friday September 06, 2024 @06:29AM (#41464763)
I can write rust on a decade old machine without issues
Re:Swift is a more convenient Rust by pjmlp on Friday September 06, 2024 @06:32AM (#41464779)
Depends on how much time you have to wait for clean builds, recompiling the same crates from scratch.
Re:Swift is a more convenient Rust by tcfhgj on Friday September 06, 2024 @06:36AM (#41464806)
On my 15 years old machine I learned to do clean builds only when necessary
Re:Swift is a more convenient Rust by pjmlp on Friday September 06, 2024 @06:38AM (#41464823)
Basically working around the problem.
Re:Swift is a more convenient Rust by tcfhgj on Friday September 06, 2024 @06:40AM (#41464835)
Without any effort, because great tooling
Re:Swift is a more convenient Rust by pjmlp on Friday September 06, 2024 @06:51AM (#41464895)
Great tooling is able to depend on binary libraries without requiring to build the world.
Re:Swift is a more convenient Rust by timeon on Friday September 06, 2024 @06:43AM (#41464850)
Constantly making clean builds is made-up problem.
Re:Swift is a more convenient Rust by pjmlp on Friday September 06, 2024 @06:52AM (#41464900)
Better yet is not doing any at all, binary libraries are a thing in some systems programming languages.
Re:Swift is a more convenient Rust by bhaney on Friday September 06, 2024 @06:36AM (#41464801)
The modern tooling not being available for common hardware that's only a few years old is a problem with the tooling
Re:Swift is a more convenient Rust by mrtksn on Friday September 06, 2024 @06:57AM (#41464938)
It can be a bad value depending on what do you do with your tools but I wouldn't say that this is bad tooling.

The new tooling is amazing, its fast its snappy it runs the code you write for you mobile device directly on your tool. If that brings you value less that is less than 200$ a year, then it can be a bad deal but its not bad tooling.