Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
December 2013
- 87 participants
- 1533 messages
Re: [Pharo-dev] about the Pharo Catalog
by Stéphane Ducasse
DamienCassou/Pier-Gutemberg
but I cannot manage the contributors.
Stef
Dec. 14, 2013
Re: [Pharo-dev] about the Pharo Catalog
by Stéphane Ducasse
I would love but I HATE smalltalkhub fucking model of managing members.
After 10 min trying to find how to add you to pier I gave up. May be I do not have the right.
I'm not in the Pier team but apparently I'm in the Pillar contributors but as contributor I can do nothing.
So when damien is back to internet connection he will add you.
Stef
>> please!
>
> I want to add support for catalogMainContact too
>
> I'll add it :) Can I ask for permissions to commit in the Catalog?
>
>
>
>>
>>
>> On Thu, Dec 12, 2013 at 10:57 AM, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>> Yes :)
>> In the output of the catalog itself
>>
>> https://ci.inria.fr/pharo-contribution/job/PharoProjectCatalog/HTML_Report/?
>>
>> There is probably a typo in the generator catalogkeyClassesAndExample => catalogKeyClassesAndExample
>> 1. Aconcagua
>> Please define a class method named catalogDescription returning a paragraph of description in the configuration class.
>>
>> 1.1. Keywords
>> Please define a class method named catalogKeywords returning an array of symbols in the configuration class.
>>
>> 1.2. Key classes and Implementations Notes
>> Please define a class method named catalogkeyClassesAndExample returning a paragraph describing the most important classes of the project and relevant information such as an example.
>>
>> 1.3. Key change logs
>> Please define a class method named catalogChangeLog returning a paragraph describing the most important changes in the configuration class. We suggest to use the following format:
>>
>> Version number - Date - topics
>>
>> ConfigurationOfXXX project version: 'xx' ) load
>> or simply
>>
>> Version number - Date - topics
>> Version number - Date - topics
>> Version number - Date - topics
>>
>>
>> On Dec 12, 2013, at 10:49 AM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>>
>>> is there a place where I can see the metadata methods I need to implement?
>>>
>>> Esteban
>>>
>>>
>>> On Thu, Dec 12, 2013 at 9:59 AM, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>>> Hi guys
>>>
>>> I really want to have an official catalog soon, so please add the missing metadata in your configurations.
>>> In addition I was discussing with robert pergl from Prague and he told me that
>>> when he has a problem with a package he does not know to whom he should report so
>>> I would like to add a catalogContact section.
>>> Any idea for improvement.
>>>
>>> Stef
>>>
>>
>>
>
>
Dec. 14, 2013
Re: [Pharo-dev] could we stop to create spaghetti code?
by Stéphane Ducasse
During the sprint (or before) I would like to look at this issue.
Now I'm recovering from another disc crash.
Stef
On Dec 12, 2013, at 12:56 PM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
> so far icons are all packed together into an icon pack.
>
> for example, Pharo3Icons and FamFamIcons.
>
> all tools should register their icons there, as extensions of a theme.
>
> then, a method:
>
>
> MyClass clas>>#icon
> ^ Smalltalk ui icons iconNamed: #myIcon
>
> can provide enough decoupling.
>
> then... is in tool developers the responsibility of follow the pattern (a pattern that is already there, no need of new stuff).
>
> Esteban
>
>
>
> On Thu, Dec 12, 2013 at 12:25 PM, Sebastian Sastre <sebastian(a)flowingconcept.com> wrote:
> >>
> >
> > I think the idea here is that maybe a class should have an icon. Independend of Nautilus.\
> > (either just icon or toolIcon).
> >
> > Marcus
> >
> >
>
> In a great environment you have icons and icon-sets defined by UX/UI designers.
>
> If we couple too much to code we'll create a barrier for that.
>
> If Nautilus (or whatever other browser) wants to display icons in classes and packages (which I found great) it should itself provide the code for that without system intrusion/pollution for the sake of being lazy
>
> Idea:
>
> Classes:
>
> NautilusIconSet
> HottishIcons
> CoolishIcons
>
>
> WhoeverDisplaysTheClassListItems>>iconFor: aClass
> "Returns the icon for aClass or a default icon"
>
> ^ aNautilusIconSet
> at: Integer
> ifAbsent:[self defaultIcon]
>
>
Dec. 14, 2013
Re: [Pharo-dev] Another thought about globals
by Marcus Denker
On 14 Dec 2013, at 16:15, Norbert Hartl <norbert(a)hartl.name> wrote:
>
> Am 14.12.2013 um 15:58 schrieb kilon alios <kilon.alios(a)gmail.com>:
>
>> yes sorry i meant global variables , the ones you define in workspace like a := 1.
>>
> Those arenât globals. Everything you do in the workspace is compiled as method (UndefinedObect>>#DoIt) and executed. There are only a handful of global values and there is the smalltalk dictionary where names can be looked up.
>
They live in the âbindingsâ ivar of Workspace.
When you compile code with the ârequestorâ not nil, it will put a OCRequestorScope into the scope chain.
This means that when Opal Semantic analysis asks the scope for the definition of a name, it will call
#lookupVar: on that scope, which is then doing:
(requestor bindingOf: name asSymbol) ifNotNil: [:assoc |
^ OCLiteralVariable new assoc: assoc; scope: self; yourself].
^ super lookupVar: name.
Which means that variables in the Workspace are compiled as literal variables (like globals),
but the binding comes from a dictionary that is in the ivar âbindingsâ of the Workspace.
Marcus
Dec. 14, 2013
Re: [Pharo-dev] Another thought about globals
by kilon alios
there is a copy paste ? wow pharo really rocks.
Thanks I will take a look at compile method.
On Sat, Dec 14, 2013 at 5:47 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
>
> Am 14.12.2013 um 16:17 schrieb kilon alios <kilon.alios(a)gmail.com>:
>
> ah ok my bad, I learned something new, thank you. Is it possible to embed
> this method to a new class ? lets say i like what i did in workspace and
> send it directly to a new class.
>
> Sure. You might never heard of it but we call it copy&paste. Works like
> charm. You just press cmd-a then cmd-câ¦.
>
> Or you decorate the content in the workspace with âMyClass compile:
> âmethodName
>
> [workspace content] â
> â
>
> Norbert
>
>
> On Sat, Dec 14, 2013 at 5:15 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
>
>>
>> Am 14.12.2013 um 15:58 schrieb kilon alios <kilon.alios(a)gmail.com>:
>>
>> yes sorry i meant global variables , the ones you define in workspace
>> like a := 1.
>>
>> Those arenât globals. Everything you do in the workspace is compiled as
>> method (UndefinedObect>>#DoIt) and executed. There are only a handful of
>> global values and there is the smalltalk dictionary where names can be
>> looked up.
>>
>> Norbert
>>
>>
>> On Sat, Dec 14, 2013 at 4:30 PM, Norbert Hartl <norbert(a)hartl.name>wrote:
>>
>>>
>>> Am 14.12.2013 um 12:09 schrieb kilon alios <kilon.alios(a)gmail.com>:
>>>
>>> why we need globals anyway ? why not use classes instead ?
>>>
>>>
>>> Class names are globals. A class is registered in a global namespace by
>>> its name. Names need to be looked up. How should it work in another way?
>>>
>>> Norbert
>>>
>>> The only use I see of globals is in workspace and I am sure we could
>>> find a way to automate or make the creation of classes faster inside
>>> workspace instead of using globals. Since OO is the very foundation of
>>> Pharo I don't see why one would need globals anyway. If that forces us to
>>> make object more flexible so be it. Way better than creating concepts that
>>> works with this tools and not work with the other tool or could work if you
>>> do this and that , ending up making things more complex than they need to
>>> be.
>>>
>>> I think it would make even the transition from workspace to browser
>>> easier, or even completely replace workspace with the browser.
>>>
>>> I always found workspace unnecessary anyway.
>>>
>>>
>>> On Sat, Dec 14, 2013 at 12:47 PM, Norbert Hartl <norbert(a)hartl.name>wrote:
>>>
>>>>
>>>>
>>>> > Am 14.12.2013 um 05:41 schrieb Igor Stasenko <siguctua(a)gmail.com>:
>>>> >
>>>> >
>>>> > As you may know, smalltalk global dictionary contain all symbols
>>>> defined globally,
>>>> > so you can access them directly in any piece of code i.e. when you
>>>> write:
>>>> >
>>>> > Object new
>>>> >
>>>> > it actually means 'send message #new to object, associated with
>>>> #Object name in globals dictionary.
>>>> >
>>>> > Most of globals are classes, but some of them , like Transcript,
>>>> World, Display etc are not.
>>>> > And i was always thinking there's something wrong with these globals
>>>> (actually there's multiple 'wrongs'), but finally, i think i can answer
>>>> myself, what is most basic wrong with them: they miss any form of
>>>> declaration.
>>>> >
>>>> > Most of variables in smalltalk require declaration, such as temps,
>>>> method arguments, instance variables , class variables, pool variables,
>>>> > but not globals.
>>>> > Even classes, from formal point of view do not require declaration,
>>>> > because actually the usual:
>>>> >
>>>> > Object subclass: #Collection
>>>> > instanceVariableNames: ''
>>>> > classVariableNames: 'MutexForPicking RandomForPicking'
>>>> > poolDictionaries: ''
>>>> > category: 'Collections-Abstract'
>>>> >
>>>> > is _definition_ but not declaration:
>>>> >
>>>> > Collection definition =>
>>>> >
>>>> > 'Object subclass: #Collection
>>>> > instanceVariableNames: ''''
>>>> > classVariableNames: ''MutexForPicking RandomForPicking''
>>>> > poolDictionaries: ''''
>>>> > category: ''Collections-Abstract'''
>>>> >
>>>> > in fact, it is just a message sent to 'Object' variable (at some
>>>> moment in the past) , and there's nothing
>>>> > in language which enforces the rule that evaluating such expression
>>>> must declare new global, named Collection, except from environment we're
>>>> working in.
>>>> >
>>>> > The absence of declaration for globals leads to following problems:
>>>> > since declaration point is not defined, all tools (including
>>>> compiler) assume that given name always been there, and always accessible.
>>>> Which leads to bootstrap problems.
>>>> > There's no way to determine if given piece of code (which uses some
>>>> global) will keep functioning properly, once you unload certain package. No
>>>> way to determine dependencies (and as consequence the order of code loading
>>>> during bootstrapping).
>>>> > Also, it is hard to determine, to which package certain global
>>>> belongs. While it is easy to tell for classes since they having category,
>>>> for globals like Transcript, Display etc, there's no way to tell anything.
>>>> > Piece of cake, you can say: since Display is instance of
>>>> DisplayScreen class, then such variable must belong to same package as
>>>> DisplayScreen, right?
>>>> > Wrong!
>>>> > Just for example, imagine i create variable named
>>>> MyWindowMousePosition, which will contain an instance of Point. Does it
>>>> means that such variable should belong to same package as Point class? I
>>>> guess not.
>>>> >
>>>> > So, to sum up, i think we should really think how to introduce a way
>>>> to declare globals in package-based ecosystem, where each global belongs to
>>>> certain package, and then since packages form dependency hierarchy, you can
>>>> easily detect whether you allowed to use certain global in given context or
>>>> not,
>>>> > to prevent forming dependency loops.
>>>> > But even if we will weaken contract and allow having dependency
>>>> loops, even in such case declarations can help us to clearly tell which
>>>> pieces of code will stop functioning properly, if package which declares
>>>> given variable are not present in system.
>>>> >
>>>> > The last aspect of bootstrapping problem is order of initialization,
>>>> > because declaring variable doesn't means you can use it right away,
>>>> > since it may be not properly initialized yet (otherwise we will be
>>>> forced to always use lazy initialization pattern).
>>>> >
>>>> > From this perspective, IMO package should not only have unordered
>>>> list of classes/symbols it declares/defines, but also contain information
>>>> in which order they must be initialized while loaded.
>>>> > From other side, i don't really like introducing too much formalism
>>>> and rules, and keep them as minimal as possible, following smalltalk spirit.
>>>> >
>>>> > What you think?
>>>>
>>>> I think packages should be first class citizens. A package once loaded
>>>> provides an environment/namespace/... that declares all the (exported)
>>>> symbols that should be accesible global. The smalltalk dictionary should
>>>> rather be a list of those namespaces/environments/... A package should also
>>>> have an initialize method where you could specify order of class
>>>> initialization if necessary ( and other things). Furthermore I would like
>>>> to see class initializers idempotent. So when loading a package the package
>>>> initialize is invoked first and then the class initializers, As they are
>>>> idempotent a possible double invocation is not a problem.
>>>> Dependencies are always hard. I would start thinking about metacello
>>>> defining all the possible dependencies regarding platforms, platform
>>>> versions etc. At load time there is only one dependency graph and that
>>>> could be reflected by the system. And this graph is not dependent on the
>>>> tool that loaded the code.
>>>> With this in place unloading should be rather easy. Dependencies can
>>>> warn the user about an harmful action and when the namespace is removed all
>>>> global definitions are automaticall removed.
>>>>
>>>> That is what I think. But I also think that there should be a
>>>> possibility to load something that doesn't end being global. A way to load
>>>> a package that isn't added to the global namespace (smalltalk dictionary)
>>>> but to a package namespace would also be very good. Not everything needs to
>>>> global but we can only load global things. That is a flaw in my opinion.
>>>> And it prevents cool things like loading multiple versions of a code in
>>>> separate packages.
>>>>
>>>> Norbert
>>>>
>>>
>>>
>>>
>>
>>
>
>
Dec. 14, 2013
NB FFI problem (calling an universal library)
by Esteban Lorenzano
Hi,
I'm trying to create some stuff with Gtk3, and because of it I have a call to gtk_init using NB-FFI. The call is like this:
gtkInitArgC: argc argV: argv
<primitive: #primitiveNativeCall module: #NativeBoostPlugin error: errorCode>
^ self nbCall: #( void gtk_init ( int *argc, char ***argv ) )
and well, I have a GtkLibrary copied from CairoLibraryLoader who loads the library.
system is 64bits, but Gtk3 libraries are "universal" compiled (it has both formats, i386 and x86_64 inside).
GtkLibrary loadGtkLibrary actually loads the library (it answers a pointer to it) and in fact, following the stack track NB is resolving correctly gtk_init symbol...
Now, the problem is that a call to
self gtkInitArgC: 0 argV: 0.
fails... with this stack trace:
NBFFICallout class>>signalError:
NBFFICallout class(NBNativeCodeGen class)>>handleFailureIn:nativeCode:
NBFFICalloutAPI>>function:module:
GtkApplication(Object)>>nbCall:
GtkApplication>>gtkInitArgC:argV:
NBFFICallout class(NBNativeCodeGen class)>>retrySend:
GtkApplication>>gtkInit
GtkApplication>>initialize
GtkApplication class(Behavior)>>new
MarsApplication>>platformApplication
MarsApplication>>stop
MarsApplication>>start
UndefinedObject>>DoIt
OpalCompiler>>evaluate
SmalltalkEditor>>evaluateSelectionAndDo:
SmalltalkEditor>>evaluateSelection
PluggableTextMorph>>doIt in Block: [ textMorph editor evaluateSelection ]
PluggableTextMorph>>handleEdit: in Block: [ result := editBlock value ]
TextMorphForEditView(TextMorph)>>handleEdit:
PluggableTextMorph>>handleEdit:
PluggableTextMorph>>doIt
SmalltalkEditor class>>buildSmalltalkEditorKeymappingsOn: in Block: [ :morph | morph doIt ]
BlockClosure>>cull:
BlockClosure>>cull:cull:
BlockClosure>>cull:cull:cull:
KMCategoryBinding>>completeMatch:buffer:
KMKeymap>>notifyCompleteMatchTo:buffer: in Block: [ :l | l completeMatch: self buffer: aBuffer ]
Array(SequenceableCollection)>>do:
KMKeymap>>notifyCompleteMatchTo:buffer:
KMKeymap>>onMatchWith:notify:andDo:
and #signalError: argument (errorCode) is nil.
any idea?
thanks,
Esteban
Dec. 14, 2013
Re: [Pharo-dev] strange bug when opening the morph menu
by Alexandre Bergel
Strange, I cannot reproduce the problem
Alexandre
On Dec 14, 2013, at 1:56 PM, Nicolai Hess <nicolaihess(a)web.de> wrote:
> Ah, that one.
> I thought you meant the window menu from the little arrow icon on the right.
>
>
> 2013/12/14 Tudor Girba <tudor(a)tudorgirba.com>
> What do you mean by slow?
>
> The problem is that the morph menu (Cmd+Shift+RightClick) does not open when the title is too large.
>
> Cheers,
> Doru
>
>
> On Sat, Dec 14, 2013 at 12:01 PM, Alexandre Bergel <alexandre.bergel(a)me.com> wrote:
> I am not sure how to reproduce this.
> I do not see anything slow
>
> Alexandre
>
>
> On Dec 14, 2013, at 11:10 AM, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>
> > Hi,
> >
> > Try this:
> >
> > 1. Execute
> > Workspace open
> > 2. Try to get the menu of the window
> > ==> it opens just fine
> >
> > 1. Execute
> > Workspace open label: (1 to: 100) asOrderedCollection asString
> > 2. Try to get the menu of the window
> > ==> it does not open properly (it opens large and it closes quickly) and the mouse remains in dragging mode
> >
> > I opened a bug report:
> > https://pharo.fogbugz.com/f/cases/12426/Morph-menu-has-strange-behavior-whe…
> >
> > Does anyone have any idea of why it happens?
> >
> > Cheers,
> > Doru
> >
> >
> > --
> > www.tudorgirba.com
> >
> > "Every thing has its own flow."
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Dec. 14, 2013
Re: [Pharo-dev] Another thought about globals
by Norbert Hartl
Am 14.12.2013 um 16:17 schrieb kilon alios <kilon.alios(a)gmail.com>:
> ah ok my bad, I learned something new, thank you. Is it possible to embed this method to a new class ? lets say i like what i did in workspace and send it directly to a new class.
>
Sure. You might never heard of it but we call it copy&paste. Works like charm. You just press cmd-a then cmd-câ¦.
Or you decorate the content in the workspace with âMyClass compile: âmethodName
[workspace content] â
â
Norbert
>
> On Sat, Dec 14, 2013 at 5:15 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
>
> Am 14.12.2013 um 15:58 schrieb kilon alios <kilon.alios(a)gmail.com>:
>
>> yes sorry i meant global variables , the ones you define in workspace like a := 1.
>>
> Those arenât globals. Everything you do in the workspace is compiled as method (UndefinedObect>>#DoIt) and executed. There are only a handful of global values and there is the smalltalk dictionary where names can be looked up.
>
> Norbert
>
>>
>> On Sat, Dec 14, 2013 at 4:30 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
>>
>> Am 14.12.2013 um 12:09 schrieb kilon alios <kilon.alios(a)gmail.com>:
>>
>>> why we need globals anyway ? why not use classes instead ?
>>>
>>
>> Class names are globals. A class is registered in a global namespace by its name. Names need to be looked up. How should it work in another way?
>>
>> Norbert
>>
>>> The only use I see of globals is in workspace and I am sure we could find a way to automate or make the creation of classes faster inside workspace instead of using globals. Since OO is the very foundation of Pharo I don't see why one would need globals anyway. If that forces us to make object more flexible so be it. Way better than creating concepts that works with this tools and not work with the other tool or could work if you do this and that , ending up making things more complex than they need to be.
>>>
>>> I think it would make even the transition from workspace to browser easier, or even completely replace workspace with the browser.
>>>
>>> I always found workspace unnecessary anyway.
>>>
>>>
>>> On Sat, Dec 14, 2013 at 12:47 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
>>>
>>>
>>> > Am 14.12.2013 um 05:41 schrieb Igor Stasenko <siguctua(a)gmail.com>:
>>> >
>>> >
>>> > As you may know, smalltalk global dictionary contain all symbols defined globally,
>>> > so you can access them directly in any piece of code i.e. when you write:
>>> >
>>> > Object new
>>> >
>>> > it actually means 'send message #new to object, associated with #Object name in globals dictionary.
>>> >
>>> > Most of globals are classes, but some of them , like Transcript, World, Display etc are not.
>>> > And i was always thinking there's something wrong with these globals (actually there's multiple 'wrongs'), but finally, i think i can answer myself, what is most basic wrong with them: they miss any form of declaration.
>>> >
>>> > Most of variables in smalltalk require declaration, such as temps, method arguments, instance variables , class variables, pool variables,
>>> > but not globals.
>>> > Even classes, from formal point of view do not require declaration,
>>> > because actually the usual:
>>> >
>>> > Object subclass: #Collection
>>> > instanceVariableNames: ''
>>> > classVariableNames: 'MutexForPicking RandomForPicking'
>>> > poolDictionaries: ''
>>> > category: 'Collections-Abstract'
>>> >
>>> > is _definition_ but not declaration:
>>> >
>>> > Collection definition =>
>>> >
>>> > 'Object subclass: #Collection
>>> > instanceVariableNames: ''''
>>> > classVariableNames: ''MutexForPicking RandomForPicking''
>>> > poolDictionaries: ''''
>>> > category: ''Collections-Abstract'''
>>> >
>>> > in fact, it is just a message sent to 'Object' variable (at some moment in the past) , and there's nothing
>>> > in language which enforces the rule that evaluating such expression must declare new global, named Collection, except from environment we're working in.
>>> >
>>> > The absence of declaration for globals leads to following problems:
>>> > since declaration point is not defined, all tools (including compiler) assume that given name always been there, and always accessible. Which leads to bootstrap problems.
>>> > There's no way to determine if given piece of code (which uses some global) will keep functioning properly, once you unload certain package. No way to determine dependencies (and as consequence the order of code loading during bootstrapping).
>>> > Also, it is hard to determine, to which package certain global belongs. While it is easy to tell for classes since they having category, for globals like Transcript, Display etc, there's no way to tell anything.
>>> > Piece of cake, you can say: since Display is instance of DisplayScreen class, then such variable must belong to same package as DisplayScreen, right?
>>> > Wrong!
>>> > Just for example, imagine i create variable named MyWindowMousePosition, which will contain an instance of Point. Does it means that such variable should belong to same package as Point class? I guess not.
>>> >
>>> > So, to sum up, i think we should really think how to introduce a way to declare globals in package-based ecosystem, where each global belongs to certain package, and then since packages form dependency hierarchy, you can easily detect whether you allowed to use certain global in given context or not,
>>> > to prevent forming dependency loops.
>>> > But even if we will weaken contract and allow having dependency loops, even in such case declarations can help us to clearly tell which pieces of code will stop functioning properly, if package which declares given variable are not present in system.
>>> >
>>> > The last aspect of bootstrapping problem is order of initialization,
>>> > because declaring variable doesn't means you can use it right away,
>>> > since it may be not properly initialized yet (otherwise we will be forced to always use lazy initialization pattern).
>>> >
>>> > From this perspective, IMO package should not only have unordered list of classes/symbols it declares/defines, but also contain information in which order they must be initialized while loaded.
>>> > From other side, i don't really like introducing too much formalism and rules, and keep them as minimal as possible, following smalltalk spirit.
>>> >
>>> > What you think?
>>>
>>> I think packages should be first class citizens. A package once loaded provides an environment/namespace/... that declares all the (exported) symbols that should be accesible global. The smalltalk dictionary should rather be a list of those namespaces/environments/... A package should also have an initialize method where you could specify order of class initialization if necessary ( and other things). Furthermore I would like to see class initializers idempotent. So when loading a package the package initialize is invoked first and then the class initializers, As they are idempotent a possible double invocation is not a problem.
>>> Dependencies are always hard. I would start thinking about metacello defining all the possible dependencies regarding platforms, platform versions etc. At load time there is only one dependency graph and that could be reflected by the system. And this graph is not dependent on the tool that loaded the code.
>>> With this in place unloading should be rather easy. Dependencies can warn the user about an harmful action and when the namespace is removed all global definitions are automaticall removed.
>>>
>>> That is what I think. But I also think that there should be a possibility to load something that doesn't end being global. A way to load a package that isn't added to the global namespace (smalltalk dictionary) but to a package namespace would also be very good. Not everything needs to global but we can only load global things. That is a flaw in my opinion. And it prevents cool things like loading multiple versions of a code in separate packages.
>>>
>>> Norbert
>>>
>>
>>
>
>
Dec. 14, 2013
Re: [Pharo-dev] Tell me about your workflow
by GOUBIER Thierry
To install gitfiletree in 3.0:
Install OSProcess from the configuration browser or 'do it' the following in a workspace
Gofer new
url: 'http://smalltalkhub.com/Pharo/MetaRepoForPharo30/main/';
package: 'ConfigurationOfOSProcess';
load.
((Smalltalk at: #ConfigurationOfOSProcess) project version: #stable) load
Gofer new
url: 'http://smalltalkhub.com/mc/ThierryGoubier/Alt30/main';
package: 'MonticelloFileTree-Git';
load
Then, in your Monticello browser, add repositories of type gitfiletree: in exactly the same way you would use filetree:. Beware: all save, copy, push and pull buttons on the GUI really do work and will call git on your behalf. If you only browse the repository, nothing will be committed or pushed.
The code to profile the writing time is the following :
| package dir mcR pV pVInfo |
dir := 'temp' asFileReference.
self assert: dir exists not.
dir ensureCreateDirectory.
self assert: dir isWritable.
pV := MCWorkingCopy forPackage: (package := MCPackage named: 'Roassal').
pVInfo := pV ancestry ancestors first.
mcR := MCFileTreeRepository new directory: dir.
TimeProfiler spyAllOn: [mcR
basicStoreVersion:
(MCVersion new
setPackage: package
info: pVInfo
snapshot: pV snapshot
dependencies: #())].
dir deleteAll
Change Roassal with the name of the package you want to use to test. It will save the package, profile it, and then delete the temporary directory used.
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com]
Date d'envoi : samedi 14 décembre 2013 16:10
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
On Dec 14, 2013, at 5:53 AM, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
I used to do FileTree save and then git commands in a Terminal, and missed a few times :
- Multiple version saves overwriting each other... because I forgot the git commit
- Unability to explore the git history
So, when I discussed with Dale, the author of FileTree, I saw the possibility to just add the git commands I needed on top of FileTree... the result is gitfiletree.
Performance improvements... I'm wondering. From the profiling data I have, if I make writing 4x faster, I will only make a save 1.04x faster (with gitfiletree and Roassal). If to write less I have to compute a lot, do file reads and compares, md5 hashes, a diff... I'll probably replace a lot of writes by a lot of CPU time in Pharo and maybe be slower overall (not to mention more error prone).
Would you be ready to run some profiling code on your set ? I can make a simple test case. I also wonder if writing less could make the git commit faster, in which case it could be valuable.
sure, send me the instructions
Also, if you want to try gitfiletree and your repository, what you can try is just browse your repository and browse versions of your packages (browse, not load: a browse will load your package code components but not compile the code).
ok, how should I install it?
(I noticed that the use of git archive makes gitfiletree slower at package read time, but, since this is dwarfed by the Pharo compilation time when loading such large packages, I don't care :)).
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>]
Date d'envoi : samedi 14 décembre 2013 01:54
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
get it.
In my workflow I don't do git operations from the image.
I do those from the terminal itself in the server and using SourceTree on development
As far as I know, the place that has most space for improvement is when filetree does the writes
On Dec 13, 2013, at 6:28 PM, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
Hi Sebastian,
sorry for the missing instructions... Had to board a train :)
In fact, it's not an alternative to filetree, instead it is an extension of filetree (and integrated into filetree, but not completely yet: no real configuration support, no windows support).
But yes, I should do a blog post somewhere about it :)
Meanwhile, in the train, I tested on Roassal and I profiled the writes...
Git is slow: on Roassal,
Waiting for the git commit : 67%
Writing the package to disk : 20% (writing the version file: 0.4%)
-> No real cost associated with the metadata
-> git is a lot more than I expected.
When I remove git (i.e. pure filetree)
Making a snapshot of Roassal: 28.9%
basic Store version : 67%
writeBasicDefinitions : 30% (of which half of it is reordering some stuff, not writing)
writeMethodHolderDefinitions: 27,8%
Of which writing to disk effectively is 19.7%
Conclusion: gitfiletree will look slow because git is slow on such large commits :( And I don't see much gains to be made on the writing (i.e. a format change won't help much), but a lot to loose (code complexity, bugs). Unless a format change may make it faster for git somehow?
I'll keep profiling, or give you the code to use to profile yourself ?
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>]
Date d'envoi : vendredi 13 décembre 2013 16:56
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
so you are working on an alternative to filetree
I'm pretty sure if you setup a page (or blog post) somewhere with clear and easy instructions to follow many people will try to use it
and, if proven good and reliable, adopt it
sebastian<https://about.me/sebastianconcept>
o/
On Dec 13, 2013, at 12:04 PM, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
gitfiletree can be had this way (filetree is already in 3.0, gitfiletree is in the filetree configuration for Pharo 3.0 but is a bit hard to load).
pharo/pharo pharo/Pharo.image confighttp://smalltalkhub.com/Pharo/MetaRepoForPharo30/main/ ConfigurationOfOSProcess --install=stable
pharo/pharo pharo/Pharo.image eval --save Gofer new url:\'http://smalltalkhub.com/mc/ThierryGoubier/Alt30/main\'\<http://smalltalkhub.com/mc/ThierryGoubier/Alt30/main/'/>; package: \'MonticelloFileTree-Git\'\; load
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>]
Date d'envoi : vendredi 13 décembre 2013 14:57
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
I can try a forced load on a 3.0 ignoring requisites for testing purposes
but I'm using this:
https://github.com/dalehenrich/filetree
I'm not sure what you're are using
can you clarify?
On Dec 13, 2013, at 11:43 AM, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
Ok. I'll try Roassal on a slow netbook to see. I don't see a factor of 10 difference between yours and Roassal, so I'll have a look.
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>]
Date d'envoi : vendredi 13 décembre 2013 14:32
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
A bit.
This is from today's current version (and is not all, it's only the two biggest packages):
(MCPackage named: 'flow') workingCopy packageInfo classes size. 363.
(MCPackage named: 'flow') workingCopy packageInfo coreMethods size. 4585.
(MCPackage named: 'airflowing') workingCopy packageInfo classes size. 377.
(MCPackage named: 'airflowing') workingCopy packageInfo coreMethods size. 5818.
On Dec 13, 2013, at 11:25 AM, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
Roassal: 3493
Number of versions in the package history: 733. Size of the version file: 202796.
Is that a lot lower than your count?
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>]
Date d'envoi : vendredi 13 décembre 2013 13:34
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
how many coreMethods?
On Dec 13, 2013, at 7:00 AM, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
Bad news. Roassal package directory has 355 entries (343 classes + a few extensions) and I don't see much of a slow down (on 3.0). It's not instantaneous, but with a bit of feedback, it doesn't seems long.
I'll do some profiling.
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de GOUBIER Thierry
Date d'envoi : jeudi 12 décembre 2013 17:07
à : Pharo Development List
Objet : [PROVENANCE INTERNET] Re: [Pharo-dev] Tell me about your workflow
Thanks for the pointers.
I'll look at Seaside/Moose/Mondrian and Roassal, because I need code I can load and save in an image without destroying the very image I use to test (which would happen if I load Pharo10 stuff in a 3.0 image ;) ).
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Yuriy Tymchuk [yuriy.tymchuk(a)me.com<mailto:yuriy.tymchuk@me.com>]
Date d'envoi : jeudi 12 décembre 2013 16:24
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
So if you want something big and with a lot of commits you can use Pharo* in general. Pharo10 has the most versions and Pharo30Inbox is the largest one. If you want some other projects then you heve to take a look at Seaside30, Mondrian, Moose, Glamour or Roassal.
Uko
On 12 Dec 2013, at 16:20, Yuriy Tymchuk <yuriy.tymchuk(a)me.com<mailto:yuriy.tymchuk@me.com>> wrote:
Pharo10 on SmalltalkHub is humongous. You can definitely do a stress test with it :)
Uko
On 12 Dec 2013, at 15:43, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
I would need a large project, composed of one or more packages, with more than 150~200 classes, which triggers the slow read and writing times Sebastian experience. And, probably, to be complete, a long and complex commit history in git (> 100 commits).
I'll keep in mind the idea of creating one randomly ;)
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Yuriy Tymchuk [yuriy.tymchuk(a)me.com<mailto:yuriy.tymchuk@me.com>]
Date d'envoi : jeudi 12 décembre 2013 15:37
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
Are you interested in a package or a project? I can provide you information based on size, etcâ¦
Uko
On 12 Dec 2013, at 15:30, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
I gave up running gitfiletree on 1.4 :(
It's possible to use gitfiletree from a 2.0 or a 3.0 image to browse your git repository, but testing the writing will be an issue.
My best chance would be to find a large enough package I can use on 2.0 or 3.0 to test and profile. Does anybody has a large enough package which could fit? Anything that doesn't require a NDA to read it, of course. Is Roassal large enough?
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>]
Date d'envoi : jeudi 12 décembre 2013 12:12
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
gee the big code package is airflowing which I have, quite conservatively, running on #14438 images
I load filetree like this:
Gofer new
url: 'http://ss3.gemstone.com/ss/FileTree';
package: 'ConfigurationOfFileTree';
load.
((Smalltalk at: #ConfigurationOfFileTree) project version: #'stable') load.
and it never complained
let me know
On Dec 12, 2013, at 3:53 AM, GOUBIER Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
If you would be ready to profile a package save on your repository, it would be great. In the mean time, I'll make available a special gitfiletree package to test. Which version of Pharo you are using? 2.0 or 3.0?
Regards,
Thierry
________________________________
De : Pharo-dev [pharo-dev-bounces(a)lists.pharo.org<mailto:pharo-dev-bounces@lists.pharo.org>] de la part de Sebastian Sastre [sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>]
Date d'envoi : mercredi 11 décembre 2013 17:09
à : Pharo Development List
Objet : Re: [Pharo-dev] Tell me about your workflow
ok, if saving is dumping all, then 3 is confirmed? After the first commit, I'd say so.
about 2, I don't know. I'm available to make tests and measure results
have a nice trip, keep us tuned about any progress
On Dec 11, 2013, at 2:09 PM, Goubier Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>> wrote:
Yes, you're right in the general case.
But a solution to that general problem will take time to be implemented (time I lack at the moment, sadly) and if the main gain is a few % because it's writing the version file and the metadata for methods which are the "slow" factors, then we'll have worked hard for nothing.
If you want to help, I'd really like to see either 2- or 3- confirmed. I can produce a special gitfiletree to remove writing the metadata, that you can try on a large project temporary copy; if the slow writing (and reading) is confirmed, then this is 3-
(But I'm leaving on a trip tomorrow early, so I have no idea of when I'll have the time to do that :( ).
Thierry
Le 11/12/2013 16:44, Sebastian Sastre a écrit :
Without entering in details, a cause for slow package write is dumping
all every time.
For that strategy, we already have the image save which is magically fast.
So, if we make something to scan the code and write only when it's
different from what's on disk, then we would be preventing tons of
redundant writes
sebastian <https://about.me/sebastianconcept>
o/
On Dec 11, 2013, at 1:43 PM, Goubier Thierry <thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>
<mailto:thierry.goubier@cea.fr>> wrote:
Le 11/12/2013 16:27, Esteban Lorenzano a écrit :
ah, and IMHO the problem is not about reading... is about writing (if it
has to write the metadata each time...).
But, personnaly, I don't know if this is the reason for the lack of
performance...
I have three hypothesis for Sebastian problem:
1 - Slow read time for version metadata
- Confirmed because of the 16 seconds wait time for reading the
package metadata in the repository browser.
2 - Slow metadata write
3 - Slow package write
I have an implemented solution for 1-, a very easy to implement for
2-, and none yet for 3-
So I'd really like to check if 3- is confirmed ;)
Thierry
Esteban
On Wed, Dec 11, 2013 at 4:24 PM, Esteban Lorenzano
<estebanlm(a)gmail.com<mailto:estebanlm@gmail.com> <mailto:estebanlm@gmail.com>
<mailto:estebanlm@gmail.com>> wrote:
Thierry, I know there is a working version... let me search...
(5 mins later)
here:
https://github.com/rjsargent/CypressReferenceImplementation
Dale says Richard made a metadata-less version.
We should take a look at that.
Esteban
On Wed, Dec 11, 2013 at 4:28 PM, Goubier Thierry
<thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>
<mailto:thierry.goubier@cea.fr><mailto:thierry.goubier@cea.fr>> wrote:
Esteban, Sebastian,
In the filetree code, you will find a format without metadata,
but it's not in use anymore.
If you use gitfiletree, it will write the metadata for
compatibility reasons with filetree, but it will never read it
back.
I'm pushing code to make filetree robust to absence of metadata,
but I haven't worked on it for a while.
gitfiletree has solved the problem of a slow metadata read. It
does not solve any performance problem associated with
writing, yet.
Thierry
Le 11/12/2013 16:12, Esteban Lorenzano a écrit :
I know there is a version of filetree without metadata (more
compelling
for projects that will never use other formats).
Dale told me that there was a preview somewhere, but I
didn't tested yet
(lack of time) and now I cannot find the mail...
Dale, can you re-send the link?
cheers,
Esteban
On Wed, Dec 11, 2013 at 4:08 PM, Sebastian Sastre
<sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>
<mailto:sebastian@flowingconcept.com>
<mailto:sebastian@flowingconcept.com>
<mailto:sebastian@__flowingconcept.com
<mailto:sebastian@flowingconcept.com>>> wrote:
I should breath before I type, but you probably already
got that I
meant /redundant writes/ (not reads)...
Anyway.. I was talking with Esteban and he mentions
some kind of
compatibility metadata.
If I'm going to give a leap of faith to filetree repos
to save code
why should I care about mcz compatibility? Paying a
toll for no
reason is evil.
Maybe we could make that optional so those who don't
extract value
from that feature can opt-out?
sebastian <https://about.me/__sebastianconcept
<https://about.me/sebastianconcept>>
o/
On Dec 11, 2013, at 12:44 PM, Sebastian Sastre
<sebastian(a)flowingconcept.com<mailto:sebastian@flowingconcept.com>
<mailto:sebastian@flowingconcept.com>
<mailto:sebastian@flowingconcept.com>
<mailto:sebastian@__flowingconcept.com
<mailto:sebastian@flowingconcept.com>>>
wrote:
Hi Thierry
On Dec 11, 2013, at 12:43 PM, Goubier Thierry
<thierry.goubier(a)cea.fr<mailto:thierry.goubier@cea.fr>
<mailto:thierry.goubier@cea.fr>
<mailto:thierry.goubier@cea.fr>
<mailto:thierry.goubier@cea.fr
<mailto:thierry.goubier@cea.fr>__>> wrote:
I have packages (in the order of hundreds
of classes) and save
delays
and package click delays are starting to
demand patience in a
way that
doesn't feel like the right path
Which operations ? I didn't remember noticing
much with 179
classes on a laptop without a SSD.
choose one. Just for clicking the package that will
should you
UUID, version and author I need to wait ~16
seconds. Sounds like a
lot of overhead for reading a small .json file.
But the write is the most worrisome
All that is with a SSD disk, otherwise save
delays would be
/way/ beyond
unacceptable
I'd like to know more, and understand the
reason, for sure. As
far as I know, filetree will rewrite the whole
package to disk
everytime... and maybe optimising that could be
the solution.
Well, that explains a lot. Writing all every time
is the lazy
thing that's okay for a prototype and temporary
code in a proof of
concept but that massive redundant reads certainly
doesn't sounds
like pro software. Specially for SSD's which has a
limited
quantity of writes
Thierry
sebastian
<https://about.me/__sebastianconcept
<https://about.me/sebastianconcept>>
o/
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps
Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92
<tel:%2B33%20%280%29%201%2069%2008%2032%2092>
<tel:%2B33%20%280%29%201%2069%__2008%2032%2092>
/ 83 95
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92
<tel:%2B33%20%280%29%201%2069%2008%2032%2092> / 83 95
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Dec. 14, 2013
Re: [Pharo-dev] Another thought about globals
by kilon alios
ah ok my bad, I learned something new, thank you. Is it possible to embed
this method to a new class ? lets say i like what i did in workspace and
send it directly to a new class.
On Sat, Dec 14, 2013 at 5:15 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
>
> Am 14.12.2013 um 15:58 schrieb kilon alios <kilon.alios(a)gmail.com>:
>
> yes sorry i meant global variables , the ones you define in workspace like
> a := 1.
>
> Those arenât globals. Everything you do in the workspace is compiled as
> method (UndefinedObect>>#DoIt) and executed. There are only a handful of
> global values and there is the smalltalk dictionary where names can be
> looked up.
>
> Norbert
>
>
> On Sat, Dec 14, 2013 at 4:30 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
>
>>
>> Am 14.12.2013 um 12:09 schrieb kilon alios <kilon.alios(a)gmail.com>:
>>
>> why we need globals anyway ? why not use classes instead ?
>>
>>
>> Class names are globals. A class is registered in a global namespace by
>> its name. Names need to be looked up. How should it work in another way?
>>
>> Norbert
>>
>> The only use I see of globals is in workspace and I am sure we could find
>> a way to automate or make the creation of classes faster inside workspace
>> instead of using globals. Since OO is the very foundation of Pharo I don't
>> see why one would need globals anyway. If that forces us to make object
>> more flexible so be it. Way better than creating concepts that works with
>> this tools and not work with the other tool or could work if you do this
>> and that , ending up making things more complex than they need to be.
>>
>> I think it would make even the transition from workspace to browser
>> easier, or even completely replace workspace with the browser.
>>
>> I always found workspace unnecessary anyway.
>>
>>
>> On Sat, Dec 14, 2013 at 12:47 PM, Norbert Hartl <norbert(a)hartl.name>wrote:
>>
>>>
>>>
>>> > Am 14.12.2013 um 05:41 schrieb Igor Stasenko <siguctua(a)gmail.com>:
>>> >
>>> >
>>> > As you may know, smalltalk global dictionary contain all symbols
>>> defined globally,
>>> > so you can access them directly in any piece of code i.e. when you
>>> write:
>>> >
>>> > Object new
>>> >
>>> > it actually means 'send message #new to object, associated with
>>> #Object name in globals dictionary.
>>> >
>>> > Most of globals are classes, but some of them , like Transcript,
>>> World, Display etc are not.
>>> > And i was always thinking there's something wrong with these globals
>>> (actually there's multiple 'wrongs'), but finally, i think i can answer
>>> myself, what is most basic wrong with them: they miss any form of
>>> declaration.
>>> >
>>> > Most of variables in smalltalk require declaration, such as temps,
>>> method arguments, instance variables , class variables, pool variables,
>>> > but not globals.
>>> > Even classes, from formal point of view do not require declaration,
>>> > because actually the usual:
>>> >
>>> > Object subclass: #Collection
>>> > instanceVariableNames: ''
>>> > classVariableNames: 'MutexForPicking RandomForPicking'
>>> > poolDictionaries: ''
>>> > category: 'Collections-Abstract'
>>> >
>>> > is _definition_ but not declaration:
>>> >
>>> > Collection definition =>
>>> >
>>> > 'Object subclass: #Collection
>>> > instanceVariableNames: ''''
>>> > classVariableNames: ''MutexForPicking RandomForPicking''
>>> > poolDictionaries: ''''
>>> > category: ''Collections-Abstract'''
>>> >
>>> > in fact, it is just a message sent to 'Object' variable (at some
>>> moment in the past) , and there's nothing
>>> > in language which enforces the rule that evaluating such expression
>>> must declare new global, named Collection, except from environment we're
>>> working in.
>>> >
>>> > The absence of declaration for globals leads to following problems:
>>> > since declaration point is not defined, all tools (including compiler)
>>> assume that given name always been there, and always accessible. Which
>>> leads to bootstrap problems.
>>> > There's no way to determine if given piece of code (which uses some
>>> global) will keep functioning properly, once you unload certain package. No
>>> way to determine dependencies (and as consequence the order of code loading
>>> during bootstrapping).
>>> > Also, it is hard to determine, to which package certain global
>>> belongs. While it is easy to tell for classes since they having category,
>>> for globals like Transcript, Display etc, there's no way to tell anything.
>>> > Piece of cake, you can say: since Display is instance of
>>> DisplayScreen class, then such variable must belong to same package as
>>> DisplayScreen, right?
>>> > Wrong!
>>> > Just for example, imagine i create variable named
>>> MyWindowMousePosition, which will contain an instance of Point. Does it
>>> means that such variable should belong to same package as Point class? I
>>> guess not.
>>> >
>>> > So, to sum up, i think we should really think how to introduce a way
>>> to declare globals in package-based ecosystem, where each global belongs to
>>> certain package, and then since packages form dependency hierarchy, you can
>>> easily detect whether you allowed to use certain global in given context or
>>> not,
>>> > to prevent forming dependency loops.
>>> > But even if we will weaken contract and allow having dependency loops,
>>> even in such case declarations can help us to clearly tell which pieces of
>>> code will stop functioning properly, if package which declares given
>>> variable are not present in system.
>>> >
>>> > The last aspect of bootstrapping problem is order of initialization,
>>> > because declaring variable doesn't means you can use it right away,
>>> > since it may be not properly initialized yet (otherwise we will be
>>> forced to always use lazy initialization pattern).
>>> >
>>> > From this perspective, IMO package should not only have unordered list
>>> of classes/symbols it declares/defines, but also contain information in
>>> which order they must be initialized while loaded.
>>> > From other side, i don't really like introducing too much formalism
>>> and rules, and keep them as minimal as possible, following smalltalk spirit.
>>> >
>>> > What you think?
>>>
>>> I think packages should be first class citizens. A package once loaded
>>> provides an environment/namespace/... that declares all the (exported)
>>> symbols that should be accesible global. The smalltalk dictionary should
>>> rather be a list of those namespaces/environments/... A package should also
>>> have an initialize method where you could specify order of class
>>> initialization if necessary ( and other things). Furthermore I would like
>>> to see class initializers idempotent. So when loading a package the package
>>> initialize is invoked first and then the class initializers, As they are
>>> idempotent a possible double invocation is not a problem.
>>> Dependencies are always hard. I would start thinking about metacello
>>> defining all the possible dependencies regarding platforms, platform
>>> versions etc. At load time there is only one dependency graph and that
>>> could be reflected by the system. And this graph is not dependent on the
>>> tool that loaded the code.
>>> With this in place unloading should be rather easy. Dependencies can
>>> warn the user about an harmful action and when the namespace is removed all
>>> global definitions are automaticall removed.
>>>
>>> That is what I think. But I also think that there should be a
>>> possibility to load something that doesn't end being global. A way to load
>>> a package that isn't added to the global namespace (smalltalk dictionary)
>>> but to a package namespace would also be very good. Not everything needs to
>>> global but we can only load global things. That is a flaw in my opinion.
>>> And it prevents cool things like loading multiple versions of a code in
>>> separate packages.
>>>
>>> Norbert
>>>
>>
>>
>>
>
>
Dec. 14, 2013