Comment on What to learn next, Swift or Rust
aggelalex@lemmy.world 1 year ago
Swift has little to no use outside the apple ecosystem, and even if you are currently using Apple, you have to consider your targets as well. Writing in Swift means your code will only be usable by other Apple users, which is canonically a rather small fraction of technology users. Rust on the other hand is multiplatform and super low level, there’s very few other languages out there that can match the potential of applications of rust code. Thus you will, in time, be introduced to many other technologies as well, like AI, low level programming, web, integrations between languages, IoT, those are only a few of all the possibilities. On the other hand, even if Swift has a much more mature ecosystem, it’s still only good for creating UIs in all things Apple, which is pretty telling; Apple is not willing to put in the time and effort to open it’s language to other fields, because it sees no value in them being the ones providing the tooling for other purposes. They pretty much only want people to code web apps for them, and Swift delivers just fine for that. So if your current purpose is making Apple UIs, you could learn Swift, but be warned that either you’ll be doing that your whole life or will eventually be forced to change languages again.
Then again, most languages nowadays aren’t that different from each other. I can code in a truckload of languages, not because I actually spent time making something coherent and complete with each one of them, but because I know some underlying concepts that all programming languages follow, like OOP, or functional programming, and whatever those entail. If you learn those you will not be afraid to switch languages on a whim, because you’ll know you can get familiar with any of them within a day.
farcaller@fstab.sh 1 year ago
Just a nit: swift is opensource and there is a swift ecosystem outside of apple UI things. Here’s a swift http server that you can totally run on linux.
aggelalex@lemmy.world 1 year ago
Don’t get me wrong, Swift is OSS and there are things you can do with it apart from front-end dev, but there are usually better options out there for those other things. For example if I want an HTTP server, I’d choose JS, Kotlin, Rust, etc.
abhibeckert@lemmy.world 1 year ago
I wouldn’t. Swift is definitely better than any of those choices… and I’ve got decades of experience writing HTTP services.
I don’t currently use Swift for that - but only because it’s a relatively immature language and I’m generally a late adopter. I definitely intend to switch over to Swift at some point in the near future and it’s what I recommend for someone starting out today.
BatmanAoD@programming.dev 1 year ago
I’m not a performance expert by any means, but…it seems like the bit about there being “no situation, ever” in which a garbage collector that “worked just as well as in any other language” outperformed reference-counting GC. The things I’ve read about garbage collection generally indicate that a well-tuned garbage collector can be fast but nondeterministic, whereas reference-counting is deterministic but generally not faster on average. If Apple never invested significant resources in its GC, is it possible it just never performed as well as D’s, Java’s, or Go’s?
beefsack@lemmy.world 1 year ago
Swift only treats Apple OSes as first class citizens - even though technically you can use it on other platforms it’s a painful and limited experience.