[Cuis-dev] [RFC] Modules/Namespaces for Cuis

Gerald Klix cuis.01 at klix.ch
Wed Sep 30 12:29:58 PDT 2020


On 2020-09-28 12:08, Gerald Klix via Cuis-dev wrote:
> 
> On 2020-09-27 16:56, ken.dickey--- via Cuis-dev wrote:
>> On 2020-09-27 06:12, Mariano Montone via Cuis-dev wrote:
>>> Hello,
>>>
>>>    there's Package Environments by Ken Dickey:
>>> https://github.com/KenDickey/PackageEnvironments
>>
>> To follow up.
>>
>> The environment code works, but only converts loaded Packages into 
>> Environments.  You can not yet compile code for it.
>>
>> The piece missing is to take the bits of compiler setup to be able to 
>> supply the proper context when compiling code within an Environment 
>> rather than assuming a single global (Smalltalk) namespace.
>>
>> I am a busy guy.  I took time out to get the framebuffer up on 
>> aarch46/arm64 (vm-display-fbdev).  I am also editing and writing a bit 
>> a book on Cuis with a couple of fellows (TheCuisBook).  I am also 
>> coming up to speed on touch devices so that the VM and images can be 
>> used on phones and tablets.
>>
>> And the, of course, I _do_ have a life which includes gardening, dog 
>> walking, shopping/cooking/cleaning/.. you know the rest.
>>
>> So any help with Environments, even as a user, is useful.
>>
>> BTW, I did start to port the Squeak solitaire game with 
>> 'Morphic-Games-Solitaire' converted to an Environment.  No problems 
>> with developing multiple card games.  I did not get far with the port 
>> because I was doing other things (see above).
>>
>> HTH,
>> -KenD
> 
> Hi,
> 
> I wasn't aware that that Ken implemented that multiple global namespaces 
> approach; thanks Ken.
> and thanks for making me aware of it.
> 
> I am, however, aware that Environments are supported in Squeak, but the 
> are not used much,
> at least not in the Squeak's core image.
> 
> Admittedly I have rather different ideas, about
> the coupling of environments/namespaces and packages. I see them as 
> being completely independent.
> 
> I guess I have to give these ideas more thought.
> 
> 
> Thanks again and Best Regards,
> 
> Gerald


Hi all, Hi Juan,

I looked at Ken's design and some (old) videos and came to the 
conclusion, that Ken's package
is a nice approach.

However I do not like Ken's shared pool implementation and the lack of means
to define classes in environments.

Currently I am trying to get rid of the shared pools by using 
metaclasses. If this doesn't
work I will use an external weak values dictionary, to store the 
environment information
of a "local" class.

To define classes in environments, I am using the a method like this:
#subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:environment: 

to define a class in an environment. I this needs a specialized 
ClassBuilder that does the right thing.
Nota bene: If you follow this approach with Ken's
implementation as a basis, you will have to do
the same.

Here the problems start, for example I need to override
ClassBuilder>>#privateNewSubclassOf: and
ClassBuilder>>#privateNewSubclassOf:from: .
In both methods I only need small changes, that are better factored out 
into some methods that can be
redefined in a specialized class builder.

The same is probably true for
SystemDictionary>>#at:put: and other methods
after all it is the essence of this package,
"local" classes are stored somewhere else.
(IHMO changing all the places where #at:put: is
used to manipulate the binding global variables
to classes will be to tedious)

*Juan, If I will refactor some classes like ClassBuilder, CodePackage, 
SystemDictionary to make the implementation of environments easier,
would these changes be accepted into Cuis' core?*


Best Regards,

Gerald


More information about the Cuis-dev mailing list