5 ms·
There is almost zero application for Swift outside of an Apple environment. I'm willing to bet there is precisely zero production code written in Swift for Wind
by boringuser1 7y ago
There is almost zero application for Swift outside of an Apple environment. I'm willing to bet there is precisely zero production code written in Swift for Windows (or Linux).
Anyhow, the Windows API (.net, C#) is better and has a brighter future and present.
- favorited 7y agoI know multiple teams who have Swift in production on Linux servers
- boringuser1 7y agoAlright, well, don't do that.
- maxdesiatov 7y agoWhy not?
- Eric_WVGG 7y agoWhy not? Dive in, the water’s great. https://vapor.codes https://vapor.codes
- _bxg1 7y agoLike I said, Windows support is currently middling. I would bet there's some Linux production code in Swift, though not much. But both of these are cultural problems, not technical ones. If Apple said tomorrow, "we're going to go all-in on making Swift a universal programming language", thousands of developers would cheer and jump on-board. The main thing holding it back right now is lack of confidence in its support; people don't want to invest in a new cross-platform codebase that might have its legs cut out from under it in a couple of years. Swift is much closer to the metal than .NET, and it has very innovative syntax features. It's more analogous to Rust than to C#. .NET is a strong cross-platform ecosystem, but it's silly to say "we don't need any others because this one's good enough". It's not even the strongest one that currently exists - probably the JVM is. It honestly just sounds like you're hating on Apple for the sake of it.
- boringuser1 7y agoI like how you go from saying that Swift is like Javascript (lol) in one post to telling us how low level a language it is, despite being outperformed by mid-level languages like Java or C#.
- _bxg1 7y agoSuperficially it has a lot in common with JavaScript (really, TypeScript), but like Rust it compiles to a native binary and doesn't need a runtime environment (C# and Java do). Also like Rust, it frees the user from manually managing memory, despite lacking a garbage collector. This combination of features makes both languages very exciting. I'm not aware of any others right now that can claim the same. I also haven't heard of it being outperformed by Java and C#; do you have a source for that claim?
- bluk 7y agoIn microbenchmarks like https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/swift.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... / https://benchmarksgame-team.pages.debian.net/benchmarksgame/which-programs-are-fast.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... , Swift is mostly equivalent to Java with a few outliers both for/against Swift. Rust outperforms Swift fairly consistently and sometimes quite considerably. Of course, real apps may be different. The book iOS and macOS Performance Tuning ( https://www.amazon.com/iOS-macOS-Performance-Tuning-Objective-C/dp/0321842847 https://www.amazon.com/iOS-macOS-Performance-Tuning-Objectiv... ) has pretty damning benchmarks against Swift versus Objective-C even without using any tricky optimizations (not what you originally asked but something to consider). Of course the whole book (written by a former Apple engineer IIRC) is pretty much full of performance gotchas across many Apple frameworks/APIs, but the chapter on Swift was pretty harsh and basically said Swift fails to live up to its name versus Objective-C (at least at the time the book was written). I think most people think that Swift performs like Rust/C++/C since it doesn't have a garbage collector and imagine ARC is providing relatively free memory management, but it seems Swift performs closer to languages with a garbage collector due to the various design constraints on the language (interoperability with Objective-C, ARC isn't free, and maybe without the explicit lifetime/ownership declarations in the code like Rust, ARC can't be optimized as well).