[Cuis-dev] Namespaces?

Luciano Notarfrancesco luchiano at gmail.com
Tue May 21 00:54:20 PDT 2019


Yes, "namespaces" are a slippery slope that very quickly derives in all
that... packages with inter-dependencies, simultaneously having different
versions of a class or even its methods running in a single system, etc.
Those are very hard issues and people have been working on that for a long
time. I'm not sure I would want to solve those problems in Cuis anyways, it
might be cool, it might also be complex and tedious, I don't know.

The only problem I would like to solve is, given a package that defines
*new* classes, loading it not globally in Smalltalk but locally in a new
"SystemDictionary". Everything else is "out of scope" for me. So far,
Environments looks very close to what I want. I'm not sure yet if it would
work, or if it would have any side effect I'm not seeing... when I get some
free time I'll try to port it as a Cuis package, and I'll see how it feels
using it in my projects and maybe get a better understanding of the issues.
But I certainly wouldn't want to implement some idea of "namespaces" in a
hurry and integrate it in the base image.

Mist and Newspeak are interesting but... I'm a Smalltalk-80 guy... I guess
I'm a traditionalist after all... I'll look at them for ideas, tho.

I'd like to hear what people like and dislike of other namespace systems.
Did anyone ever use namespaces in VW? Is there something bad about them?

On Tue, May 21, 2019 at 7:07 AM Andres Valloud via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> ... I forgot.  But you may also want to review how the libc guys deal
> with backwards compatibility.  There are tons of smart people "out
> there".  It's not necessary to make everything from scratch again.
>
> On 5/20/19 23:58, Andres Valloud via Cuis-dev wrote:
> > I would look at Newspeak to get some ideas.  I'm not so sure about the
> > nested class approach and the default message lookup scheme, but that
> > way of doing things has the benefit of having some serious thought
> > behind it.
> >
> > Before doing anything, however, one would have to think what's going to
> > happen when inevitably two packages that should be loaded depend on
> > different versions of a third package.  Or what happens when package A
> > wants to use things from package B that have name collisions with
> > package A.  And how to deal with overrides / redefinitions /
> > refinements.  The etcetera list is longish.  Also, one has to consider
> > how the end result feels, and how people are induced to collaborate as a
> > result.
> >
> > So for that, I'd look at Mist.
> >
> > None of these problems are easy, and the easy solutions one can think in
> > a day or so tend to have serious side effects that are not immediately
> > visible.  Watch out for the temptation to do something before thinking
> > it through, in the end it causes more problems than it solves.
> >
> > On 5/13/19 05:21, Luciano Notarfrancesco via Cuis-dev wrote:
> >> Hi everybody,
> >> Every now and then I wish we had namespaces. What's the simplest
> >> namespace-like thing that could allows us to simultaneously load two
> >> packages with clashing class names?
> >>
> >> I've been thinking that it might be reasonable to make packages have
> >> independent namespaces. Nothing complex like VW's, just Smalltalk for
> >> the base image and then a global name in Smalltalk for each package
> >> namespace, and package classes are accessible via sending a message to
> >> its namespace. For example, if Morphic was an external package,
> >> loading it would create a namespace named #Morphic in Smalltalk, and
> >> the classes in the Morphic package would be compiled using this
> >> namespace instead of Smalltalk to lookup globals, and it would
> >> delegate lookups to Smalltalk if it doesn't know the requested keys.
> >> After loading the package you could use the class HandMorph directly
> >> within methods compiled in the Morphic package, but outside of it (in
> >> methods belonging to classes in the base image or in other packages)
> >> you would have to do
> >>      Morphic at: #HandMorph
> >> or perhaps for convenience as a message like VW:
> >>      Morphic HandMorph
> >>
> >> Has anyone attempted to do anything like this? I just looked around
> >> for five minutes and the impression I get is that it would be
> >> non-trivial, there are a lots of references to Smalltalk and probably
> >> a lot of subtleties to make all the tools work well. What do you think?
> >>
> >> Thanks,
> >> Luciano
> >>
> >>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190521/26edbac7/attachment.html>


More information about the Cuis-dev mailing list