3 ms·
> As much as Objective-C gets used outside Apple platforms, in spite of 20+ years of support on GCC. Swift is already more widely used than Objective-C outside
by skohan 8y ago
> As much as Objective-C gets used outside Apple platforms, in spite of 20+ years of support on GCC.
Swift is already more widely used than Objective-C outside of Apple platforms. The main difference is that the Objective-C runtime (which is required to make Objective-C useful in any meaningful way) is closed-source and not available on non-apple platforms. The Swift runtime is available and officially supported on Ubuntu.
> There is nothing like CoreData, CoreAudio, SceneKit, Cocoa,.... outside Apple platforms for Swift.
Most of those examples are proprietary frameworks for interfacing with the Apple platforms directly. Most major platforms include proprietary frameworks, and their existence as value-adds on that platform don't speak to a detriment of the language as a whole. Your statement is like saying C++ is not useful outside of Windows because there is no DirectX.
There is already a large body of open source libraries for Swift for a variety of tasks, and moreover Swift's excellent C interoperability makes it very reasonable to make serious platform-agnostic software with Swift.
- mulle_nat 8y agoThe Apple Objective-C runtime is right there on Apple Opensource https://opensource.apple.com/source/objc4/objc4-750.1/ https://opensource.apple.com/source/objc4/objc4-750.1/
- skohan 8y agoIf it is now, that has not always been the case. Also I invite you to build and link the runtime on a non-apple platform and compare that experience to building a working binary with the Swift Package Manager.
- pjmlp 8y agoYou mean Swift packages that depend on macOS and iOS APIs?
- skohan 8y agoNo I mean it is relatively painless to build a Swift executable using the package manager on Ubuntu. Doing the same with an Objective-C executable which relies on the runtime is probably several days of work.
- pjmlp 8y agoIt was pretty painless with GNUStep/GCC Objective-C runtime, not that it helped fostering adoption outside NeXT and Apple platforms, since the late 90's. Naturally GNUStep kind of runned out of steam by Pather, but still.
- skohan 8y agoGNUstep was far from painless. I had the pleasure of trying to use it to port some Objective C code maybe 8 years ago and it was an absolute pain to deal with, not to mention that there were some implementation details which varied from the Apple implementation so your code would not behave consistently between platforms. Not to mention that it’s very different to have cross platform support as part of the core development process. With a 3rd party implementation like GNUStep,(especially one with a relatively small user base) there is no guarantee that it would keep pace with Apple’s implementation. Swift is a much smoother, modern experience. I am not saying it is perfect, and other languages have much better support across platforms, but to compare Swift and Objective-C is just not accurate.
- deleted 8y ago[deleted]
- pjmlp 8y ago> The Swift runtime is available and officially supported on Ubuntu. Which is actually the only OS outside Apple platforms that has any kind of proper support for Swift. > Your statement is like saying C++ is not useful outside of Windows because there is no DirectX. C++ is usefull outside Windows, because it is an ISO standard in no means bound to Windows, with several OS vendors and OEM contributing for multiple implementations of the said standard. > There is already a large body of open source libraries for Swift for a variety of tasks, and moreover Swift's excellent C interoperability makes it very reasonable to make serious platform-agnostic software with Swift. Quantity does not mean usefulness. Great interoperability with C isn't exclusive to Swift, and is also available in languages with a bigger markeshare, with implementations across several OSes. Swift is great as replacement for Objective-C, improving the safety on Apple's platforms and making FP mainstream on those platforms, as cross platform language it still has quite a lot to improve.
- skohan 8y agoWith all due respect, you’re moving the goalposts quite a bit. Your initial statement was that Swift has no community or adoption outside of iOS, and no library support outside of Apple platforms. I never made the claim that Swift is the only language with C interop, or that it’s the best most successful cross platform language, I am simply refuting your claims that it is useless outside the Apple ecosystem. I agree with you that Swift has a way to go before it can be considered a truly platform agnostic general purpose programming language, but it is making strides in that direction. Recently Windows nightly builds have been introduced, and work has started on Language Server Portocl support, which should aid usability on 3rd part IDE’s. Also it’s somewhat perplexing to me that Swift for Tensorflow is often viewed as a strange move under the assumption that Swift is only for iOS, rather than being viewed in terms of Swift’s adoption for a new category of use-cases with the backing of a tech giant in Google. It remains to be seen whether Swift will find wide adoption, but I think it’s a mistake to assume it won’t only because of its origins.