Hacker News new | ask | show | jobs
by m0zg 2689 days ago
Is there a "standard" way of running Swift on Ubuntu LTS nowadays? A while back I looked into it, and ran into some hokey and unsatisfying solutions. I used Swift on iOS, and I like it a lot, but if they care about adoption, someone needs to reduce friction of getting up and running to approximately zero. A snap package a-la Go or per-user script based installation a-la Rust would be quite OK, as long as it's just one, easy to discover command.
1 comments

It looks pretty straightforward, see the Linux section of https://swift.org/download/#using-downloads
Yeah, going through two screenfuls of text every time I want to upgrade is not "straightforward".
Sorry, I just didn't want to give people the impression that it's more difficult than other languages. To upgrade you'd just have to remove the original install directory and untar the new release.

I'm not familiar with Snap, but I did find https://snapcraft.io/swift

Also, upgrading will be less common than Rust since almost everyone uses the latest release/toolchain. There's not really a reason to use the daily builds unless you're contributing to the Swift project.

For comparison, for Go, it's "sudo snap refresh go". For Rust it's "rustup update stable". I mean, how hard would it be to properly package this stuff, and why should tens of thousands of users deal with all this manual downloading and unpacking? Assuming, of course, that Swift folks don't deliberately want to make the language unpolular, like Haskell.
I agree they should put the effort into having an easy "apt-get" solution. On the other hand, your original question was whether there is a standard way of installing Swift on Ubuntu. The answer is a very clear YES: download the latest tarball of the binaries from the Download page and unzip.
I’m kinda annoyed there’s no PPA for this, but I suspect they won’t bother shipping this in the standard repo until there’s a stable ABI
And that's fine: ship an official snap or use the Rust solution. Not doing this very directly impacts adoption. Most people won't even try to set it up.