Pharo and Namespaces

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

Pharo and Namespaces

Torsten Bergmann
Since Colin opened a new thread on Squeak-dev about namespaces
together with an implementation for environments:

  http://lists.squeakfoundation.org/pipermail/squeak-dev/2012-June/164605.html

I thought it would be good to ask on Pharo too about the state.

What happened to the project from Germán Leiva
http://www.youtube.com/watch?v=n4I7fSVNX2A

I know it is always a time issue - but what is the overall plan?

Thx
T.
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Stéphane Ducasse
We are working on a module system but it takes time.

> Since Colin opened a new thread on Squeak-dev about namespaces
> together with an implementation for environments:
>
>  http://lists.squeakfoundation.org/pipermail/squeak-dev/2012-June/164605.html
>
> I thought it would be good to ask on Pharo too about the state.
>
> What happened to the project from Germán Leiva
> http://www.youtube.com/watch?v=n4I7fSVNX2A

we do not want class level namespace because this is the mess

>
> I know it is always a time issue - but what is the overall plan?
>
> Thx
> T.
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Stéphane Ducasse
In reply to this post by Torsten Bergmann
BTW we want to finish what we are doing before opening new actions.

> Since Colin opened a new thread on Squeak-dev about namespaces
> together with an implementation for environments:
>
>  http://lists.squeakfoundation.org/pipermail/squeak-dev/2012-June/164605.html
>
> I thought it would be good to ask on Pharo too about the state.
>
> What happened to the project from Germán Leiva
> http://www.youtube.com/watch?v=n4I7fSVNX2A
>
> I know it is always a time issue - but what is the overall plan?
>
> Thx
> T.
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

jgfoster
In reply to this post by Stéphane Ducasse
On Jun 26, 2012, at 12:08 AM, Stéphane Ducasse wrote:

>> What happened to the project from Germán Leiva
>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>
> we do not want class level namespace because this is the mess

As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.

James Foster


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Stéphane Ducasse
>>> What happened to the project from Germán Leiva
>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>
>> we do not want class level namespace because this is the mess
>
> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.


We do not want to have class name resolution at the granularity of a class.
Why because it means that in the same package reading the code containing a class Foo could be a different one.
I'm saying that since years.


Now as I said our plate is FULL. If colin has cycle perfect for him.
Namespaces are not urgent.

So far we have on our roadmap
        - new compiler
        - cleaning it
        - all the tools been rewritten
        - new canvas
        - new event
        - systemNotification -> announcement
        - package and package metadata
        - UIBuilder
        - FileSystem integration
        - validation process of configuration and distributions
        ...
and I guess I forgot some works. So let us focus on finishing. Because starting something is the easiest part.
Finishing is the key part. 5% but 80% of the importance because if the last 5% are not done nothing is really done.
       


>
> James Foster
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

jgfoster
On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:

>>>> What happened to the project from Germán Leiva
>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>
>>> we do not want class level namespace because this is the mess
>>
>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>
> We do not want to have class name resolution at the granularity of a class.

And are you saying this because you think Germán's implementation does this?

> Why because it means that in the same package reading the code containing a class Foo could be a different one.

I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?

> I'm saying that since years.

I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.


Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur. This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole. In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons) or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.

If you don't have time to discuss this in depth I would be less frustrated if you would wait to say it is wrong until you have time to explain why.

James Foster


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Schwab,Wilhelm K
+1  on not adding syntax.  Never do to a language that which can be done with the language.



________________________________________
From: [hidden email] [[hidden email]] on behalf of James Foster [[hidden email]]
Sent: Tuesday, June 26, 2012 3:30 PM
To: [hidden email]
Subject: Re: [Pharo-project] Pharo and Namespaces

On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:

>>>> What happened to the project from Germán Leiva
>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>
>>> we do not want class level namespace because this is the mess
>>
>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>
> We do not want to have class name resolution at the granularity of a class.

And are you saying this because you think Germán's implementation does this?

> Why because it means that in the same package reading the code containing a class Foo could be a different one.

I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?

> I'm saying that since years.

I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.


Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur. This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole. In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons) or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.

If you don't have time to discuss this in depth I would be less frustrated if you would wait to say it is wrong until you have time to explain why.

James Foster



Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Stéphane Ducasse
In reply to this post by jgfoster

On Jun 26, 2012, at 9:30 PM, James Foster wrote:

> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
>
>>>>> What happened to the project from Germán Leiva
>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>>
>>>> we do not want class level namespace because this is the mess
>>>
>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>>
>> We do not want to have class name resolution at the granularity of a class.
>
> And are you saying this because you think Germán's implementation does this?
>
>> Why because it means that in the same package reading the code containing a class Foo could be a different one.

>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
                                                                          ^^^^^

Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same
package importing another namespace.

> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?

No
I just say that changing binding of variables at the class level is not a good granularity. I do not want to have

Object subclass: #NameOfSubclass
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Bob'
>>> environment:



>> I'm saying that since years.
>
> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.

because this is a class level import.

> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.

Usually this is the class of the method.

> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.

no this is a question of language design.

> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)

No we do not want to have that.
We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know
that this Point is from Core when that one is from MyCore. If I want both, at the module import level I write

        Import: Point from: core as: CorePoint;
        import: Point from: dev as: DevPoint;
       
> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.

I dislike them both.
A module should provide a certain level of encapsulation, else naming convention is good enough.
Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.

> If you don't have time to discuss this in depth I would be less frustrated if you would wait to say it is wrong until you have time to explain why.
>
> James Foster
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

camille teruel
As far as I understand the video of Germán's implementation, the import's granularity is at the environment level, for both source-side and sink-side, not at class level: he imports a whole environment into another. All the class defined inside the source environment become accessible to the sink environment without prefixing with the source environment name. 

IMO, the problems of importing a whole namespace into another are:
  • you have to manage name clashes. 
Ex: you have a namespace A that imports namespaces B and C developped by some other guys, then a guy add a class to B whose name is already used in C for another class that A uses => A is now broken.
  • you can't see how many dependencies a namespace has without doing some code analysis.

However if you makes your imports class by class, you can see how many dependency a namespace has and you are always sure that your code refers to the classes you want.

I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
Object subclass: #NameOfSubclass
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Bob'
>>>     environment:

You have to specify in which environment a class is at some point. If you look at class builder, there is the super long method: #name:inEnvironment:subclassOf:...... 
For the moment, the environment is always the system dictionary. But if you have several environements, you'll have to add the extra argument you don't want when creating new classes.

BTW, do we want to have just namespace categories or a hierachical namespace imbrication?
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Frank Shearar-3
On 26 June 2012 22:17, camille teruel <[hidden email]> wrote:

> As far as I understand the video of Germán's implementation, the import's
> granularity is at the environment level, for both source-side and sink-side,
> not at class level: he imports a whole environment into another. All the
> class defined inside the source environment become accessible to the sink
> environment without prefixing with the source environment name.
>
> IMO, the problems of importing a whole namespace into another are:
>
> you have to manage name clashes.
>
> Ex: you have a namespace A that imports namespaces B and C developped by
> some other guys, then a guy add a class to B whose name is already used in C
> for another class that A uses => A is now broken.
>
> you can't see how many dependencies a namespace has without doing some code
> analysis.
>
>
> However if you makes your imports class by class, you can see how many
> dependency a namespace has and you are always sure that your code refers to
> the classes you want.
>
>> I just say that changing binding of variables at the class level is not a
>> good granularity. I do not want to have
>> Object subclass: #NameOfSubclass
>>        instanceVariableNames: ''
>>        classVariableNames: ''
>>        poolDictionaries: ''
>>        category: 'Bob'
>> >>>     environment:
>
>
> You have to specify in which environment a class is at some point. If you
> look at class builder, there is the super long method:
> #name:inEnvironment:subclassOf:......
> For the moment, the environment is always the system dictionary. But if you
> have several environements, you'll have to add the extra argument you don't
> want when creating new classes.

No: you store the current environment in a dynamic variable.
ClassBuilder's convenience method checks the value of that variable,
and you're done.

If you look at the squeak-dev archives for today you'll see Colin
Putney's Environment prototype which does exactly that.

frank

> BTW, do we want to have just namespace categories or a hierachical namespace
> imbrication?

Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

jgfoster
In reply to this post by Stéphane Ducasse
On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:

> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
>
>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
>>
>>>>>> What happened to the project from Germán Leiva
>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>>>
>>>>> we do not want class level namespace because this is the mess
>>>>
>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>>>
>>> We do not want to have class name resolution at the granularity of a class.
>>
>> And are you saying this because you think Germán's implementation does this?
>>
>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
>
>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
>  ^^^^^
>
> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.

I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.

Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?

>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
>
> No
> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
>
> Object subclass: #NameOfSubclass
> instanceVariableNames: ''
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Bob'
>>>> environment:

Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?

>>> I'm saying that since years.
>>
>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
>
> because this is a class level import.

I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.

>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
>
> Usually this is the class of the method.

By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?

>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
>
> no this is a question of language design.

Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.

>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
>
> No we do not want to have that.
> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.

By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?

> If I want both, at the module import level I write
>
> Import: Point from: core as: CorePoint;
> import: Point from: dev as: DevPoint;

What object implements #'import:from:as:'?

>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
>
> I dislike them both.
> A module should provide a certain level of encapsulation, else naming convention is good enough.
> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.

You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.

I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.

If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?

What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?

Thanks for engaging in the discussion.

James Foster


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Stéphane Ducasse
James

sorry but I'm at home stopped for 10 days because of a burnout (linked partly to pharo and the business I want to spawn for the community).
We talked endlessly about namespaces and so far we lived happily without. Right now I will not talk about that. Read subsystem the paper of wirfs-brock
if you want to see what I would prefer to have. But we need to have a scientific approach to evaluate.
And yes I read the implementation two years ago.
Finally did you see the list of topics that I mention?
        - do you want to help in any of them to make pharo better?
        because we have to get them first and I need all my energy for them.

Stef


On Jun 27, 2012, at 12:25 AM, James Foster wrote:

> On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:
>
>> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
>>
>>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
>>>
>>>>>>> What happened to the project from Germán Leiva
>>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>>>>
>>>>>> we do not want class level namespace because this is the mess
>>>>>
>>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>>>>
>>>> We do not want to have class name resolution at the granularity of a class.
>>>
>>> And are you saying this because you think Germán's implementation does this?
>>>
>>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
>>
>>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
>>  ^^^^^
>>
>> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.
>
> I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.
>
> Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?
>
>>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
>>
>> No
>> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
>>
>> Object subclass: #NameOfSubclass
>> instanceVariableNames: ''
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'Bob'
>>>>> environment:
>
> Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?
>
>>>> I'm saying that since years.
>>>
>>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
>>
>> because this is a class level import.
>
> I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.
>
>>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
>>
>> Usually this is the class of the method.
>
> By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?
>
>>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
>>
>> no this is a question of language design.
>
> Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.
>
>>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
>>
>> No we do not want to have that.
>> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.
>
> By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?
>
>> If I want both, at the module import level I write
>>
>> Import: Point from: core as: CorePoint;
>> import: Point from: dev as: DevPoint;
>
> What object implements #'import:from:as:'?
>
>>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
>>
>> I dislike them both.
>> A module should provide a certain level of encapsulation, else naming convention is good enough.
>> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.
>
> You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.
>
> I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.
>
> If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?
>
> What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?
>
> Thanks for engaging in the discussion.
>
> James Foster
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

philippeback
Stephane,

Wow, there is a limit to your utter awesomeness... Take care!

On this namespace thing... Well, in fact, I found that nice with Java but at the end of the day, what matters is the modular bit. And we have that with packages and MC. We do no need the namespaces really. Prefixing the classes works and scales. Look at any Obj-C app, there are prefixes everywhere.... and it works well.

No having this additional level makes Pharo much more approachable for new people. And in order to get traction, this is important.

Phil



2012/6/27 Stéphane Ducasse <[hidden email]>
James

sorry but I'm at home stopped for 10 days because of a burnout (linked partly to pharo and the business I want to spawn for the community).
We talked endlessly about namespaces and so far we lived happily without. Right now I will not talk about that. Read subsystem the paper of wirfs-brock
if you want to see what I would prefer to have. But we need to have a scientific approach to evaluate.
And yes I read the implementation two years ago.
Finally did you see the list of topics that I mention?
       - do you want to help in any of them to make pharo better?
       because we have to get them first and I need all my energy for them.

Stef


On Jun 27, 2012, at 12:25 AM, James Foster wrote:

> On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:
>
>> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
>>
>>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
>>>
>>>>>>> What happened to the project from Germán Leiva
>>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>>>>
>>>>>> we do not want class level namespace because this is the mess
>>>>>
>>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>>>>
>>>> We do not want to have class name resolution at the granularity of a class.
>>>
>>> And are you saying this because you think Germán's implementation does this?
>>>
>>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
>>
>>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
>>                                                                        ^^^^^
>>
>> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.
>
> I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.
>
> Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?
>
>>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
>>
>> No
>> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
>>
>> Object subclass: #NameOfSubclass
>>      instanceVariableNames: ''
>>      classVariableNames: ''
>>      poolDictionaries: ''
>>      category: 'Bob'
>>>>>   environment:
>
> Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?
>
>>>> I'm saying that since years.
>>>
>>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
>>
>> because this is a class level import.
>
> I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.
>
>>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
>>
>> Usually this is the class of the method.
>
> By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?
>
>>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
>>
>> no this is a question of language design.
>
> Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.
>
>>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
>>
>> No we do not want to have that.
>> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.
>
> By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?
>
>> If I want both, at the module import level I write
>>
>>      Import: Point from: core as: CorePoint;
>>      import: Point from: dev as: DevPoint;
>
> What object implements #'import:from:as:'?
>
>>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
>>
>> I dislike them both.
>> A module should provide a certain level of encapsulation, else naming convention is good enough.
>> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.
>
> You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.
>
> I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.
>
> If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?
>
> What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?
>
> Thanks for engaging in the discussion.
>
> James Foster
>
>





--
Philippe Back
Dramatic Performance Improvements
Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027 Mail: [hidden email] | Web: http://philippeback.eu | Blog: http://philippeback.be

High Octane SPRL
rue cour Boisacq 101
1301 Bierges
Belgium
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Stéphane Ducasse

On Jun 27, 2012, at 9:24 AM, [hidden email] wrote:

> Stephane,
>
> Wow, there is a limit to your utter awesomeness... Take care!
>
> On this namespace thing... Well, in fact, I found that nice with Java but at the end of the day, what matters is the modular bit. And we have that with packages and MC. We do no need the namespaces really. Prefixing the classes works and scales. Look at any Obj-C app, there are prefixes everywhere.... and it works well.
>
> No having this additional level makes Pharo much more approachable for new people. And in order to get traction, this is important.

yes this is why we have camille (a master student student that is turning modules around in presence of class extensions and trying to see what would be the best solution)
now we should finish what we started.
Finishing is more difficult.

Stef

>
> Phil
>
>
>
> 2012/6/27 Stéphane Ducasse <[hidden email]>
> James
>
> sorry but I'm at home stopped for 10 days because of a burnout (linked partly to pharo and the business I want to spawn for the community).
> We talked endlessly about namespaces and so far we lived happily without. Right now I will not talk about that. Read subsystem the paper of wirfs-brock
> if you want to see what I would prefer to have. But we need to have a scientific approach to evaluate.
> And yes I read the implementation two years ago.
> Finally did you see the list of topics that I mention?
>        - do you want to help in any of them to make pharo better?
>        because we have to get them first and I need all my energy for them.
>
> Stef
>
>
> On Jun 27, 2012, at 12:25 AM, James Foster wrote:
>
> > On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:
> >
> >> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
> >>
> >>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
> >>>
> >>>>>>> What happened to the project from Germán Leiva
> >>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
> >>>>>>
> >>>>>> we do not want class level namespace because this is the mess
> >>>>>
> >>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
> >>>>
> >>>> We do not want to have class name resolution at the granularity of a class.
> >>>
> >>> And are you saying this because you think Germán's implementation does this?
> >>>
> >>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
> >>
> >>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
> >>                                                                        ^^^^^
> >>
> >> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.
> >
> > I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.
> >
> > Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?
> >
> >>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
> >>
> >> No
> >> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
> >>
> >> Object subclass: #NameOfSubclass
> >>      instanceVariableNames: ''
> >>      classVariableNames: ''
> >>      poolDictionaries: ''
> >>      category: 'Bob'
> >>>>>   environment:
> >
> > Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?
> >
> >>>> I'm saying that since years.
> >>>
> >>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
> >>
> >> because this is a class level import.
> >
> > I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.
> >
> >>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
> >>
> >> Usually this is the class of the method.
> >
> > By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?
> >
> >>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
> >>
> >> no this is a question of language design.
> >
> > Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.
> >
> >>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
> >>
> >> No we do not want to have that.
> >> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.
> >
> > By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?
> >
> >> If I want both, at the module import level I write
> >>
> >>      Import: Point from: core as: CorePoint;
> >>      import: Point from: dev as: DevPoint;
> >
> > What object implements #'import:from:as:'?
> >
> >>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
> >>
> >> I dislike them both.
> >> A module should provide a certain level of encapsulation, else naming convention is good enough.
> >> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.
> >
> > You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.
> >
> > I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.
> >
> > If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?
> >
> > What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?
> >
> > Thanks for engaging in the discussion.
> >
> > James Foster
> >
> >
>
>
>
>
>
> --
> Philippe Back
> Dramatic Performance Improvements
> Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027 Mail: [hidden email] | Web: http://philippeback.eu | Blog: http://philippeback.be
>
> High Octane SPRL
> rue cour Boisacq 101
> 1301 Bierges
> Belgium


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

philippeback
Yes, finishing things up is the hardest part. It is also the part that makes people and great art remembered.

As I wrote yesterday on Twitter: Execution is everything. Ideas are nothing.

I should add: and everything gets better with late binding :-p

Phil

2012/6/27 Stéphane Ducasse <[hidden email]>

On Jun 27, 2012, at 9:24 AM, [hidden email] wrote:

> Stephane,
>
> Wow, there is a limit to your utter awesomeness... Take care!
>
> On this namespace thing... Well, in fact, I found that nice with Java but at the end of the day, what matters is the modular bit. And we have that with packages and MC. We do no need the namespaces really. Prefixing the classes works and scales. Look at any Obj-C app, there are prefixes everywhere.... and it works well.
>
> No having this additional level makes Pharo much more approachable for new people. And in order to get traction, this is important.

yes this is why we have camille (a master student student that is turning modules around in presence of class extensions and trying to see what would be the best solution)
now we should finish what we started.
Finishing is more difficult.

Stef

>
> Phil
>
>
>
> 2012/6/27 Stéphane Ducasse <[hidden email]>
> James
>
> sorry but I'm at home stopped for 10 days because of a burnout (linked partly to pharo and the business I want to spawn for the community).
> We talked endlessly about namespaces and so far we lived happily without. Right now I will not talk about that. Read subsystem the paper of wirfs-brock
> if you want to see what I would prefer to have. But we need to have a scientific approach to evaluate.
> And yes I read the implementation two years ago.
> Finally did you see the list of topics that I mention?
>        - do you want to help in any of them to make pharo better?
>        because we have to get them first and I need all my energy for them.
>
> Stef
>
>
> On Jun 27, 2012, at 12:25 AM, James Foster wrote:
>
> > On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:
> >
> >> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
> >>
> >>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
> >>>
> >>>>>>> What happened to the project from Germán Leiva
> >>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
> >>>>>>
> >>>>>> we do not want class level namespace because this is the mess
> >>>>>
> >>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
> >>>>
> >>>> We do not want to have class name resolution at the granularity of a class.
> >>>
> >>> And are you saying this because you think Germán's implementation does this?
> >>>
> >>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
> >>
> >>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
> >>                                                                        ^^^^^
> >>
> >> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.
> >
> > I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.
> >
> > Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?
> >
> >>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
> >>
> >> No
> >> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
> >>
> >> Object subclass: #NameOfSubclass
> >>      instanceVariableNames: ''
> >>      classVariableNames: ''
> >>      poolDictionaries: ''
> >>      category: 'Bob'
> >>>>>   environment:
> >
> > Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?
> >
> >>>> I'm saying that since years.
> >>>
> >>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
> >>
> >> because this is a class level import.
> >
> > I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.
> >
> >>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
> >>
> >> Usually this is the class of the method.
> >
> > By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?
> >
> >>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
> >>
> >> no this is a question of language design.
> >
> > Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.
> >
> >>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
> >>
> >> No we do not want to have that.
> >> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.
> >
> > By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?
> >
> >> If I want both, at the module import level I write
> >>
> >>      Import: Point from: core as: CorePoint;
> >>      import: Point from: dev as: DevPoint;
> >
> > What object implements #'import:from:as:'?
> >
> >>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
> >>
> >> I dislike them both.
> >> A module should provide a certain level of encapsulation, else naming convention is good enough.
> >> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.
> >
> > You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.
> >
> > I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.
> >
> > If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?
> >
> > What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?
> >
> > Thanks for engaging in the discussion.
> >
> > James Foster
> >
> >
>
>
>
>
>
> --
> Philippe Back
> Dramatic Performance Improvements
> Mob: <a href="tel:%2B32%280%29%20478%20650%20140" value="+32478650140">+32(0) 478 650 140 | Fax: <a href="tel:%2B32%20%280%29%2070%20408%20027" value="+3270408027">+32 (0) 70 408 027 Mail: [hidden email] | Web: http://philippeback.eu | Blog: http://philippeback.be
>
> High Octane SPRL
> rue cour Boisacq 101
> 1301 Bierges
> Belgium





--
Philippe Back
Dramatic Performance Improvements
Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027 Mail: [hidden email] | Web: http://philippeback.eu | Blog: http://philippeback.be

High Octane SPRL
rue cour Boisacq 101
1301 Bierges
Belgium
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Germán Leiva
In reply to this post by Torsten Bergmann
Hi Torsten,

I'm not glad to say this but the current status of the project is ... dead.

The project's intention was to be a space/frame to develop an agreed implementation of namespaces using Environments as a starting point; but that never happened.

If Collin or anyone wants to share some thoughts about this implementation or just chitchat I'm fully available.

Despite this
  • I share all the questions raised by James 
  • If Stephane wants to share efforts to bring an implementation of namespaces/modules that satisfies his desires but that have some alignment with the fundamental ideas of Environments I'm all ears ('really big ones')
  • Now that I have my engineer's degree (Yeay!) and I have some time to research I want to do some experiments that uses these kind of namespaces regardless his integration with Pharo (stay tuned)
  • I will check Collin's namespace implementation too
Cheers

On Tue, Jun 26, 2012 at 3:22 AM, Torsten Bergmann <[hidden email]> wrote:
Since Colin opened a new thread on Squeak-dev about namespaces
together with an implementation for environments:y

 http://lists.squeakfoundation.org/pipermail/squeak-dev/2012-June/164605.html

I thought it would be good to ask on Pharo too about the state.

What happened to the project from Germán Leiva
http://www.youtube.com/watch?v=n4I7fSVNX2A

I know it is always a time issue - but what is the overall plan?

Thx
T.
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de




--
Germán Leiva
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Germán Leiva
In reply to this post by philippeback
OT: Late binding rocks!

On Wed, Jun 27, 2012 at 4:46 AM, [hidden email] <[hidden email]> wrote:
Yes, finishing things up is the hardest part. It is also the part that makes people and great art remembered.

As I wrote yesterday on Twitter: Execution is everything. Ideas are nothing.

I should add: and everything gets better with late binding :-p

Phil

2012/6/27 Stéphane Ducasse <[hidden email]>

On Jun 27, 2012, at 9:24 AM, [hidden email] wrote:

> Stephane,
>
> Wow, there is a limit to your utter awesomeness... Take care!
>
> On this namespace thing... Well, in fact, I found that nice with Java but at the end of the day, what matters is the modular bit. And we have that with packages and MC. We do no need the namespaces really. Prefixing the classes works and scales. Look at any Obj-C app, there are prefixes everywhere.... and it works well.
>
> No having this additional level makes Pharo much more approachable for new people. And in order to get traction, this is important.

yes this is why we have camille (a master student student that is turning modules around in presence of class extensions and trying to see what would be the best solution)
now we should finish what we started.
Finishing is more difficult.

Stef

>
> Phil
>
>
>
> 2012/6/27 Stéphane Ducasse <[hidden email]>
> James
>
> sorry but I'm at home stopped for 10 days because of a burnout (linked partly to pharo and the business I want to spawn for the community).
> We talked endlessly about namespaces and so far we lived happily without. Right now I will not talk about that. Read subsystem the paper of wirfs-brock
> if you want to see what I would prefer to have. But we need to have a scientific approach to evaluate.
> And yes I read the implementation two years ago.
> Finally did you see the list of topics that I mention?
>        - do you want to help in any of them to make pharo better?
>        because we have to get them first and I need all my energy for them.
>
> Stef
>
>
> On Jun 27, 2012, at 12:25 AM, James Foster wrote:
>
> > On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:
> >
> >> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
> >>
> >>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
> >>>
> >>>>>>> What happened to the project from Germán Leiva
> >>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
> >>>>>>
> >>>>>> we do not want class level namespace because this is the mess
> >>>>>
> >>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
> >>>>
> >>>> We do not want to have class name resolution at the granularity of a class.
> >>>
> >>> And are you saying this because you think Germán's implementation does this?
> >>>
> >>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
> >>
> >>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
> >>                                                                        ^^^^^
> >>
> >> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.
> >
> > I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.
> >
> > Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?
> >
> >>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
> >>
> >> No
> >> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
> >>
> >> Object subclass: #NameOfSubclass
> >>      instanceVariableNames: ''
> >>      classVariableNames: ''
> >>      poolDictionaries: ''
> >>      category: 'Bob'
> >>>>>   environment:
> >
> > Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?
> >
> >>>> I'm saying that since years.
> >>>
> >>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
> >>
> >> because this is a class level import.
> >
> > I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.
> >
> >>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
> >>
> >> Usually this is the class of the method.
> >
> > By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?
> >
> >>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
> >>
> >> no this is a question of language design.
> >
> > Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.
> >
> >>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
> >>
> >> No we do not want to have that.
> >> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.
> >
> > By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?
> >
> >> If I want both, at the module import level I write
> >>
> >>      Import: Point from: core as: CorePoint;
> >>      import: Point from: dev as: DevPoint;
> >
> > What object implements #'import:from:as:'?
> >
> >>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
> >>
> >> I dislike them both.
> >> A module should provide a certain level of encapsulation, else naming convention is good enough.
> >> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.
> >
> > You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.
> >
> > I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.
> >
> > If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?
> >
> > What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?
> >
> > Thanks for engaging in the discussion.
> >
> > James Foster
> >
> >
>
>
>
>
>
> --
> Philippe Back
> Dramatic Performance Improvements
> Mob: <a href="tel:%2B32%280%29%20478%20650%20140" value="+32478650140" target="_blank">+32(0) 478 650 140 | Fax: <a href="tel:%2B32%20%280%29%2070%20408%20027" value="+3270408027" target="_blank">+32 (0) 70 408 027 Mail: [hidden email] | Web: http://philippeback.eu | Blog: http://philippeback.be
>
> High Octane SPRL
> rue cour Boisacq 101
> 1301 Bierges
> Belgium





--
Philippe Back
Dramatic Performance Improvements
Mob: <a href="tel:%2B32%280%29%20478%20650%20140" value="+32478650140" target="_blank">+32(0) 478 650 140 | Fax: <a href="tel:%2B32%20%280%29%2070%20408%20027" value="+3270408027" target="_blank">+32 (0) 70 408 027 Mail: [hidden email] | Web: http://philippeback.eu | Blog: http://philippeback.be

High Octane SPRL
rue cour Boisacq 101
1301 Bierges
Belgium



--
Germán Leiva
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

jgfoster
In reply to this post by Stéphane Ducasse
Stef,

I'm sorry to hear about your burnout and I understand that you are not prepared to seriously discuss the issues that others have raised. I hope when the issue is raised again (it does seem to come up every year or so!) we can correct some of the misunderstandings that exist.

Best wishes,

James

On Jun 27, 2012, at 12:08 AM, Stéphane Ducasse wrote:

> James
>
> sorry but I'm at home stopped for 10 days because of a burnout (linked partly to pharo and the business I want to spawn for the community).
> We talked endlessly about namespaces and so far we lived happily without. Right now I will not talk about that. Read subsystem the paper of wirfs-brock
> if you want to see what I would prefer to have. But we need to have a scientific approach to evaluate.
> And yes I read the implementation two years ago.
> Finally did you see the list of topics that I mention?
> - do you want to help in any of them to make pharo better?
> because we have to get them first and I need all my energy for them.
>
> Stef
>
>
> On Jun 27, 2012, at 12:25 AM, James Foster wrote:
>
>> On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:
>>
>>> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
>>>
>>>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
>>>>
>>>>>>>> What happened to the project from Germán Leiva
>>>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>>>>>
>>>>>>> we do not want class level namespace because this is the mess
>>>>>>
>>>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>>>>>
>>>>> We do not want to have class name resolution at the granularity of a class.
>>>>
>>>> And are you saying this because you think Germán's implementation does this?
>>>>
>>>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
>>>
>>>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
>>>  ^^^^^
>>>
>>> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.
>>
>> I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.
>>
>> Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?
>>
>>>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
>>>
>>> No
>>> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
>>>
>>> Object subclass: #NameOfSubclass
>>> instanceVariableNames: ''
>>> classVariableNames: ''
>>> poolDictionaries: ''
>>> category: 'Bob'
>>>>>> environment:
>>
>> Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?
>>
>>>>> I'm saying that since years.
>>>>
>>>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
>>>
>>> because this is a class level import.
>>
>> I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.
>>
>>>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
>>>
>>> Usually this is the class of the method.
>>
>> By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?
>>
>>>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
>>>
>>> no this is a question of language design.
>>
>> Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.
>>
>>>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
>>>
>>> No we do not want to have that.
>>> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.
>>
>> By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?
>>
>>> If I want both, at the module import level I write
>>>
>>> Import: Point from: core as: CorePoint;
>>> import: Point from: dev as: DevPoint;
>>
>> What object implements #'import:from:as:'?
>>
>>>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
>>>
>>> I dislike them both.
>>> A module should provide a certain level of encapsulation, else naming convention is good enough.
>>> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.
>>
>> You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.
>>
>> I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.
>>
>> If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?
>>
>> What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?
>>
>> Thanks for engaging in the discussion.
>>
>> James Foster
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Stéphane Ducasse

On Jun 27, 2012, at 4:44 PM, James Foster wrote:

> Stef,
>
> I'm sorry to hear about your burnout and I understand that you are not prepared to seriously discuss the issues that others have raised. I hope when the issue is raised again (it does seem to come up every year or so!) we can correct some of the misunderstandings that exist.

yes we are discussing regularly that topic and Camille is writing a master where all the points are discussed and summarized with pros and cons.
Now for 20 we should finish all the open tracks we have.

Stef

>
> Best wishes,
>
> James
>
> On Jun 27, 2012, at 12:08 AM, Stéphane Ducasse wrote:
>
>> James
>>
>> sorry but I'm at home stopped for 10 days because of a burnout (linked partly to pharo and the business I want to spawn for the community).
>> We talked endlessly about namespaces and so far we lived happily without. Right now I will not talk about that. Read subsystem the paper of wirfs-brock
>> if you want to see what I would prefer to have. But we need to have a scientific approach to evaluate.
>> And yes I read the implementation two years ago.
>> Finally did you see the list of topics that I mention?
>> - do you want to help in any of them to make pharo better?
>> because we have to get them first and I need all my energy for them.
>>
>> Stef
>>
>>
>> On Jun 27, 2012, at 12:25 AM, James Foster wrote:
>>
>>> On Jun 26, 2012, at 12:51 PM, Stéphane Ducasse wrote:
>>>
>>>> On Jun 26, 2012, at 9:30 PM, James Foster wrote:
>>>>
>>>>> On Jun 26, 2012, at 11:19 AM, Stéphane Ducasse wrote:
>>>>>
>>>>>>>>> What happened to the project from Germán Leiva
>>>>>>>>> http://www.youtube.com/watch?v=n4I7fSVNX2A
>>>>>>>>
>>>>>>>> we do not want class level namespace because this is the mess
>>>>>>>
>>>>>>> As the sponsor for Germán's project, I have some interest in this topic. Stéphane has said a couple times that it is wrong but has never taken time to explain his objections.
>>>>>>
>>>>>> We do not want to have class name resolution at the granularity of a class.
>>>>>
>>>>> And are you saying this because you think Germán's implementation does this?
>>>>>
>>>>>> Why because it means that in the same package reading the code containing a class Foo could be a different one.
>>>>
>>>>>> Why because it means that in the same package, reading the code containing a class Foo could be a different one.
>>>>  ^^^^^
>>>>
>>>> Class level namespace import means that in a given class, a method accessing the variable Foo may end up pointing to another class Foo in a class in the same package importing another namespace.
>>>
>>> I still don't understand the definition. What do you mean by "another class Foo in a class." How can a class be in a class? Is Foo defined in two packages? Is the method on the class Foo? Should the name be resolved to the Foo in the package containing the method or to another Foo? Perhaps it would help if you named the sample classes, packages, and methods.
>>>
>>> Are you saying that if the namespace is allowed to be defined (or refined) at any level other than the package, then it is lumped into the bucket called "class level namespace import"?
>>>
>>>>> I don't understand your example. I don't know what you mean by "package reading the code." Are you describing a package that defines classes Foo and Bar, and a method in a class Bar that references the Foo in the same package? Are you providing this example because you think Germán's implementation does not support this use case?
>>>>
>>>> No
>>>> I just say that changing binding of variables at the class level is not a good granularity. I do not want to have
>>>>
>>>> Object subclass: #NameOfSubclass
>>>> instanceVariableNames: ''
>>>> classVariableNames: ''
>>>> poolDictionaries: ''
>>>> category: 'Bob'
>>>>>>> environment:
>>>
>>> Is it your impression that Germán's implementation requires this? If so, on what do you base that understanding? Have you looked at the code?
>>>
>>>>>> I'm saying that since years.
>>>>>
>>>>> I agree you have been saying that Germán's implementation isn't what you want. I just don't understand what you don't like about it.
>>>>
>>>> because this is a class level import.
>>>
>>> I still don't know what you mean by "class level import" or why you think Germán's implementation fits your definition.
>>>
>>>>> Name resolution of all variables (including Globals, of which Classes are a subset) should be part of a method compile. At the time a method is compiled, an 'environment' should be provided to the compiler that indicates how global name resolution should occur.
>>>>
>>>> Usually this is the class of the method.
>>>
>>> By "Usually" do you mean in pre-namespace Pharo? That is, the class is one of the factors that the compiler considers in doing name lookup? Is the "usual" approach good? Would it still be a factor considered by the compiler in an environment namespace regime?
>>>
>>>>> This is a tools issue and it should be possible to specify the default namespace environment for the method, for a method category, for a class, for a class category, for a package, and for the system as a whole.
>>>>
>>>> no this is a question of language design.
>>>
>>> Do you consider packages to be part of the language? I have always thought that one of the nice things about Smalltalk is how little of the development environment is actually part of the language. Being able to augment things through tools rather than changing the language seems to me to be a feature, not a bug.
>>>
>>>>> In addition, within a particular method it should be possible to explicitly reference a particular namespace environment, whether through syntax (dot or double colons)
>>>>
>>>> No we do not want to have that.
>>>> We want import to be specified at the border: i.e. during module import. Inside a module the world is flat and as a developer I do not want to know that this Point is from Core when that one is from MyCore.
>>>
>>> By "I do not want to know" do you mean "I do not want to be required to specify" or do you mean "I do not want anyone else to be able to find out"? If I want to know (say, to build tools), would that be okay? If I'm willing to let you remain ignorant of a global's source would you be willing to let me be enlightened?
>>>
>>>> If I want both, at the module import level I write
>>>>
>>>> Import: Point from: core as: CorePoint;
>>>> import: Point from: dev as: DevPoint;
>>>
>>> What object implements #'import:from:as:'?
>>>
>>>>> or through message sends (e.g., a Dictionary's #'at:' method). I prefer not to add new syntax and favor GemStone's implementation over that of VisualWorks.
>>>>
>>>> I dislike them both.
>>>> A module should provide a certain level of encapsulation, else naming convention is good enough.
>>>> Because else having namespace does not prevent you to have to declare that WA is not a namespace somebody else should use.
>>>
>>> You say that you "do not want to" allow code "to explicitly reference a particular namespace." Do you mean that arbitrary code should not be able to see a global that is not explicitly imported at package load time and that code should never be able to explicitly look at and manipulate namespaces. Really? This seems to me to be very much contrary to the existing spirit of reflection and introspection in Smalltalk and would make tools much more limited. I suspect that this is not really what you mean.
>>>
>>> I believe that a package should be allowed to provide a default environment, but I don't see the need to make it mandatory or exclusive. I believe that a class should be allowed to override the default environment, but I don't think it should be required.
>>>
>>> If a class is allowed (but not required) to override the default (provided by the package/module, for example), does that make it a "class level import" (and wrong, in your view)?
>>>
>>> What I understand from your statements so far is that Germán's approach allows too much flexibility (namespace can be specified not just at the package level but also at the class level and explicitly in code). You do not want to allow anyone to experiment with different levels of granularity. Is that it?
>>>
>>> Thanks for engaging in the discussion.
>>>
>>> James Foster
>>>
>>>
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Namespaces

Sean P. DeNigris
Administrator
In reply to this post by Germán Leiva
Germán Leiva wrote
OT: Late binding rocks!
Yes, and the latest binding would be to lookup at runtime. I have no idea what the performance hit would be, or if we would use all that power, but the idea is exciting :)
Cheers,
Sean
12