3 ms·
curious about your experience with Swift? can you share?
by sunshinerag 6y ago
curious about your experience with Swift? can you share?
- adamnemecek 6y agoI think the language is nice however the niceness comes at the cost of performance. Swift has a relatively unique performance in that it's faster than garbage collected languages but slower than C or Rust due to some hidden runtime locks. Another problem is with the package ecosystem. It feels like most of Swift ecosystem is wrappers around Apple APIs. There are also some strange workflow edge cases like the fact that you currently cannot use Metal shaders in Swift Packages. This is due to the fact that Xcode projects are supposed to be ephemeral (not version controlled, but generated when you clone the package). However if you want to compile Metal, you have to add some compiler options. As a result, every time you add a dependency, you have to regenerate the XCode project file, you have to fuck with your XCode project to add the compiler options. Ironically, you can use Metal in Rust crates just fine. Rust is also truly cross-platform. Windows and Linux have first class support. To summarize my argument, Swift feels like daddy Apple is telling me what is best for me which may or may not be true. Rust feels like true empowerment. If there is something that doesn't suit me for whatever reason, there is generally a way of working around it. I guess it depends on what you are doing. Swift is OK for iOS/macOS development but other than that Rust is more advanced. Rust macros are really powerful, things that need to be added explicitly to the Swift compiler can be implemented as Rust macros.
- pjmlp 6y ago> Swift has a relatively unique performance in that it's faster than garbage collected languages but slower than C or Rust due to some hidden runtime locks. Yep blazing fast indeed. /s https://github.com/ixy-languages/ixy-languages https://github.com/ixy-languages/ixy-languages