to be more specific what I mean because apparently I may know nothing about
namespaces , I was talking in terms of Python's module and package system

even though python uses special syntax "import" to import a module, a
source file, the real functionality is actually a method but of an object
dealing with the handling of modules and packages , packages are basically
file directories containing mutliple modules

as soon as you do the import the syntax is the usual object syntax

so

Dog.bark()

can be anything
1) A class method call, Dog being the class
2) A instance method call, Dog being the instance
3) or a function call, Dog being the function , which is also an object
(methods in python are basically function object taking the reference to an
instance as first argument, hence why the weird syntax of adding self as
first argument when we define instance method) and Dog is the module
imported.

of course in case (3) you can collapse the module "name" so you can do only
bark() if you import via "from Dog import *" which means from module Dog
import every object.
But from import is frown upon in the python world because obviously it
makes it easier to have name collision which is what the module system try
to avoid in the first place.

So the equivelant of pharo would be

MyModule MyInstance myMessage:

or if you include packages as well

MyPackage MyModule MyInstance myMessage:

which follows pharo syntax and OO design. That's my general idea at least.

Please enlighten me :)

On Fri, Oct 13, 2017 at 12:30 PM Dimitris Chloupis <kilon.al...@gmail.com>
wrote:

> On Fri, Oct 13, 2017 at 11:31 AM Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
>
>> 2017-10-13 10:12 GMT+02:00 Dimitris Chloupis <kilon.al...@gmail.com>:
>>
>>> fair enough you think namespaces are not the right solution, what you
>>> think is the right solution then ?
>>>
>>
>> I told you. Namespaces are a solution, but they come with issues.
>>
>>
>
> Then I misunderstood you but I am geniouly interested in what those
> problems are and I think the infromation is something others will find
> interesting as well.
>
> No. In the HPC world, a common held position is that Fortran code is 30%
>> faster than C++.
>>
>
> Cannot even rememeber the last time a 3d graphics developers mentioned
> Fortran.I occasional frequent forums and mailing lists plus keeping in
> contact with Blender developers.
>
> I have heard that Fortran can outperform C++ in numeric computation around
> the percentage you mentioned but first time I heard that its generally
> faster.
>
> Language Benchmark seems to strongly disagree
>
> http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=ifc&lang2=gpp
>
> of its widely criticized but then what benchmark is not
>
>
>> Remember that part of my job is to write compilers.
>>
>>
> I knew that you write compilers (SmaCC) I did not realise you are a pro
> and especially on ones that generate highly optimised machine code
>
>
>> I'm also consider a guy to talk to when someone has deep issues with some
>> of the new features of C++... even if I don't do C++, I can often reframe
>> what the feature means in the overall scheme of programming languages.
>>
>
> On other hand I have close to zero experience on compilers
>  .
>
>
>> I find it very interesting. I consider that current compilers are very
>> good optimising code that is written in a language that obscures the
>> developper intent in the first place.
>>
>
> I lost you there, you mean compilers for other languages than C++ ?
>
> As I told you, I work in a world where performance is paramount and C++ is
>> strongly criticized for the fact its incidental complexity makes it very
>> very hard to reach or maintain performance levels (compared to Fortran,
>> say).
>>
>> Thierry
>>
>>
>
> And I "work" in a world that C++ is the undisputed king , that's 3d
> graphics , though I must admit I try to stick with Python as much as I can.
>
> In any case my point was that if namespaces can be done in a badly design
> language , should be possible in Pharo and easier. Not ease, just easier.
>
> Of course that's just a wild assumption but I hope this thread do not only
> disaprove my assumption but said a light in the real challanges of
> namespace implementation
>
>

Reply via email to