Thursday, August 22, 2019

#1 2019-05-20 10:49:22 pm

technomorph
Member
Registered: 2017-12-14
Posts: 114

Should I port my script libraries to OBJC classes?

Now that I'm much more familiar with Obj-C and Xcode
I'm starting to write any new code in Xcode directly.

I'm needing to modify some script libraries that I've made and wondering
If there is any advantage (speed?) to me porting them to
Obj-C classes?

Some of my new code is involving Rest API calls.
If I update my scripts I will definitely have them access my other classes to make the calls.

Thoughts?

Offline

 

#2 2019-05-21 01:18:00 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5829

Re: Should I port my script libraries to OBJC classes?

technomorph wrote:

If there is any advantage (speed?) to me porting them to
Obj-C classes?



Objective-C is always going to be faster. But...

Some of my new code is involving Rest API calls.



The speed of code is often mere noise when you're using things like REST.

Sounds like you're in the lucky position of being able to do either, so do what appeals most.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#3 2019-05-23 04:27:28 pm

technomorph
Member
Registered: 2017-12-14
Posts: 114

Re: Should I port my script libraries to OBJC classes?

Thanks Shane,
There are definitely a few "techniques" I've figured out
In AppleScript that I may just leave.

I'm also going to be wanting to connect with iTunes
And I've got experience with doing that in AppleScript.
And will probably just be easier for me to call them from AppleScript.

My one program that's using a mix of everything
Is only experiencing slight delays while accessing files.
The biggest slowdown is when I need to calculate a audio
Waveform for a new item when selected in a table.
I will try a few approaches I've seen involving creating file caches for recently used items.
The other may be to pre-calculate the CGpoints data when I parse the
Original XML and add it to the dictionary.

There definitely some BridgePlus script functions that
Are super handy and one day I'll peek thru and see how your
Functions do them in OBJc!

Offline

 

#4 2019-05-23 05:35:23 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5829

Re: Should I port my script libraries to OBJC classes?

Walking both sides of the street gives you great flexibility. One other are where Objective-C can make a difference is in memory management, something AppleScript is not very good at.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)