Re: Parents/Child Scripts
Re: Parents/Child Scripts
- Subject: Re: Parents/Child Scripts
- From: has <email@hidden>
- Date: Tue, 14 May 2002 01:21:15 +0100
Michael Sullivan wrote:
>
(about has and his explanations of Applescript OO):
>
>
I agree here.
One more for the "yea" camp then. Hasn't been any "nays" so far, which I
take to be a positive sign.
Thanks to the folks who've commented so far.
--
>
The only issue I have with a lot of this stuff is that Applescript gets
>
kind of flaky when you make big script objects. I've done some stuff
>
where I end up with stack overflows trying to save my script, or storing
>
a script in a file when I'm done with it.
AppleScript gets flaky when you look at it funny. Flakiness is a fact of
life where AS is concerned.:)
I have noticed problems like this with really complex stuff: an applet that
errors when it tries to save changes to itself. What I really wanted to do,
of course, was flush out all of its properties when it had finished using
the data/libraries/objects stored within them, but then I discovered the
problem with AS not garbage collecting quick enough (i.e. before the script
got stored back into the applet shell).
(Guess I'd have to rearrange the innards some more to sort this out, but
that's a project for a rainy day so meantime I just pinned a note on the
thing saying "ignore the error message at the end".:p)
As for whether or not this means AS OO is "safe" to use... For example: I
*was* initially worried that compiledTemplate objects generated by
AWPSRenderer would refuse to save if the source templates got too complex,
but I've not hit the limit yet (even on some pretty complex ones). As a
result, I've been quite happy to go ahead on the project (which should
reach final release in another month or so). I just won't be implementing
any huge Frontier-style object databases around it as that *would* be
tempting fate.:)
So yes, there will be a point at which you have to stop making objects any
bigger/more complex *if* you intend to save them to disk. But I think the
limit is high enough that you can still do plenty good, useful stuff using
OO without any concerns at all. And for objects that will be disposed of by
end of runtime, it's a non-issue anyhow.
>
All in all, I'd be a lot happier if there was a set of memory management
>
calls that one could make in defining script objects
I'd be a lot happier if AS took proper care of its stupid stacks itself.:(
The point of scripting languages is to save the user from such horrors as
malloc(), manual garbage collection and all the other things which might be
needed in bare-to-the-bones, machine code-friendly languages like C/C++,
but which I don't think have a place in scripting.
>
For right now, complicated structures can be fun to build in AS as a
>
prototype or just to see what the language is capable of. But
>
implementation for any large scale real world purposes is probably best
>
left to other languages where it's possible to be more robust.
I think this same argument can be applied to just about anything that goes
beyond simple "pull the email from Entourage and dump it into FMP" type
scripting. There's so many things about AS that make it a horror to scale.
All the same, I think it still scales to a sufficient level to be "good
enough" for many tasks.
Of course, if anyone's (e.g. maybe you could start us off, Michael:) got
any useful notes or info about roughly how far you can push AS before it
barfs, please do tell.
I'd certainly like to get a better idea of "real world" practical info like
this. Theory's all well and good but sometimes you just gotta know the
point at which it all goes out the window cos something stupid breaks if
you push it any further. (And maybe if it becomes enough of an issue, the
AS team might feel it's worth fixing in a future release...?)
Cheers,
has
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.