Re: Important question, please?
Re: Important question, please?
- Subject: Re: Important question, please?
- From: 2551phil <email@hidden>
- Date: Wed, 20 Sep 2017 20:49:49 +0700
> On 20 Sep 2017, at 07:22, Brian Christmas <email@hidden> wrote:
>
> I’ve read this link below, and the procedure seems straightforward.
I don’t believe there’s an AppleScript-Swift bridge, so you’ll have to
translate your ASObjC and vanilla AppleScript code directly into Swift. That
will not be straightforward.
I’ve spent the last two months (re-)writing one of my Objective-C apps in
Swift, and it was far from easy. Quite besides the fact that similar sounding
Swift classes like String and Array do not behave like NSString and NSArray
(although you can bridge to the Objective-C versions if you want), Swift is by
design far more intolerant than Objective-C. It was made for iOS devices, where
crashing is preferable to having an app performing inefficiently on hardware
where memory, disk space and particularly battery life are in short supply. So
you’ll find that things that wouldn’t have crashed before will crash now. Of
course, that’ll make you a better programmer; it may not do much for your head
and the wall nearest to it, though.
But put all that aside. You’re tenacious. If you want to do it, I’m sure you’ll
do it. A far more important consideration is why Swift? The name is a misnomer.
It’s got nothing to do with speed, whatever Apple might say, and in many places
it is interwined and reliant on Objective-C under the hood (one unpublicized
reason why Apple confidently say ‘Objective-C isn’t going anywhere anytime
soon’).
If you’re looking for speed increases, by all means get away from AppleScript,
but a better choice would be to put as much of your code into Objective-C as
you can. You’ll also be far more comfortable with it, as the syntax will both
look and behave in familiar ways.
You’ll also find it easier to get help with Objective-C than Swift (Swift 1,
Swift 2, Swift 3, Swift 4 - changes abound). About the only good thing I can
think about Swift is that Xcode’s codesense / static analyser is far more
helpful for Swift than it is for Objective-C. Oh, and it sounds cooler, of
course.
Best
Phil
@sqwarq
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden