This ridiculous overly-complex "libs linking to libs" thing is one of the main reasons why Swift is so bad. At this point, the only thing Swift is good for are extremely high-level programs, that do nothing more than interface with a REST API (which is EXACTLY what this whole "SwiftUI" stuff is geared towards). I really think using Objective-C would have been a MUCH better route to go for writing a program like this. All Swift is is an overly complex link down to Objective-C/Foundation libs, while trying to "hide" the Objective-C part from the developer. On top of that, it also utilizes a very confusing and honestly extremely counter intuitive syntax. It's almost as bad as Rust syntax.
Dosdude1:
I'll try to Objective-ly have a small rebuttal here and I do agree with you with on the linking thing.
Before Swift 4.2, Apple kept the Swift libraries self contained in the App. And this worked great. I have some Swift Apps on MacOS that I haven't updated and they still run. But Apple wanted to make the Swift Apps smaller and this is were the complexities start.
After Swift 4.2 and mostly in 5 Apple decided to make Swift part of the OS. First the apps should never have their own libraries anymore but Apple kept them for non-apple OS' like Ubuntu Linux. Or so they said. But it turns out those thinned libraries are linking to the larger Swift libraries on the OS. And this whole linking to the Main swift OS libraries and those linking to actual frameworks I agree is complex and this also makes it harder for Swift 5 to move forward on other platforms like Android and Windows. Swift 4 users have gotten the base Swift language and its toolchain to install, compile and run basic command line apps with Java or Windows interfaces.
Here's where my rebuttal starts, I've been writing Swift since version 1 and for me it took some getting used to. I would start with some basic code of Github and expand from there. At the time, I could write Objective-C and did it off and on for 20 years and I have used a sister language called AppleScript-ObjC and its still around but Apple doesn't talk about. While I was learning Objective-C, I got into AppleScript Studio and it let you write Cocoa Apps in AppleScript. It was slow as dirt but you could combine it with shell scripts and that make up for its slowness. AppleScript historically is mostly used for Automation and Automating Applications. Later AppleScript-ObjC came and a decade later came Swift.
Now I haven't written a line of Objective-C since I started using Swift. I used to be good at translating Objective-C to Swift and did this a lot in the early days when there were no Swift examples just Obj-C, but I've been away from Objective-C for so long that now it's easier to just write Swift from scratch. [ I do still use Swift data types, btw. ]
Now I don't disagree that CloneToolX should probably be an Objective-C app and in fact, I plan rewrite later this year in Objective-C to get my feet web again with language as many iOS shops are writing new code in Swift and they are maintaining code in Objective-C. Job wise; it will be best for me to get into both. It won't be a hard re-write because all I am doing use using NSTask aka Process(), to do the work. Apple's disk code for Swift uses mostly C libraries and that's just too low level and would have require a learning curve.
Back on the ugly part of this linking thing. I honestly did not know how bad the linking problem was until I encountered it last night. On the base system, Swift is non existent and that says Apple's macOS Engineers are only use C and Objective-C with maybe some JavaScript mixed in. When working with the base system, I knew there would be one or two libraries that I needed to bring in. Swift on a full OS will use the Metal API if its available for its drawing and I knew Metal is not used on the Base System. I surprised I had to bring in pieces from the Quartz. Lib.
I have written about a dozen iOS apps in the last 5 years. I am now getting around to publishing at least half of them. I've done apps in SpriteKit, SceneKit, ARKit, UIKit, AppKit all with Swift. How it works in Xcode is not much different than Objective-C. The UI links the same way in IB and you can code UI all in code as well. Now I am not a fan of SwiftUI at this time. I really don't like it right now and I'll have to watch some videos on it because I can really say how I feel about it. For now it's easier for me to use Swift in it's Cocoa / AppKit / UIKit form.
I have recently written my own Swift libraries and I've also done Swift server side. [ My libraries are linked statically and they are much cleaner than what Apple is doing ]. I like being able to make a library make it part of Swift Package Manager and distribute it within git. That part is quite nice and I have a library for my HLS Streaming Radio software that can use the same code on a server, a client and on an embedded web server with my client. Those are some great plus'. Mix that in with an Xcode workspace and you can develop the Library and Mulitple platforms all at the same time. You can do the same thing with Objective-C except there isn't a package manager builtin into the OS for it, as far I know, like it is in Swift. Swift's package manger is a pretty useful tool and Catalina's Xcode is finally supported it. In the past it was all command line.
I do agree with you on the linking thing. Can't deny that. I however, am so used to writing code in Swift, it's going to be hard for me to change. I will re-write CloneToolX later this year in Objective-C to make things easier for its embedded OS and will most likely maintain two versions of it. Maybe three if I get into SwiftUI.
I am also thinking about making the CloneToolX project open source where others can take part in adding things to it and if they want to be apart of any writes or other flavors, then that would make things much easier.
The tool overall is working great regardless of how Apple implements Swift. If it was under performant, I would re-think it.
Thank you for your input. I have seen your latest work with your macOS patched installer maker and you did an awesome job and I congratulate you on it. I will still see things from a different perspective, but I must say your latest stuff with the installer is superb. I have sent you a donation recently, I hope you are getting more donations by the day. I know none of us are in this for the money. And this is a great community that you started!
Todd
p.s.
Swift 5.1 is out and the language is moving so fast, that I have not been able to keep up and some of the its latest advances I can't even comprehend. Swift does keep you busy learning. And there doesn't seem to be a end of it leveling off. I will be happy when Apple when it does like how Objective-C is today. But with Apple having a new OS every year, along with a new Xcode, looks like there will always be a new version of Swift. This is good, bad and ugly.
Last edited: