4 ms·
How usable/useful is Swift on not-Apple platforms in general nowadays? I've been giving it a wide berth since I got the impression that other platforms were mor
by jsheard 3y ago
How usable/useful is Swift on not-Apple platforms in general nowadays? I've been giving it a wide berth since I got the impression that other platforms were more of an afterthought, but maybe things have improved when I wasn't looking.
- pdpi 3y agoI’ve been playing around with Swift on Windows, building a small raylib-based game. The only raylib bindings out there are pretty outdated so I had to write my own, with little to no experience with either C or Swift. It was way easier to get that set up than I expected it to be! The language server seems a bit clunky on Windows, I’ve only used Swift with Xcode on macOS so I don’t know if that’s platform specific.
- deleted 3y ago[deleted]
- zer0zzz 3y agoThe arc browser has a beta for windows. It’s pretty decent so far and is written in swift
- mpweiher 3y agoIt's based on Chromium, wich is C++. In terms of total code, I'd wager it's around 99% C++.
- machinekob 3y agoI think he means GUI not engine as they are indeed just using chromium engine as browser.
- zer0zzz 3y agoYes. Ignoring the engine there’s a lot of swift in how they build the ui components and sync tabs etc. they’ve built something similar to SwiftUI but it used winui/wpf (or whatever it’s called these days ) underneath.
- zer0zzz 3y agoThe Arc browser borrows very little UI or tab/account syncing code from chromium. The non-V8+Blink bits are almost entirely written in swift as far as I know. This means it probably has the most Windows Swift code of any app out there and that’s why I mentioned it.
- lukeh 3y agoIt's pretty usable on Linux, the odd package needs a patch, but it's pretty smooth sailing. Of course, if you're trying to write an application with a UI, YMMV (although swift-cross-ui looks promising).
- hboon 3y agoThere's https://speakinginswift.substack.com/p/swift-meet-winrt https://speakinginswift.substack.com/p/swift-meet-winrt
- frizlab 3y agoI’m using swift on the server with vapor and it’s really working great. Non-Apple platforms support has been greatly enhanced over time and is still being enhanced.
- navanchauhan 3y agoI like using it for non-GUI programs. I usually test them on a Linux VM and a Raspberry Pi
- shagie 3y agoIBM was working on it for a while... IBM Stops Work on Swift — Q&A with Chris Bailey :: https://www.infoq.com/news/2020/01/ibm-stop-work-swift-server/ https://www.infoq.com/news/2020/01/ibm-stop-work-swift-serve... ( 43 points | 3 comments https://news.ycombinator.com/item?id=22175652 https://news.ycombinator.com/item?id=22175652 ) In this (and highlighted in a comment) there's a quote: > Swift benefits greatly from being an embedded part of Apple's ecosystem, but it also provides challenges for its organic growth as there's a lot of dependency on Apple for capabilities that the server ecosystem requires. For example, almost all Swift developers use Apple's Xcode as their IDE and it has fantastic support for developing for iOS devices, including the ability to run locally in emulator environments. It would be great to add support for writing server code that allows developers to develop directly into containerized environments from their local IDE by supporting the simple integration into Xcode of development tools such as Appsody. Where there is open governance and open ecosystems, it enables the community to contribute and to solve the problems and use cases that are important to them. Same timeframe: IBM Stops Server Side Swift Framework Development - https://news.ycombinator.com/item?id=21808619 https://news.ycombinator.com/item?id=21808619 (156 points | 97 comments) --- From earlier times: Introducing the IBM Swift Sandbox - https://news.ycombinator.com/item?id=10676655 https://news.ycombinator.com/item?id=10676655 (246 points | 59 comments) IBM says Swift is ready for the enterprise - https://news.ycombinator.com/item?id=12581250 https://news.ycombinator.com/item?id=12581250 (176 points| 226 comments)
- lukeh 3y agoI use vim on Linux without any LSP integration, it’s fine, although I do prefer Xcode. I guess I should look into VSCode…
- freedomben 3y agoIf you're a vim user, you're gonna find vscode close enough that it feels like you're close, but far enough that it's frustrating. I finally setup coc and have been quite happy.
- TravelPiglet 3y agoIt’s barely usable on Apple platforms. Horrible compiler and Xcode is very buggy. Segfaults and error report dialog popups.
- jwells89 3y agoXcode is fine as long as you don’t have a ton of Obj-C ↔ Swift bridging going on and avoid XIBs/Storyboards, with writing UIKit in pure code being the most stable option (SwiftUI still needs some time in the oven). Writing idiomatic Swift also helps (code smells like deeply nested closures can make SourceKit grumpy). I’ve spent countless hours working in it and crashes and errors have been rare for years now. Especially since ditching CocoaPods in favor of Swift Package Manager for dependencies, I’ve found that Android development to be considerably more frustrating with the mess of Gradle and Proguard paired with the surprisingly anemic Android Framework. Jetpack Compose is thankfully replacing Android Framework and is a major improvement, but from time to time Gradle and Proguard make me want to tear my hair out.
- chairhairair 3y agoThat first paragraph is hilarious and consistent with my experience. It’s pretty baffling how bad Xcode is. Although at this point I’m not sure to what extent Swift is to blame. Everything seems to work much better when Swift is abandoned and I just use UIKit. (And it’s a personal blessing when I get to use Flutter and bypass 90% of the insanity that is modern native iOS and Android dev)
- jwells89 3y agoIt makes sense that UIKit is more solid, because not only does it have 17 years of its own history, but builds upon the legacy of AppKit which stretches back another 20 years. By comparison SwiftUI is still quite young. Haven’t touched Flutter because Material Design feels weird on iOS, its Cupertino theme isn’t great, and I’m not the type to reinvent the wheel on UI design in the apps I work on. Also don’t really feel like picking up a language, toolchain, and ecosystem for a single UI framework.
- w10-1 3y agoThe automatic C/C++ bridging got way better in 5.9, so building an app integrating native libraries is pretty easy (~ 1 day to start iterating). As for Swift libraries, Stdlib is fully ported, Foundation can be spotty, the new Foundation-Essentials is small but growing. Swift-System has portable low-level path and such, and Shwift helps with fully async scripting. As for supported platforms, Ubuntu seems robust, AWS is usable but marginal. Windows has some hurdles - technical, legal, and incentives - but VSCode support seems relatively good for non-GUI stuff outside windows API's. Embedded has been landing in the main compiler and pushed by the Swift team lead. They're still issue-spotting, planning how (much) to live without a heap and the runtime metadata used for protocols, but the number of issues seems manageable for the intensity of effort, even though it's not Apple's priority. With Swift 6.0, a breaking release, up next (in September?), it's likely embedded features could be both driven by the desire to make any breaking changes now, and blocked by other priorities.
- georgelyon 3y agoGreat summary! One addition: Swift WASM support has recently become stable enough to be [included in CI](https://forums.swift.org/t/stdlib-and-runtime-tests-for-wasm-wasi-now-available-on-swift-ci/70385 https://forums.swift.org/t/stdlib-and-runtime-tests-for-wasm...). The folks working on that have done a great job and I’m very excited for that to get more fleshed out!
- bsaul 3y agoDepends on the platform. Android is still super rough (expect debugging custom third-party experimental compiler build scripts). Linux support is i think a bit better. But for now it's still the biggest handicap for the language for sure. Any sane project would have solved those issues a long time ago. But since it's an apple language, they seem to not be caring much.