4 ms·
I love both Rust and Swift, they have their respective strengths. I would say Swift has a less noisy surface syntax, but instead uses more dedicated keywords an
by K0nserv 2y ago
I love both Rust and Swift, they have their respective strengths. I would say Swift has a less noisy surface syntax, but instead uses more dedicated keywords and compiler magic. This is nicer, but means some areas are "compiler only territory".
In many cases Swift would be a better choice than Rust, when the convenience and developer experience is worth trading for some performance. However, Swift's biggest problem is that any usage outside of the Apple ecosystem is a second(or third) class citizen. Until this is solved, Swift will remain mostly an Apple only language, regardless of how nice it is.
- zer0zzz 2y ago> However, Swift's biggest problem is that any usage outside of the Apple ecosystem is a second(or third) class citizen. Until this is solved, Swift will remain mostly an Apple only language, regardless of how nice it is. I think a time goes on this is more and more only a perception and not a reality. However perception is really important because it’ll mean even if it’s a great language with a great set of tools and libraries for all platforms it will not have a community of developers outside of the Apple ecosystem.
- knighthack 2y agoThe issue is not "as time goes on". The issue is now - the use of Swift outside of the Apple ecosystem is remarkably stifled, given the lack of Apple support. A language truly acquires mainstream mindshare and community, only if it can extend its use beyond Apple's OSes.
- zer0zzz 2y ago> given the lack of Apple support. It’s an open source project that’s more and more detached from Apple itself every release, with lots of contributors making it better and better on Android and windows all the time. It is possible to get a vscode ide environment working for cross platform development and debugging today, which was not that easy or possible even a few years ago. There is at least one pretty sizable software project that has shipped a product on Android and windows using swift. I think swift 6 is going to be great for cross platform uses, but convincing folks to try it still won’t be easy.
- galangalalgol 2y agoIn my toy usage of swift I found it to run dramatically slower than rust. To even get something close to go or java speeds I had to compile with unchecked losing a lot of safety. Other than developing for an apple product, I don't know why I would ever pick swift and I wouldn't ever find myself deciding between rust and swift. It would be swift vs go. When considering rust it would be vs c++ or zig.
- K0nserv 2y agoIt depends on the axis you are considering. Swift might be slower than Rust, but it has an equally powerful type system. Swift and Go are much less similar than Swift and Rust in this regard.
- galangalalgol 2y agoI compare tools based on what they do not how I use them. I use mig and hot glue guns similarly, but I'd compare mig to stick or tig and a glue gun to tubes or gluesticks.
- attractivechaos 2y agoIn my limited experiences in both languages, it is easier to write inefficient programs in swift. With rust, follow your instinct. As long as it compiles, the performance is usually close to your expectation. With swift, the result may surprise you more often.