5 ms·
Now that Swift is on other platforms, I think it’s a good fit, especially as Foundation is being rewritten in pure Swift . Really good ergonomics, safe by defa
by dagmx 3y ago
Now that Swift is on other platforms, I think it’s a good fit, especially as Foundation is being rewritten in pure Swift .
Really good ergonomics, safe by default for many cases and getting more of rusts safety for others.
Easy interop with C/ObjC/C++, which is a big deal for me because it’s what’s caused me to write less Rust/C++/Zig at all lately and focus on Swift.
- jwells89 3y agoI really, really hope that the energy cross platform Swift has been seeing lately continues and accelerates. It’s not perfect, but I find it productive and enjoyable to write. It strikes a nice balance between being strict and getting out of your way and doesn’t come off as pedantic as some languages with similar syntax.
- dagmx 3y agoI think the new C++ interop might help the momentum. Swift is now the easiest language IMHO to bind C++ automatically with. I really feel like easy interop in languages is the missing key to moving people into more safe languages.
- jwells89 3y agoTooling is also a factor I think. Last time I was playing with writing Swift on Linux, the official LSP with VS Code was alright (surprisingly even supporting debugging) but I found myself wanting a proper IDE.
- pjmlp 3y agoI doubt it, what makes Swift, just like Objective-C, it is the frameworks and IDE tooling. GNUStep went nowhere.
- jwells89 3y agoSwift on its own is already much more usable than Obj-C is and will only become moreso with the Foundation rewrite. It has a way to go but it’s possible to write useful software with it without Cocoa/GNUStep (especially if one is willing to lean on C or C++ libraries via interop), which was never true of Obj-C.
- pjmlp 3y agoIt was definitely true for Objective-C with GNUStep, or during the time Microsoft had their porting framework into Windows Store (Windows Bridge for iOS).
- jwells89 3y agoThat extreme dependency on a supporting framework (Obj-C doesn’t even have its own allocator) was a massive weakness though, as has been proven by GNUStep’s stagnation and MS’ abandonment of WinObjC. Swift has no such issues. It’s weaker without AppKit/UIKit yes, but at least has most of the basics covered. The only real threat is Apple deciding they don’t want cross platform compatibility any more in which case Swift can simply be forked.
- pjmlp 3y agoNot even Apple is fully supportive of it outside their ecosystem, besides CLI tools and Linux based servers, as stated on Swift's open source website. Seeing how much engagement Microsoft is having with .NET outside Windows and still failing in many fronts in regards to adoption by non-Microsoft shops, versus the little Apple has invested, I doubt it will really be any different than Objective-C.
- dagmx 3y agoBut the framework dependency is exactly why I mention the C++ interop and Foundation rewrites. Swift prior to the interop didn’t interest me as much for cross platform use, primarily due to ecosystem . That has changed significantly because the ecosystem just magically expanded. I can use most C++ libraries I throw at it. Foundations rewrite means I can use a more comprehensive stdlib everywhere. IDE tooling is definitely a weak point but I think that’s easier to rectify than ecosystem. The biggest loss has really been the Swift plugin for CLion and the entirety of AppCode for me. But when they were around, they worked very well and so the foundation for it is already there along with the Swift LSP to improve on.
- pjmlp 3y agoFrom my experience dual language approach always adds some atriction across the board, in tooling, building infrastructure and debugging layers. Hence why while I could use C++/CLI on my hobby coding to stay on the confort of .NET, with a couple of bindings being used from C#/F#, I end up using straight C++ instead.
- dagmx 3y agoIn my experience, it’s the opposite. Most people tend towards the easier language unless they need to be maintaining the bindings or something on the other end. Perhaps you’re considering mixed language projects. I’m talking about primarily Swift where I can just import C++ libs over. The fact that it’s C++ is easily hidden, especially with the use of SPM. I think Python is a big example. So many people stay on the Python side for things like Qt.
- pyjarrett 3y agoI tried out Swift on Windows and really enjoyed it. The experience was 100x better than I expected.