[squeak-dev] re: enumerating classes with Naiad (was "Environment declarations vs bindings")

Craig Latta craig at blackpagedigital.com
Wed Oct 5 08:57:58 UTC 2016

Hi Chris--

> How about the use-case when all you have is a name String, but want to
> get the (correct) Class object?  Are you suggesting to
> enumerate all classes (which wouldn't take long) and selecting
> the ones with the referenced name, instead of always only doing a
> Dictionary lookup (which assumes one name--> to one Class).

     Yes indeed; we free ourselves of the one-class-per-name assumption
(and from even having to think about class namespaces), at that slight
cost. Also, if you want to do some reflection which doesn't require
getting direct class object references (e.g., "How many classes have
this name?"), you can do the enumeration entirely within the history
database, in parallel with whatever else you're doing in the main memory
where your class objects are.

     (Naiad uses a second, minimal, live object memory as a history
database, replacing the changes and sources files. The history has
"editions": all the metadata for all versions of classes and methods in
the system. Most of the questions that development tools ask can be
answered by editions. In fact, class and method editions stand in for
classes and methods with the traditional code browsers, unbeknownst to
them. This enables low-network-traffic remote browsing; editions have a
compact binary representation and are self-contained, eliminating
extended back-and-forth remote messaging with the classes and methods
they describe.)

     There's also the cost of interacting with the history database over
the network (typically within localhost) instead of a filesystem, but I
find it worthwhile, especially since some history-related work can be

> You mentioned using other fields for disambiguation, so enumerate all
> classes, selecting the ones whose names match the string, and if there
> are any other disambiguating clues, use them to auto-select.  Is this
> a correct jist of what you mean?

     That's right. If you only care about current class versions, you
would enumerate live class objects. If you wanted to enumerate over all
past and present class versions, you would delegate to the history
database, which would enumerate the class editions.

> I'm looking forward to your release!



Craig Latta
Black Page Digital
Amsterdam | San Francisco
craig at blackpagedigital.com
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)

More information about the Squeak-dev mailing list