Re: Any Joy with Santimage OXEN
Re: Any Joy with Santimage OXEN
- Subject: Re: Any Joy with Santimage OXEN
- From: Shane Stanley <email@hidden>
- Date: Mon, 22 Oct 2018 09:48:42 +1100
On 22 Oct 2018, at 6:40 am, Deivy Petrescu <email@hidden> wrote:
>
> I will however disagree with Shane, only Python beats Smile for mathematical
> or scientific computation.
You're mis-reading what I said, which was "better than SatimageOSAX.app". Under
Mojave, using the Satimage scripting addition directly is no longer a practical
option -- it can't beat anything.
Using SatimageOSAX.app means commands get sent to the app as Apple events, then
handled by its embedded copy of Satimage osax, then returned by
SatimageOSAX.app. That necessarily adds significant overhead.
However, your post prompted me to do some tests. Here are two scripts, one
using the Satimage scripting addition and the other using Takaaki's library:
use AppleScript version "2.5"
use scripting additions
acos -1
acosh 10
asin -1
asinh 10
atan 10
atanh 0.5
sin pi / 2
sinh 1
tan 30
tanh 10
And:
use AppleScript version "2.5"
use scripting additions
use mLib : script "calcLibAS"
set a02Res to calcAcos(-1) of mLib
set a03Res to calcAcosh(10) of mLib
set a04Res to calcAsin(-1) of mLib
set a05Res to calcAsinh(10) of mLib
set a06Res to calcAtan(10) of mLib
set a08Res to calcAtanh(0.5) of mLib
set a30Res to calcSin(pi / 2) of mLib
set a31Res to calcSinh(1) of mLib
set a33Res to calcTan(30) of mLib
set a34Res to calcTanh(10) of mLib
When I run them both in Script Geek multiple times, Takaaki's library is
quicker. The difference is only of the order of 5%, so largely meaningless, but
it's consistent. (And this is under High Sierra, obviously.)
> I have not check Takaaki’s calcLibAS so I can’t comment.
I suggest you do -- it should take you all of a couple of minutes to test this
for yourself.
In summary:
The big plus of SatimageOSAX.app is that it involves almost no changes to code.
That's a huge convenience for some. However, even its author advises against it
as a long-term solution. (And of course it covers any non-math commands from
Satimage a script may have used, which Takaaki's library obviously does not.)
The big advantage of Takaaki's library is that it is more future-proof. It's
also considerably faster, although I suspect that will only matter in a
minority of uses.
(And there's nothing to stop Takaaki or someone else adding matching
terminology to the library, to make it as simple to use as SatimageOSAX.app.)
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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