Pharo-users
By thread
pharo-users@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
- 7 participants
- 50353 messages
Re: [Pharo-users] Behold Pharo: The Modern Smalltalk
by Dimitris Chloupis
> This is what Smalltalk gives you for free.
>
Sorrry for being rude but I wll use the two usually heavily annoying word,
at least for me :D
It depends
See there is a problem for Python here. Ideology.
The zen of python has been both a joke a serious mantra in the python world
. Its a joke because its obviously oversimplify decision making in such a
complex subject as language designe but is serious because it clearly
illustrates the philosophy of its creator, Guido van Rossum.
https://www.python.org/dev/peps/pep-0020/
Guido is not any less of a rock star to Pythoners than Alan Kay is for
Smalltalkers. The zen has become so popular that is even included in python
implementation and can be fetched as the link says using the "import this"
in any implementation of Python. It's the very sould of python as messages
and objects are the very soul of Smalltalk.
So the problem here is that a live coding enviroment brakes the second
rule. "explicit is better than implicit". Because live coding in Pharo and
Smaltalk is about replacing old instances with new while keeping the state
it non the less an implicit behavior and especially become is a no go
scenario for python because not only replaces references to an object it
also breaks the references to the other object. Of course the old object is
garbage collected and RIP. Python follows this rule very strictly.
Thus means that not only that Python will not offer a live coding
enviroment in the future as the basis of its implementation . It means it
does not want to. It may offer it as part of its extensive library.
That also leads us to the inescapable conclusion that nothing comes free,
everything has a cost. Because there will be scenarios you dont want to
lose your old instances or not affect them at all and instead affect only
the classes or maybe you dont even want to do that and want to do something
else.
> So while Python has the flexibility for you to program such a system
> yourself, you don't get it for free like Smalltalk.
>
>
>> So it does have a wide application. Python can give you back the
>> references to and from an object (via gc module) but the problem is that
>> when an object is created its already referenced by many internal stuff so
>> it can get messy soon.
>>
>
> Smalltalk handles this for free. You need #become:
> https://gbracha.blogspot.com.au/2009/07/miracle-of-become.html
> Note one of the comments links to user code that apparently does the same
> thing in Python. But again this is Python "allows" you to, not "Python"
> gives it to you, but it could be good enough for you.
>
>
First the python example is not an actual become the way I understand it,
because not only it does not change the references to the object , it
exchanges only the variables not the methods
http://wargle.blogspot.gr/2009/07/smalltalks-become-in-python.html
__CLASS__ is reference to the class object. __DICT__ is a reference to the
instance object dictionary contains basically the names of the variables
but not references to the methods themselves . Which means this wont work
for live coding.
His example works because both classes share the same methods with same
code in them but we know this is the polar opposite of live coding.
You can get references to the modified methods using this code
my_class_ref = (globals()[self.__class__.__name__])
found_methods=[eval("my_class_ref()." +
entry,{'my_class_ref':my_class_ref}) for entry in dir(my_class_ref()) if
eval("type(my_class_ref()." + entry +
").__name__",{'my_class_ref':my_class_ref}) == 'method']
Globals is used to fetch the reference to the class object. eval is used
because names are passed as strings of course and basically eval executes a
string as a collection of python commands and returns its value. In this
case the value is a reference to an object, a method object. Dir returns
all names , including both variables and methods, instance and class,
including all superclasses.
You do then something similar to get the old methods , and then you iterate
checking the names and replacing the references with simple assignments.
You end up with a become that is I would say around , if I brake down the
list comprehension to multiple lines, 20 lines of code.
It wont be still a Smalltalk become but it will support live coding and
live replacement of instance objects.
> Plus Python is not exactly a high performance language ,
>>
>
> We now have this for improved performance...
> https://hal.inria.fr/hal-01152610/file/partialReadBarrier.pdf
>
>
Here come the two ugly words "it depends"
See what the python becomes does is essentially better than the smalltalk
becomes. I know its hard to not throw tomatoes at me but if you take a
closer look at the Elito's paper you linked you will see why.
Python solution really becomes an object to another because its swaps its
contents and not the entity of the object, this includes variables and
methods and the class it points to. By entity here I mean its place in
memory and by you I mean the person implementing the VM.
In Smalltalk becomes is not really become but rather replaceReferences ,
because it brakes the references to the object and then replace them with
references to another object. Unfortunately this creates problems because
you have to find to references to the objects and that comes with a cost if
thousands of things reference it. Hence why Eliot had to optimise this.
But python solution has no cost because you dont have to change the
references to the object. And references to the members of an object
(variables and methods) have to pass through the reference to the object
itself. So python in this cases does not have to optimise,because it deals
with a lot less references.. Smalltalk has to.
Why Smalltalk does it this way, I do not know , this is VM territory and
clearly Eliot outranks me to a great degree on the subject of VM design but
I am sure there is a technical reason.
> unless you use third party libraries focusing on performance (basically C
>> libraries wrapped for Python).
>>
>
> And how does such C libraries impact your live coding? Its not longer
> turtles all the way down (or its turtles walking off a cliff)
> Of course, the same applies for FFI with Pharo, and one of the reasons
> that Smalltalk historically has been view as insular, living in its own
> world avoid using non-Smalltalk libraries - because the lose of live coding
> here is a big impact.
>
> cheers -ben
>
>
Sorry I cannot resist :D
It depends
Technically speaking your are wrong not only for Python but also for Pharo
too. The reason being that even in the case of imported c functions they
are wrapped inside objects. So it is indeed turtles all the way down. At
least to the function level. The arguments passed to the c functions itself
are also objects, the access to the memory also objects, pointers are also
objects. C data types also object.
Of course you need VM primitives to make the actual calls but those are
wrapped into objects. So yes the room is full of turtles and there is no
escape for you :D
Python goes an extra step with its Python C API. This is an API used to
build a DLL that is compatibe with Python. Essentially Python then can
import this DLL as if it was a python source code file and use it as such.
Most of the Python third party libraries use this approach. Cython also
uses this approach too.
The API forces you to use PyObject which is a C function that wraps a C
function around a Python object. So when you access it from Python its now
an object. Also remember that in Python , python functions are object too.
So there is no escape.
I have no idea how Pharo VM does this, I know it supports plugins in a
similar function and I suspect that it forces you to wrap then in Smalltalk
objects at least at bytecode level but no clue if that is the actual case.
Again the experts can jump in and enlighten us.
Of course wrapping the C function to be called as an object does not mean
that you will wrap all the functions called by the C function. If those C
functions are not meant to be used by the user then they wont be objects
but they will also not be accessible. Always talking about Python C API.
Talking about FFI, whether Pharo (UFFI) or Python (ctypes) there is no way
around object creation that I am aware of. So you cannot avoid objects even
if you want to.
Of couse those object does not necessarily mean they offer you all your
usual comfort , they may come with some small letter disclaimers but then
we go back to the never ending "it depends" rabbit hole.
>
>
>> In my case its easy to do because I care about live coding my own project
>> and do not care about code outside of it, because I wont be changing it
>> anyway. But if I had to do this the Pharo way , providing a full live
>> enviroment it would be easy because I would have to find a mechanism to
>> accomodate for tons of Python code that does not follow live coding
>> standards by a long margin. So my goal is not to come up with full blown
>> live coding enviroment like Pharo does, that is simply not possible because
>> there is like a ton of python code out there and I am sure there so many
>> scenarios that live coding in python can go wrong that I am not even aware
>> of. But if live code is only for my code and my code alone , I dont think I
>> will have any major issues. Afterall even when I use Pharo I use live
>> coding strictly for my code and rarely touch the enviroment with the
>> exception of once messing with UI theme classes.
>>
>> But then again I am so new to this that at any point I may come up for a
>> solution about this too, who knows :)
>>
>> On Wed, Oct 11, 2017 at 7:05 PM Pierce Ng <pierce(a)samadhiweb.com> wrote:
>>
>>> On Sat, Oct 07, 2017 at 01:41:17AM +0000, Dimitris Chloupis wrote:
>>> > execution. Hence live coding, the Python VM replaces objects lively.
>>> Python
>>> > can also compile any size of code including individual methods.
>>> > That happens with one line of code importlib.reload(mymodule)
>>>
>>> AFAIK in Python when you modify and reload source, existing instances
>>> are not
>>> "reshaped" to the modified code. Not live enough. Of course with Python
>>> objects
>>> it is easy to add per-instance inst-vars, but still this needs to be
>>> scripted
>>> and doesn't come free with the programming environment.
>>>
>>> Pierce
>>>
>>>
Oct. 12, 2017
Re: [Pharo-users] Custom URI scheme for Pharo
by Norbert Hartl
I think all you need is to do a system call out to the OS in order to register your scheme. For Mac OS it would be sonething like
https://superuser.com/questions/548119/how-do-i-configure-custom-url-handle…
And then you can see if it is what you want. Custom handlers associate a url scheme to an application binary. Iâm not sure you can use an image with it. So I would register a shell script and handle the adoption in the script.
Does that help?
Norbert
> Am 10.10.2017 um 21:06 schrieb Manuel Leuenberger <leuenberger(a)inf.unibe.ch>:
>
> Hi,
>
> Is there any support from the VM/Application package to add custom URI schemes to listen to from within Pharo? I would like to have a hyperlink like âpharo://send?data=fancypantsâ in an arbitrary document that, when clicked, switches to Pharo and calls a hook I can register. Could someone give me a hint how to achieve that, or do I have to build a little bridge application that handles the scheme registration and talks with Pharo through another channel? Currently, I only need this for OS X.
>
> Cheers,
> Manuel
>
Oct. 12, 2017
Re: [Pharo-users] Behold Pharo: The Modern Smalltalk
by Markus Stumptner
Just to lead this back to the original question. What you say is
undoubtedly true. It is not, however, necessarily something that a
beginner will understand or be able to share in. So, to a certain
degree this may be a trap caused by having the excellent environment.Â
The newbie who is not used to it and tries to get somehow organised
before diving in will be scared off.
(I do realise that this is a matter of the time being available, but the
fact remains that people coming from the outside may be held back this
apparent lack of information, even though it is only a lack of
information external to the image. It's the difference between the
converted who are already going with the flow and those who want to dip
a toe into the water.)
On 12/10/17 01:09, Offray Vladimir Luna Cárdenas wrote:
>
> The more I use Pharo, the less I use web documentation. For me seems
> pretty suboptimal compared to live environment with code browser and
> GT-Spotter. Regarding the comment on Medium, it also took me little to
> find #raisedTo:, so the millage can vary. What I was missing was
> proper books for particular domains, but Pharo books are covering
> that. I don't know if a Q&A site could improve search-ability for
> newbies (certainly you can find little stuff in Stack Overflow).
>
> My bet is about trying to create more "end user" tools (Grafoscopio is
> kind of this), besides tools for developers. There is a broad
> community of people who can be active contributors and members of the
> community, welcome Pharo and live coding a lot and don't complain that
> much about stuff that is not already pretty similar to what they
> already know (being that only English MOOC or online static html docs).
>
> Cheers,
>
> Offray
>
>
> On 11/10/17 07:34, Dimitris Chloupis wrote:
>> for me it is a yes and no situation, yes its very coold to have your
>> entire system in your fingertips but Pharo has serious issues with
>> code organisation and I find the lack of namespaces quite
>> inconvenient. You have to be careful how to name your classes which
>> does not sound to me very OOP friendly.
>>
>> Also the IDE does not handle spaggetification very well, sure you can
>> find implementors , senders etc but if the execution chain is complex
>> , welcome to spaggeti hell. But that is a problem with most other
>> IDEs if not all as well. Problem is in this case that we have the
>> very good rule of using sort methods which multiplies this problem
>> and makes navigation even harder. Code becomes much easier to read
>> per method and messages but much harder to understand in a bird eye view.
>>
>> Some of that pain has been aleviated with the introduction of
>> GTSpotter which I have praised quite a lot and I will continue to do
>> so. But yeah there are more needed to be done in the department to
>> make Pharo code navigation a more comfortable task.
>>
>> On Wed, Oct 11, 2017 at 2:57 PM Vitor Medina Cruz
>> <vitormcruz(a)gmail.com <mailto:vitormcruz@gmail.com>> wrote:
>>
>> I dunno, maybe Iâm weird, but I find the System Browser a
>> fantastic way to explore the class library. If you find a
>> class or method that isnât well documented, write a comment
>> and send a change request. Stef told me this ages ago. I
>> might add, if you find a bug you should write a test that
>> exercises the bug and submit it on fogbugz (the bug tracking
>> system).
>>
>>
>> I will reference of response of mine to a similar opinion made by
>> Richard:
>> https://medium.com/@vitormcruz/i-disagree-it-is-much-harder-to-find-anythin…
>>
>> My 2 cents.
>>
>>
>>
>>
>> On Tue, Oct 10, 2017 at 11:59 PM, john pfersich
>> <jpfersich(a)gmail.com <mailto:jpfersich@gmail.com>> wrote:
>>
>>
>> > On Oct 10, 2017, at 09:58, horrido
>> <horrido.hobbies(a)gmail.com
>> <mailto:horrido.hobbies@gmail.com>> wrote:
>> >
>> > Interestingly, I'm getting a fair amount of pushback on
>> this. Personally, I
>> > think it would be very helpful to have a live (updatable,
>> so as to keep it
>> > current) reference page for the class library, something
>> that developers can
>> > easily look up what they need. After all, most of the power
>> of Pharo comes
>> > from the class library and we need to make it as accessible
>> as possible to
>> > less experienced Pharoers (i.e., beginners).
>> >
>> > Exploring the class library through the System Browser is
>> very inefficient.
>> > This is further exacerbated by the fact that many classes
>> and methods are
>> > simply not well-documented (containing a cursory remark
>> which is just barely
>> > useful).
>> >
>> I dunno, maybe Iâm weird, but I find the System Browser a
>> fantastic way to explore the class library. If you find a
>> class or method that isnât well documented, write a comment
>> and send a change request. Stef told me this ages ago. I
>> might add, if you find a bug you should write a test that
>> exercises the bug and submit it on fogbugz (the bug tracking
>> system).
>>
>> > I realize that creating a live reference page is not easy
>> to do. In fact,
>> > it's a lot of work. But the absence of such a page is a
>> real obstacle to
>> > Pharo acceptance.
>> >
>> >
>> >
>> > horrido wrote
>> >> Thanks. I gave your answer verbatim. I also added the
>> following paragraph:
>> >>
>> >> The problem I find with todayâs developers is that they
>> are rather
>> >> closed-minded. They are rigid and inflexible, and not
>> willing to adapt to
>> >> new and different ways of doing things. In my generation
>> (circa
>> >> 1980â1990),
>> >> people didnât have a problem with trying different
>> technologies. Thatâs
>> >> why
>> >> I had no issue with learning Smalltalk 10 years ago, after
>> I had retired
>> >> from a 20-year-long career in C systems programming and
>> FORTRAN scientific
>> >> programming.
>> >>
>> >>
>> >>
>> >> Sven Van Caekenberghe-2 wrote
>> >>>> On 6 Oct 2017, at 14:54, horrido <
>> >>
>> >>> horrido.hobbies@
>> >>
>> >>> > wrote:
>> >>>>
>> >>>> I received this comment from someone who complained:
>> >>>>
>> >>>> *What about the lack of documentation? From time to time
>> Iâve checked
>> >>>> some
>> >>>> SmallTalk implementations like Squeak, GNU-Smalltalk and
>> now Pharo. Of
>> >>>> these, only GNU-SmallTalk appears to have a free,
>> official programming
>> >>>> guide
>> >>>> and core library reference that any serious programmer
>> expects from a
>> >>>> language.
>> >>>>
>> >>>>
>> https://www.gnu.org/software/smalltalk/manual-base/html_node/*
>> >>>>
>> >>>> I pointed to Pharo's documentation but then he came back
>> with:
>> >>>>
>> >>>> *Then show me a link of the free, maintained reference
>> documentation for
>> >>>> the
>> >>>> classes that form âthe core libraryâ, like this one for
>> Python
>> >>>> (https://docs.python.org/3/library/index.html)*
>> <https://docs.python.org/3/library/index.html%29*>
>> >>>>
>> >>>> It's true, most Smalltalks do not have a core library
>> reference, not
>> >>>> even
>> >>>> VisualWorks! So what is the proper response to this
>> complaint?
>> >>>
>> >>> The first answer is that Pharo/Smalltalk is unique in
>> that a running
>> >>> system/IDE contains _all_ source code, _all_
>> documentation (class,
>> >>> method,
>> >>> help, tutorial), _all_ unit tests and _all_ runnable
>> examples in a very
>> >>> easy, accessible way. It takes some getting used to, but
>> this is actually
>> >>> better and much more powerful than any alternative.
>> >>>
>> >>> The second answer is that there are lots of books and
>> articles that take
>> >>> the classic/structured book/paper approach. There is
>> >>> http://books.pharo.org, http://themoosebook.org,
>> >>> http://book.seaside.st/book,
>> http://medium.com/concerning-pharo and many
>> >>> more.
>> >>>
>> >>>> Thanks.
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Sent from:
>> http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>> >>>>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from:
>> http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>> >
>> >
>> >
>> >
>> >
>> > --
>> > Sent from:
>> http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>> >
>>
>>
>
Oct. 12, 2017
Re: [Pharo-users] Update of ConfigurationOfGlorp
by Alistair Grant
On Wed, Oct 11, 2017 at 09:50:46PM +0200, Herby Voj????k wrote:
> stephan wrote:
> >On 11-10-17 20:33, Herby Voj????k wrote:
> >>127 is general, is not sqlite-specific. Fixes any case where primary
> >>key is not primitive and has converter.
> >
> >Should 127 and 129 be merged first, and should current development be
> >promoted to release? And why is 128 missing?
> >
> >Stephan
> >
> >
>
> 129 is from different author, who skipped upload of its 127 and 128
> (probably intermediates).
>
> 127 is mine, fixes IMO overoptimized case for DirectMapping which
> unlike its superclass (thus all the other mappings as there is no
> other specialization), stopped converting primary keys to db value in
> fk->pk relationships.
129 is mine. 129 is dated July 2016 while 127 is dated August 2017,
which I guess accounts for why I based 129 on 126.
On Wed, Oct 11, 2017 at 11:31:17AM +0200, stephan wrote:
> On 06-10-17 17:22, Herby Voj????k wrote:
> >Any chance of incorporating fixes 127 / 129?
>
> Sure, as soon as someone tells me they are safe to
> add. I am just testing Glorp with P3 and Postgres now,
> and don't have the capacity to verify these changes
> other than by just reading the delta.
>
> Stephan
129 has been available since July 2016 and was promoted to #development
by Pierce in January 2017.
I've been using it without any problems since I submitted it in July
2016.
Cheers,
Alistair
Oct. 12, 2017
Re: [Pharo-users] Custom URI scheme for Pharo
by Manuel Leuenberger
Sounds like a nice setup you got there :).
I want to integrate documents displayed in the system viewer, as they cannot be displayed within Pharo (Web, PDF, â¦). So hyperlinking is the only way I see to get something close. I created a little demo where I injected hyperlinks in a PDF like âpharo://click?whatever=youwant' <pharo://click?whatever=youwant'>. When you click them, a little Objective-C app catches the OS event and forwards it to an HTTP server running in Pharo. So I can do things like this:
https://youtu.be/CR_scZSDf3s <https://youtu.be/CR_scZSDf3s>
> On 11 Oct 2017, at 00:24, Dimitris Chloupis <kilon.alios(a)gmail.com> wrote:
>
> I think I remember this disussed before.
> By talking with Pharo I assume here about another program talking to Pharo ? Possible not wrriten in Pharo ?
>
> If thats the case then you can use whatever IPC works better for your needs. If the communication will be remotely I recommend sockets, for fast local communication I recommend shared memory. They are both very mature technologies , very reliable and cross platform.
>
> Now on the URI protocol, I think that will depend what you want to achieve. Any string will be easy to parse with Pharo's regex and trigger the approriate methods. Pharo also have Annoucements, think of it as an event system that awaits to be triggered by an event, usually a Pharo event but I see no reason why it cant listen to external events either.
>
> I do not think you will need a middle application , a servel client relation shipe should be more than enough.
>
> With my Atlas bridge which is a Pharo library that allows you to use Python libraries I did a neat trick with Pharo that it already communicated with Python via sockets, sending python commands but also Python could communicate back errors , then Pharo would trigger the debugger, display the python error inside the Pharo debugger and the debugger would pop up on the exact pharo command that send the faulty python code. You could then change the pharo command on the spot and it was resent and python continued like the error never happened to retain the all important live coding workflow.
>
> I created a tiny protocol to difirentia incoming messages talking about errors from the ones returning python varriable values. Something stupid like "pythonError: blah blah" but it got the job done
>
>
>
> On Tue, Oct 10, 2017 at 10:07 PM Manuel Leuenberger <leuenberger(a)inf.unibe.ch <mailto:leuenberger@inf.unibe.ch>> wrote:
> Hi,
>
> Is there any support from the VM/Application package to add custom URI schemes to listen to from within Pharo? I would like to have a hyperlink like âpharo://send?data=fancypantsâ <> in an arbitrary document that, when clicked, switches to Pharo and calls a hook I can register. Could someone give me a hint how to achieve that, or do I have to build a little bridge application that handles the scheme registration and talks with Pharo through another channel? Currently, I only need this for OS X.
>
> Cheers,
> Manuel
>
Oct. 11, 2017
Re: [Pharo-users] Update of ConfigurationOfGlorp
by Herby VojÄÃk
stephan wrote:
> On 11-10-17 21:50, Herby VojÄÃk wrote:
>
>> 129 is from different author, who skipped upload of its 127 and 128
>> (probably intermediates).
>>
>> 127 is mine, fixes IMO overoptimized case for DirectMapping which
>> unlike its superclass (thus all the other mappings as there is no
>> other specialization), stopped converting primary keys to db value in
>> fk->pk relationships.
>
> Name: ConfigurationOfGlorp-StephanEggermont.62
> Author: StephanEggermont
> Time: 11 October 2017, 10:00:05.488994 pm
> UUID: a7105b9b-ac17-0d00-a62f-44e602acb0bc
> Ancestors: ConfigurationOfGlorp-StephanEggermont.61
>
> Patch for stable/release2/2.0.1
>
> Fix error with DirectMapping primary key
> not being converted to db type.
>
> In the metarepos, dbxtalk/glorp and dbxtalk/configurations
Thank you very much, sir. :-)
Oct. 11, 2017
Re: [Pharo-users] Behold Pharo: The Modern Smalltalk
by Ben Coman
On Thu, Oct 12, 2017 at 1:08 AM, Dimitris Chloupis <kilon.alios(a)gmail.com>
wrote:
> Yes sorry for not making this clear. I was wrong in this case. A module
> reload will only replace class objects not instance objects. So if you
> create a new instance after the reload it will have the updated version but
> your old instance would not.
>
> I try to test something before I make a claim but in this case I failed
> because I forgot the obvious. The tiny fact I was reinitialising my objects
> in the python project I am currently using live coding, so of course my
> instances were updating instantenously because I was in a loop that was
> recreating them every few milliseconds.
>
> When webwarrior mentioned this it draw my supisions and I tested it
> outside my code in the interpreter and it became obvious I was wrong. This
> why my reply I dont claim he is wrong and I am talking about injecting
> methods to old objects.
>
> I have no problem admitting when I am wrong but in this case maybe I was
> not clear enough considering I am responsible for exploding this thread , I
> hope in a good way.
>
> So yes its possible to do in Python but no it is not coming already
> available to you, so you can restrain yourself from abandoning Pharo for
> Python ;)
>
> Python is not there yet. I still keep the opinion that is easy to do ,
> method injection is just regular assignment, you cannot get any easier than
> assignment but this means you have to keep track of the instances of a
> class and replace their methods.
>
This is what Smalltalk gives you for free.
> The good news is that if you replace just the methods and not the entire
> object , you can keep the references to the old instance because keeping
> track of the references as well would be trickier. So this way you would
> not brake your references and having to rebuild them to point to a new
> instance because you continue to use the old instance but with updated
> methods. You can do this also with adding / removing / editing variables
> and/or methods.
>
So while Python has the flexibility for you to program such a system
yourself, you don't get it for free like Smalltalk.
> So it does have a wide application. Python can give you back the
> references to and from an object (via gc module) but the problem is that
> when an object is created its already referenced by many internal stuff so
> it can get messy soon.
>
Smalltalk handles this for free. You need #become:
https://gbracha.blogspot.com.au/2009/07/miracle-of-become.html
Note one of the comments links to user code that apparently does the same
thing in Python. But again this is Python "allows" you to, not "Python"
gives it to you, but it could be good enough for you.
> Plus Python is not exactly a high performance language ,
>
We now have this for improved performance...
https://hal.inria.fr/hal-01152610/file/partialReadBarrier.pdf
> unless you use third party libraries focusing on performance (basically C
> libraries wrapped for Python).
>
And how does such C libraries impact your live coding? Its not longer
turtles all the way down (or its turtles walking off a cliff)
Of course, the same applies for FFI with Pharo, and one of the reasons that
Smalltalk historically has been view as insular, living in its own world
avoid using non-Smalltalk libraries - because the lose of live coding here
is a big impact.
cheers -ben
> In my case its easy to do because I care about live coding my own project
> and do not care about code outside of it, because I wont be changing it
> anyway. But if I had to do this the Pharo way , providing a full live
> enviroment it would be easy because I would have to find a mechanism to
> accomodate for tons of Python code that does not follow live coding
> standards by a long margin. So my goal is not to come up with full blown
> live coding enviroment like Pharo does, that is simply not possible because
> there is like a ton of python code out there and I am sure there so many
> scenarios that live coding in python can go wrong that I am not even aware
> of. But if live code is only for my code and my code alone , I dont think I
> will have any major issues. Afterall even when I use Pharo I use live
> coding strictly for my code and rarely touch the enviroment with the
> exception of once messing with UI theme classes.
>
> But then again I am so new to this that at any point I may come up for a
> solution about this too, who knows :)
>
> On Wed, Oct 11, 2017 at 7:05 PM Pierce Ng <pierce(a)samadhiweb.com> wrote:
>
>> On Sat, Oct 07, 2017 at 01:41:17AM +0000, Dimitris Chloupis wrote:
>> > execution. Hence live coding, the Python VM replaces objects lively.
>> Python
>> > can also compile any size of code including individual methods.
>> > That happens with one line of code importlib.reload(mymodule)
>>
>> AFAIK in Python when you modify and reload source, existing instances are
>> not
>> "reshaped" to the modified code. Not live enough. Of course with Python
>> objects
>> it is easy to add per-instance inst-vars, but still this needs to be
>> scripted
>> and doesn't come free with the programming environment.
>>
>> Pierce
>>
>>
Oct. 11, 2017
Re: [Pharo-users] [Pharo-dev] TechTalk on Artificial Intelligence & Neural Networks
by Dimitris Chloupis
I am interested in code analysis so any guidance in this area I love it ,
AI related of course
On Wed, 11 Oct 2017 at 16:12, Serge Stinckwich <serge.stinckwich(a)gmail.com>
wrote:
> I would like to advertise the TechTalk for colleagues of my lab.
> They can join Discord using the invitation link ?
> http://discord.gg/Sj2rhxn
>
>
>
> On Wed, Oct 11, 2017 at 1:15 PM, Alexandre Bergel <alexandre.bergel(a)me.com>
> wrote:
> >
> > Dear All,
> >
> > A TechTalk on Artificial Intelligence is soon approaching.
> > The talk will be about implementing a neural networks in Pharo.
> >
> > It is scheduled on Tuesday 17Oct, 2017 (5:00 PM - 7:00 PM (UTC+02:00))
> >
> > I need your input. Which example to you want me to use?
> > - Data manipulation, or
> > - Designing a small AI for a game
> >
> > Please answer:
> > https://twitter.com/alexbergel/status/918084438197784578
> >
> > Some info about the event:
> > https://association.pharo.org/event-2642664
> > https://www.facebook.com/events/133683180530368
> >
> > Thanks Marcus Denker and the RMoD crew for their help in organizing it.
> >
> > Cheers,
> > Alexandre
> >
> > --
> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> > Alexandre Bergel http://www.bergel.eu
> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> >
> >
> >
> >
>
>
>
> --
> Serge Stinckwich
> UMI UMMISCO 209 (IRD/UPMC/UY1)
> "Programs must be written for people to read, and only incidentally for
> machines to execute."
> http://www.doesnotunderstand.org/
>
Oct. 11, 2017
Re: [Pharo-users] Update of ConfigurationOfGlorp
by stephan
On 11-10-17 21:50, Herby VojÄÃk wrote:
> 129 is from different author, who skipped upload of its 127 and 128
> (probably intermediates).
>
> 127 is mine, fixes IMO overoptimized case for DirectMapping which unlike
> its superclass (thus all the other mappings as there is no other
> specialization), stopped converting primary keys to db value in fk->pk
> relationships.
Name: ConfigurationOfGlorp-StephanEggermont.62
Author: StephanEggermont
Time: 11 October 2017, 10:00:05.488994 pm
UUID: a7105b9b-ac17-0d00-a62f-44e602acb0bc
Ancestors: ConfigurationOfGlorp-StephanEggermont.61
Patch for stable/release2/2.0.1
Fix error with DirectMapping primary key
not being converted to db type.
In the metarepos, dbxtalk/glorp and dbxtalk/configurations
Oct. 11, 2017