Environment declarations vs bindings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

Hannes Hirzel
Frank,

you write

'Environments abstracts, and makes uniform, the binding of names to
variables (which includes classes and globals).

the implementing of Environments focuses attention on a often
neglected part of programming.'

This is what we are looking for. An explanation of the _concept_
behind environments. This concept is not obvious for most people here
on the list......

On 10/1/16, Frank Shearar <[hidden email]> wrote:

> On 30 September 2016 at 14:36, Chris Muller <[hidden email]> wrote:
>
>> >> I don't like the idea of CurrentEnvironment at all. IMO global state
>> >> stinks.
>> >> It would mean that a lotta behavior would change by simply switching
>> >> one
>> >> shared variable...
>> >> I see it more like a not so clever workaround to make tools still work
>> in
>> >> presence of environments with minimal changes.
>> >
>> >
>> > Global state does indeed stink, which is why Environments is so nice,
>> > because "global" isn't global anymore.
>>
>> This deserves some qualification.  Its true that writable globals
>> stink, you never know what state its going to be in, and updating it
>> introduces contention, etc.  However, Class names don't suddenly point
>> to a different class object within the context of a running
>> application, and no one ever replaces Smalltalk with a new instance.
>> These globals are just "there" -- read-only bindings which don't
>> suffer the stinky issues associated with writable globals.
>>
>> I'm glad Nicolas started the other thread asking "what's it for?"  To
>> me, that's the most important question -- is there something actually
>> truly useful gained in exchange for complicating the language and
>> tools?  Is it only about everyone being able to have elegant,
>> prefix-less class names all loaded into one image?  Most of the
>> use-cases mentioned in this and the other threads were just "cool ways
>> to handle a one-off problem."
>>
>> For the real world, we have been wanting smaller, more modular images.
>> The conditions of having less code and responsibility in those smaller
>> images bodes them less likely to benefit from Environments.  Multiple
>> small images passing messages over the network lets those Smalltalk
>> applications run on multiple processor cores, compared to one
>> monolithic image with all the code loaded and disambiguated via a
>> hierarchy of Environment imports/exports and running on just one
>> process core.
>>
>> In 15 years, I think I've had just one name collision between classes
>> of different packages (neither of which used prefixes).  I think I
>> simply renamed one of them.  Dynamic system.  With Environments, I
>> would still have had to write some code to do various
>> imports/exports/renames, etc.. and so it doesn't actually save me any
>> development effort.  I guess it boils down to letting me keep pretty,
>> but ambiguous, names in the code.  But, I actually prefer prefixes...
>>
>> Not trying to be a party pooper, but complexity is commonplace,
>> simplicity is rare.  If we still have a simple system, we should value
>> that aspect and try to keep it that way.  At least _optionally_...
>>
>> Best,
>>   Chris
>>
>
> Well, there's simple, and there's simplistic, and these are not the same
> thing. Environments abstracts, and makes uniform, the binding of names to
> variables (which includes classes and globals). Instead of the single, and
> therefore specialised, and therefore apt to make klunky, mapping of names
> to things, the implementing of Environments focuses attention on a often
> neglected part of programming.
>
> But I've had these discussions before, and I don't have the energy to
> pursue them, therefore I don't really have a voice in the matter.
>
> I am, however, sick to death of things being invented in Smalltalk, only to
> die in its birthplace, while the rest of the world sees value, and
> wholeheartedly takes up the concept. I'm not saying you're doing this now,
> Chris, but I have often, often heard people in the Squeak community say
> "oh, it was Too Complicated, it Wasn't Simple, Not Worth It" while Ruby,
> Perl, Clojure, Fortress, Scala all say "yep, great idea, thanks!".
>
> frank
>

Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

Stéphane Rollandin
> This is what we are looking for. An explanation of the _concept_
> behind environments. This concept is not obvious for most people here
> on the list......

Right. I have been asking for documentation, and got silence for an
answer. How serious is that ? We need to RTFM.

Stef


Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

Jakob Reschke-2
In reply to this post by Hannes Hirzel
2016-10-02 1:42 GMT+02:00 Stéphane Rollandin <[hidden email]>:
> We need to RTFM.

Apparently, we first have to WTFM (or expand and refactor it at least).

What is already there are the class comment in Environment and these Wiki pages:
http://wiki.squeak.org/squeak/6218
http://wiki.squeak.org/squeak/6219
http://wiki.squeak.org/squeak/6220
...and some mailing list threads that contain previous discussions or
code snippets:
http://forum.world.st/Environments-td4636629.html
http://forum.world.st/The-Inbox-Monticello-fbs-581-mcz-td4731884.html
(...and probably others...)

But for various reasons already mentioned, that did not suffice for me
to get started using Environments, and it seems I am not the only one.
Besides, I do not consider the mailing list archives a good place for
documentation, especially if one does not know the right search
keywords.

Jakob

Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

timrowledge
In reply to this post by Stéphane Rollandin

> On 01-10-2016, at 4:42 PM, Stéphane Rollandin <[hidden email]> wrote:
>
>> This is what we are looking for. An explanation of the _concept_
>> behind environments. This concept is not obvious for most people here
>> on the list......
>
> Right. I have been asking for documentation, and got silence for an answer. How serious is that ? We need to RTFM.

There must of course be a decent manual (or collection of writings that constitute a manual) because *nobody* would do something stupid like adding a bunch of code that doesn’t have an obvious reason for being or an explanation of how to use it, or examples. It just couldn’t happen.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Four wheels move the body. Two wheels move the soul


Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

Stéphane Rollandin

> There must of course be a decent manual (or collection of writings that constitute a manual) because *nobody* would do something stupid like adding a bunch of code that doesn’t have an obvious reason for being or an explanation of how to use it, or examples. It just couldn’t happen.

Ok, I know this is Squeak's tradition.

The fact is I'm genuinely interested in Environments, as I used to be
interested in Traits but never did anything with it because of the
missing support.

What a waste.


Stef


Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

Edgar De Cleene
We should go  Cuis simpler Smalltalk.
We NEED a Kernel and a Core Squeak without experiments.
And people should be able to load Traits or Environments or SeeWhatCoolIsThese if they choose to do so.
And the rest of us live without pain.

By the way Alejandro Reimondo have his old Fenix image builder as subclass of Environments of Dan Ingalls and Guille Polito and Pharo guys have his Kernel building tool as kind of Environments .

Edgar

> On Oct 3, 2016, at 02:49, Stéphane Rollandin <[hidden email]> wrote:
>
>
>> There must of course be a decent manual (or collection of writings that constitute a manual) because *nobody* would do something stupid like adding a bunch of code that doesn’t have an obvious reason for being or an explanation of how to use it, or examples. It just couldn’t happen.
>
> Ok, I know this is Squeak's tradition.
>
> The fact is I'm genuinely interested in Environments, as I used to be interested in Traits but never did anything with it because of the missing support.
>
> What a waste.
>
>
> Stef
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

Levente Uzonyi
On Mon, 3 Oct 2016, Edgar De Cleene wrote:

> We should go  Cuis simpler Smalltalk.

Sure. Just port Squeak on top of Cuis without losing functionality and
performance.

Levente

> We NEED a Kernel and a Core Squeak without experiments.
> And people should be able to load Traits or Environments or SeeWhatCoolIsThese if they choose to do so.
> And the rest of us live without pain.
>
> By the way Alejandro Reimondo have his old Fenix image builder as subclass of Environments of Dan Ingalls and Guille Polito and Pharo guys have his Kernel building tool as kind of Environments .
>
> Edgar
>
>> On Oct 3, 2016, at 02:49, Stéphane Rollandin <[hidden email]> wrote:
>>
>>
>>> There must of course be a decent manual (or collection of writings that constitute a manual) because *nobody* would do something stupid like adding a bunch of code that doesn’t have an obvious reason for being or an explanation of how to use it, or examples. It just couldn’t happen.
>>
>> Ok, I know this is Squeak's tradition.
>>
>> The fact is I'm genuinely interested in Environments, as I used to be interested in Traits but never did anything with it because of the missing support.
>>
>> What a waste.
>>
>>
>> Stef
>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Environment declarations vs bindings

timrowledge
In reply to this post by Stéphane Rollandin

> On 02-10-2016, at 10:49 PM, Stéphane Rollandin <[hidden email]> wrote:
>
>
>> There must of course be a decent manual (or collection of writings that constitute a manual) because *nobody* would do something stupid like adding a bunch of code that doesn’t have an obvious reason for being or an explanation of how to use it, or examples. It just couldn’t happen.
>
> Ok, I know this is Squeak's tradition.
>
> The fact is I'm genuinely interested in Environments, as I used to be interested in Traits but never did anything with it because of the missing support.
>
> What a waste.

Exactly my problem. This was a lot of work and involved a lot of deep futzing and must have had some serious discussion about the design, intent, implementation and usage before anyone agreed to bring it into the main system - surely? Without tool support, examples, descriptions and so on it will end up the same way as Traits and so many other neat ideas.

It doesn’t matter a damn how good an idea is - if it can’t be described so other people can make sense of it and use it (hmm, we could call it ‘documentation’) then it doesn’t exist in any meaningful sense.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: SD: Self Destruct



Reply | Threaded
Open this post in threaded view
|

re: Environment declarations vs bindings

Craig Latta
In reply to this post by Nicolas Cellier

Hi--

     We don't need a system dictionary at all. We can make each class
responsible for its own name literal, use subclass/metaclass references
for reachability, and make all other globals the responsibility of some
class. Every class can have any name; the execution machinery doesn't
care. Other metadata about classes (e.g., author) can be used to
disambiguate their names when compiling sources. We can store all that
metadata in a module system, to manage the history of all versions of
all classes and methods in the system.

     The Naiad module system that I wrote[1] implements this. I've
adapted it to the latest Squeak and plan to release it this month.


-C

[1] http://thiscontext.com/naiad

--
Craig Latta
Black Page Digital
Amsterdam | San Francisco
[hidden email]
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

re: Environment declarations vs bindings

Craig Latta
In reply to this post by Edgar De Cleene

Hi--

     Edgar writes:

> We NEED a Kernel and a Core Squeak without experiments. And people
> should be able to load Traits or Environments or SeeWhatCoolIsThese
> if they choose to do so. And the rest of us live without pain.
>
> By the way Alejandro Reimondo have his old Fenix image builder as
> subclass of Environments of Dan Ingalls and Guille Polito and Pharo
> guys have his Kernel building tool as kind of Environments.

     I have adapted the Naiad module system[1] to the latest Squeak, and
plan to release it this month. Naiad enables loading and unloading
modules, so you can maintain a minimal system without experiments.


-C

[1] http://thiscontext.com/naiad

--
Craig Latta
Black Page Digital
Amsterdam | San Francisco
[hidden email]
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

re: Environment declarations vs bindings

Edgar De Cleene
Glad see you still work on this


On 10/4/16, 6:14 AM, "Craig Latta" <[hidden email]> wrote:

>      I have adapted the Naiad module system[1] to the latest Squeak, and
> plan to release it this month. Naiad enables loading and unloading
> modules, so you can maintain a minimal system without experiments.
>
>
> -C
>
> [1] http://thiscontext.com/naiad



Reply | Threaded
Open this post in threaded view
|

re: Environment declarations vs bindings

Chris Muller-3
In reply to this post by Craig Latta
Hi Craig, you mentioned making each class responsible for its own name
literal, which is fine for when you have a reference to a class and
want to know its name.

How about the use-case when all you have is a name String, but want to
get the (correct) Class object?  Are your 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).  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?

I'm looking forward to your release!


On Tue, Oct 4, 2016 at 4:14 AM, Craig Latta <[hidden email]> wrote:

>
> Hi--
>
>      We don't need a system dictionary at all. We can make each class
> responsible for its own name literal, use subclass/metaclass references
> for reachability, and make all other globals the responsibility of some
> class. Every class can have any name; the execution machinery doesn't
> care. Other metadata about classes (e.g., author) can be used to
> disambiguate their names when compiling sources. We can store all that
> metadata in a module system, to manage the history of all versions of
> all classes and methods in the system.
>
>      The Naiad module system that I wrote[1] implements this. I've
> adapted it to the latest Squeak and plan to release it this month.
>
>
> -C
>
> [1] http://thiscontext.com/naiad
>
> --
> Craig Latta
> Black Page Digital
> Amsterdam | San Francisco
> [hidden email]
> +31 6 2757 7177 (SMS ok)
> + 1 415 287 3547 (no SMS)
>
>

Reply | Threaded
Open this post in threaded view
|

re: enumerating classes with Naiad (was "Environment declarations vs bindings")

Craig Latta

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
parallelized.

> 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!

     Thanks!


-C

--
Craig Latta
Black Page Digital
Amsterdam | San Francisco
[hidden email]
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


12