Re: Libraries and effiency
Re: Libraries and effiency
- Subject: Re: Libraries and effiency
- From: Tetsuro KURITA <email@hidden>
- Date: Mon, 09 Aug 2010 14:44:42 +0900
Thanks for comments on ModuleLoader.
> Last night I looked at Tetsuros code, and his way of make this mechanism work, taking for granted that the code does what it is supposed to do. It is all very clever, but IMHO, this approach is dangerous.
> The things I find dangerous is that you can't hardcode paths to libraries, and that the module loader will search several libraries and use the script library found in the latest path. It is stuff like this that creates situations where it is very hard to detect what is really going on when something is at err.
The way of finding libraries of ModuleLoader is similar to other script
language i.e. Perl, Ruby and so on. Also AppleMods have same way. This is
widely adapted.
Off cause, Using hardcode paths is simple but cause a tough problem that
you must manage library locations by hand.
History and other systems show that it's a good way to avoid hardcode paths
to libraries.
> Predefined paths and all that, is really modern,, and gives AppleScript a load mechanism like all other languages. But the names of the libraries loaded should always be unique if they are to be loaded by such an implicit method. It should as a matter of fact be disallowed to use the same name for a library residing in two different directories.
ModuleLoader allows duplicated libraries's name, because libraries can be specified by a sub paths from predefined paths.
For example;
property ModuleA1 : module "subfolder1:ModuleA"
property ModuleA2 : module "subfolder2:ModuleA"
> I have a very different approach, and a different idea. I also use predefined paths in the Library Loader to pick the library you want to create a load statement for. -The Library Loader then creates a hardcoded statement for you. And you don't have to load the library from any of the predefined paths, you can pretty much pick it from wherever you like, if you are testing something.
ModuleLoader have "Local loader" function for such requirements.
http://homepage.mac.com/tkurita/scriptfactory/software/OSAX/ModuleLoader/manual/en/06_local_loader/contents.html
> The LibraryLister, which will be updated in the near future, will need Tetsuros permission to render his code at MacScripter.net, If I am to support the dependencies, This goes for AppleMods as well.
Off course you can reuse my code if you follows the ModuleLoader's license
i.e. GPL. But before building your original system, you should try to improve
existing system. I believe ModuleLoader have enough flexibility to meet your requirements.
In my case, I tried to modify AppleMods's LoaderServer before starting own
project. There was no development activity and no responses from AppleMods'
s community (at least when I tried to make a contact.). Also I felt differences
of technical preferences. Then I have developed own system from the scratch.
ModuleLoader have many advantages and easy of use compared with AppleMods.
Because I respected AppleMods and learned many ideas from it.
> Here dropping the needs for tracking dependencies and from which path the library script is taken from is obvious.
Tracing dependencies is very important.
The system without resolving dependencies is not useful.
Don't drop it.
> As the hardcoding of paths saves a fair amount of processing time and disk IO.
You should judge depending on actual impact on the performance.
If libraries are loaded at compile time, no performance loss.
Even if libraries are loaded at run time, no big impact on performance in
many cases.
You should remembers things lost by using hardcoded paths.
> The idea here is to list everything in a script which contains something, except for script objects which only contain properties, and the ability to automatically open that file for inspection.
I could not find your system.
I hope a download package to confirm your system.
=======================================================
Tetsuro KURITA
E-mail: email@hidden
http://homepage.mac.com/tkurita/scriptfactory/en/
=======================================================
_______________________________________________
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