Alpha updated

Brian Rice water at tunes.org
Tue Apr 26 10:22:55 PDT 2005


This auto-loading is now performed by default in post-bootstrap.slate 
on a lot of interesting files in src/lib/ and src/mobius/c/types.slate. 
The result is that the FFI will now automatically be loaded when you 
try to use it - all you have to do is mention one of the types that 
they define and the system will transparently return the result of that 
message send after loading the requisite files.

I have uploaded alpha images which contain this feature - IMPORTANT 
NOTE: this post-bootstrap takes a very long time, as it must parse each 
file to process it. I am very wary about shipping Slate like this, so I 
will try to find a way to cache the information needed into a simple 
database-like file (suggestions are welcome). For now, I just want to 
have a demonstration out there that people can try and give feedback 
on.

Another result of this is that module.slate is now in the default 
image, since it contains the auto-loading features.

Here are the auto-loaded files from src/lib:
extlib, time, dimensioned, predicate, group, heap, skiplist, tree, 
test, terminal, tokenizer, sortedSet, version, relation, random, 
process, promise

On Apr 21, 2005, at 5:27 PM, Brian Rice wrote:

> I've been working on Slate code auto-loading. What this amounts to is 
> parsing a file and processing it for its definitions, then creating 
> methods that stand for those definitions in the image which 
> /transparently/ load the file. So if Trie were not loaded, I can now 
> run:
>
> ((File newNamed: 'src/lib/tree.slate') as: Module) installAutoloaders.
>
> and "prototypes collections Trie" (along with other prototypes and 
> namespaces created in tree.slate) will be defined as such:
>
> _@(prototypes collections) Trie [... load the module and return the 
> Trie prototype...]
>
> So, merely mentioning Trie will cause loading of the file and 
> obtaining of the object it should represent. Since Slate 
> namespace/type definitions rely on making accessor methods so that you 
> can refer to them, this "Trie" method will be replaced by an accessor 
> for the real object. Any other methods pretending to be accessors that 
> correspond to what the file defines will also be replaced.
>
> There are caveats:
>
> 1) If one object is defined in one file that's not loaded, and a 
> second on /top/ of that object (e.g. installed on the object's traits 
> objects like what we have been doing with type-specific conditions or 
> streams), then the dependency between them will be ignored. So until I 
> fix this with a mini-database for such dependencies, this will only 
> work for first-level loads. Examples that come to mind are the FFI 
> libraries types/c.slate and extlib.slate, although I have not done any 
> testing of this yet.
> 2) You have to parse all the files you want to be autoloadable in the 
> same image where they'll be loaded later. So, it takes quite some time 
> and I might have that be done for the initial library bootstrap or 
> something so it's an implicit build step instead of something 
> interrupting work-flow.
>
> I've discussed this with a few people already, and preliminary tests 
> work pretty well.

--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/




More information about the Slate mailing list