Re: [Pharo-users] Unresponsive/frozen Gui

2018-01-10 Thread Esteban Lorenzano
most probably your image got stuck doing something. 
take a look at “PharoDebug.org ” in case there is one.

Esteban

> On 10 Jan 2018, at 21:40, Andrei Stebakov  wrote:
> 
> I experience that issue once in a while when I leave the pharo 6.1 on windows 
> and when I come back to it the UI is frozen.
> Now I download pharo with moose image and it started to happen again (BTW I 
> couldn't install Moose in my pharo 6.1 using Metacello command)
> I wonder if it's something that happens to many users and I have to get used 
> to it (ui freezes) or there ways to avoid it.
> Again, maybe it's a windows specific problem and most of the pharo users are 
> either on Mac or Linux.



Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Stephane Ducasse
Hi Thierry

One of these days I think that I will have to have a look at it :)

Stef

On Wed, Jan 10, 2018 at 2:35 PM, Thierry Goubier 
wrote:

>
>
> 2018-01-10 14:26 GMT+01:00 Serge Stinckwich :
>
>>
>>
>> On Wed, Jan 10, 2018 at 2:23 PM, Julien 
>> wrote:
>>
>>> Hello Serge,
>>>
>>> Do you mean pieces of code you wrote in Python using Numpy that you want
>>> to transform to Smalltalk code using PolyMath?
>>>
>>> It’s kind of the other way around of this project. :-)
>>>
>>>
>> ​yes this is exactly the opposite :-(​
>> ​I guess I need a Python parser and after that I can do AST
>> transformation ...
>>
>
> Hi Serge,
>
> there is a Python2.7 parser with AST that could be used.
>
> Thierry
>
>
>> Or using regex I can do basic stuff ...​
>>
>> --
>> 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/
>>
>
>


Re: [Pharo-users] Pharo and ActiveDirectory

2018-01-10 Thread olivier auverlot
Torsten,

I'm not sure that a Active Directory client protocol is available for
Pharo. We have only an LDAP framework (LDAPlayer) that runs fine (I use it
every day).

A quick solution is to use another language to build a REST service
(perhaps that a open source gateway is already available ?)  and
interfacing your Pharo app with him.

Best regards
Olivier :)


2018-01-11 2:56 GMT+01:00 Andrew Glynn :

> If you make some provision to handle attributes with the 'binary' flag
> set, which are generally base64 encoded data such as the person's photo,
> GUID/PUID, and synch options, it should be ok.
>
> LDAP uses similar encoding rules to ASN.1, and ASN.1 has better
> documentation.
>
> The only difficult problem I've run into is that binary values synched via
> HTML (common between MS LDAP and 'truer' LDAP implementations such as
> OpenLDAP and OpenDJ) often don't have the binary fields encoded correctly
> in the HTML.  I could probably dig up some code that handles binary
> attributes, but it wouldn't be Smalltalk code unfortunately.
>
> Cheers
> Andrew
>
>
> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf
> Of Torsten Bergmann
> Sent: Wednesday, January 10, 2018 6:11 PM
> To: Any question about pharo is welcome 
> Subject: [Pharo-users] Pharo and ActiveDirectory
>
> Hi,
>
> anyone used/uses Pharo to bind to ActiveDirectory?
>
> Last thread I've seen is http://forum.world.st/Pharo-
> amp-LDAP-td3308841.html
>
> Does it work now?
>
>
> Is http://map.squeak.org/package/ccbcb878-e09b-48ed-a773-5939bf8c2c3e the
> latest code is there something more updated?
>
> Thanks
> T.
>
>
>
>


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread askoh
Good job. Is there something which translates Python to Smalltalk?

Thanks,
Aik-Siong Koh



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Pharo and ActiveDirectory

2018-01-10 Thread Andrew Glynn
If you make some provision to handle attributes with the 'binary' flag set, 
which are generally base64 encoded data such as the person's photo, GUID/PUID, 
and synch options, it should be ok. 

LDAP uses similar encoding rules to ASN.1, and ASN.1 has better documentation.

The only difficult problem I've run into is that binary values synched via HTML 
(common between MS LDAP and 'truer' LDAP implementations such as OpenLDAP and 
OpenDJ) often don't have the binary fields encoded correctly in the HTML.  I 
could probably dig up some code that handles binary attributes, but it wouldn't 
be Smalltalk code unfortunately.

Cheers
Andrew


-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Torsten Bergmann
Sent: Wednesday, January 10, 2018 6:11 PM
To: Any question about pharo is welcome 
Subject: [Pharo-users] Pharo and ActiveDirectory

Hi,

anyone used/uses Pharo to bind to ActiveDirectory?

Last thread I've seen is http://forum.world.st/Pharo-amp-LDAP-td3308841.html

Does it work now?


Is http://map.squeak.org/package/ccbcb878-e09b-48ed-a773-5939bf8c2c3e the 
latest code is there something more updated?

Thanks
T.





[Pharo-users] Pharo and ActiveDirectory

2018-01-10 Thread Torsten Bergmann
Hi,

anyone used/uses Pharo to bind to ActiveDirectory?

Last thread I've seen is http://forum.world.st/Pharo-amp-LDAP-td3308841.html

Does it work now?


Is http://map.squeak.org/package/ccbcb878-e09b-48ed-a773-5939bf8c2c3e the latest
code is there something more updated?

Thanks
T.



Re: [Pharo-users] Any perspective of Woden in Pharo 6.1/7 ?????

2018-01-10 Thread Alexandre Bergel
Hi Casimiro!

Sorry for the late reply.
We do have a working version of Woden for Pharo 7.
It would be great if you could try.
https://github.com/ronsaldo/woden2

On OSX, I did:
-=-=-=-=-=-=-=-=-=
git clone https://github.com/ronsaldo/woden2.git
cd woden2
./loadWoden2.sh
-=-=-=-=-=-=-=-=-=

It takes time to install & compile (~ 10 minutes?), but it works well

Alexandre


> On Jan 2, 2018, at 5:21 AM, Casimiro - GMAIL  
> wrote:
> 
> Is there any perspective of Woden working in Pharo 6.1 or later versions 
> (7)
> 
> Best regards,
> 
> 
> Casimiro
> -- 
> The information contained in this message is confidential and intended to the 
> recipients specified in the headers. If you received this message by error, 
> notify the sender immediately. The unauthorized use, disclosure, copy or 
> alteration of this message are strictly forbidden and subjected to civil and 
> criminal sanctions.
> 
> ==
> 
> This email may be signed using PGP key ID: 0x4134A417




Re: [Pharo-users] Unresponsive/frozen Gui

2018-01-10 Thread Stephane Ducasse
The problem I got with Pharo 6.1 on sierra are
- typing and pressing arrow and the vm crash
- something getting a crash related to freetype
- and sometimes when stepping over get hundred of debuggers
but no freeze.

stef

On Wed, Jan 10, 2018 at 9:40 PM, Andrei Stebakov  wrote:
> I experience that issue once in a while when I leave the pharo 6.1 on
> windows and when I come back to it the UI is frozen.
> Now I download pharo with moose image and it started to happen again (BTW I
> couldn't install Moose in my pharo 6.1 using Metacello command)
> I wonder if it's something that happens to many users and I have to get used
> to it (ui freezes) or there ways to avoid it.
> Again, maybe it's a windows specific problem and most of the pharo users are
> either on Mac or Linux.



Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Stephane Ducasse
Johan Brichau could execute java code from VisualWorks.
He had special metaclass whose dictionaries contains strange mirror to
java methods. So I'm interested to see how far you can get :)

On Wed, Jan 10, 2018 at 4:58 PM, Julien  wrote:
> Even if I learned things from your answer, I think you misunderstood what I
> was talking about. :p
>
> What I want is a mechanism to describe python’s objects from Pharo and being
> able to:
> 1. Serialise those objects from Python
> 2. Send those object to Pharo (whatever the way it is done: socket, write in
> a file from python and read from Pharo, etc…)
> 3. Materialize those serialised Python’s objects as Pharo objects.
>
> Basically, I want to be able to transfer data from Python to Pharo easily.
>
> Something better than getting the values held by Python objects by parsing
> their String representation « by hand »... :-)
>
> Julien
>
> ---
> Julien Delplanque
> Doctorant à l’Université de Lille 1
> http://juliendelplanque.be/phd.html
> Equipe Rmod, Inria
> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
> Numéro de téléphone: +333 59 35 86 40
>
> Le 10 janv. 2018 à 16:43, Dimitris Chloupis  a écrit
> :
>
>
>
> On Mon, Jan 8, 2018 at 5:50 PM Julien  wrote:
>>
>> Beware that no mechanism to get back values from Python is defined for now
>> (except if you just want the String
>> representation of those objects, then you can get that if you use atlas).
>>
>> I’d like to have that but it is not easy. I would like a way to describe
>> how to map Python’s objects to Pharo’s objects
>> from Pharo and to have the code to do that in Python side generated
>> automatically but some thinking is needed…
>>
>> Julien
>
>
> It won't be easy
>
> I have noted in the past the similarities between Pharo and Python but here
> there is also a massive difference.
>
> In Pharo we have the mentality of reinventing many stuffs ourselves so the
> systems is based to a very large extend on Pharo that runs on very efficient
> JIT VM. Almost everything is Pharo code.
>
> Python on the other hand is the exact opposite, Python runs on an extremely
> slow VM but more than 50% of its code in written in C, Python itself or its
> third party libraries.
>
> So the irony is that even though in theory and practice Python code is one
> of the slowest , in actual scenarios its one of the fastest able to
> outperform even Java to a very large extend because its libraries that are
> made for high performance like Numpy are predominately C code. Pretty much
> every C or C++ library has wrappers for Python which is what made it so
> popular. Hence the reason behind the insanity when it comes to top
> performance Python being second only to C++.
>
> So you will have not only map the Python oobjects  to Pharo object but also
> map the C code. Even though this may sound impossible the good news is that
> Python libraries, having the extension pyd , are basically DLLs made
> supporting a specific API which is very minimal in design. Similar to our
> UFFI , the only major difference is that library is responsible of keeping
> track of the reference count, which is used by Python GC to erase no longer
> used objects from memory. Which is a very simple increase and decrease.
>
> So not only you will have to remap the Python objects but also DLLs as well.
>
> To add salt to the wound , Python has something that Pharo does not.
> Multiple inheritance. Which of course makes your goal even harder. Python
> coder's generally avoid multiple inheritance as much as we avoid overriding
> doesNotUnderstand , but its a feature they use none the less.
>
> Hence why I did not even consider trying something like that. Plus you will
> be gaining no advantage because C code is unportable to Pharo anyway. Sure
> we have Slang , but Slang is extra careful with types which normal Pharo
> code does not. You will be losing performance because yes porting to Pharo
> as much as JIT VM may be great , its no much for Python libraries that
> merely leverage C. Plus you will have to update it each time the library
> changes etc.
>
> So my conclusion was that the most efficient way was to let Python execute
> the library and just manipulate Python.
>
> It's much easier to do the exact opposite, which goes against our mentality
> , and port your Pharo objects to Python objects. Because a) your objects
> will always be far less than a complete library and system b) you wont have
> to worry about C code because you wont have any c) all the other negatives I
> mention , disappear.
>
> It usual case of not being able to have your cake and eat it too.
>
>
>



Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Aliaksei Syrel
Hi Stef,

Awesome, thank you!

Cheers,
Alex

On 10 January 2018 at 21:48, Stephane Ducasse 
wrote:

> Removed!
>
> On Wed, Jan 10, 2018 at 9:46 PM, Stephane Ducasse
>  wrote:
> > Hi aliaksei I will remove this link.
> >
> > On Wed, Jan 10, 2018 at 6:39 AM, Aliaksei Syrel 
> wrote:
> >> Hello Photon,
> >>
> >> I have literally no idea where you found this paper but it is years old.
> >>
> >> Could you try to install it according to instructions on Bloc GitHub
> page:
> >>
> >> https://github.com/pharo-graphics/Bloc
> >>
> >> You might also want to try a MemoryGame tutorial:
> >>
> >> https://github.com/pharo-graphics/Tutorials
> >>
> >> Let me know if something does not work.
> >>
> >> P.S. Could somebody with access rights delete this page:
> >> https://ci.inria.fr/pharo-contribution/job/PharoBookWorkInProgress/
> lastSuccessfulBuild/artifact/book-result/Bloc/Bloc.html
> >> ?
> >>
> >> Alex
> >>
> >> On Wed, 10 Jan 2018 at 03:26, Photon  wrote:
> >>>
> >>> Hello I have trouble with Bloc.  I tried to install it like this as i
> read
> >>> it
> >>> in a paper on Bloc
> >>>
> >>>
> >>> but then this does not work because there is no suchclass, istall is
> send
> >>> to
> >>> nil.
> >>>
> >>>
> >>>
> >>> I had also trouble with the tutorial earlier. I could not see anything
> in
> >>> the preview altho the code was aparrantly fine.
> >>> I really like to do something with bloc but i cant even set it up
> >>> properly.
> >>> Please help me.
> >>>
> >>>
> >>>
> >>> --
> >>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> >>>
> >> --
> >> Cheers,
> >> Alex
>
>


Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Stephane Ducasse
Removed!

On Wed, Jan 10, 2018 at 9:46 PM, Stephane Ducasse
 wrote:
> Hi aliaksei I will remove this link.
>
> On Wed, Jan 10, 2018 at 6:39 AM, Aliaksei Syrel  wrote:
>> Hello Photon,
>>
>> I have literally no idea where you found this paper but it is years old.
>>
>> Could you try to install it according to instructions on Bloc GitHub page:
>>
>> https://github.com/pharo-graphics/Bloc
>>
>> You might also want to try a MemoryGame tutorial:
>>
>> https://github.com/pharo-graphics/Tutorials
>>
>> Let me know if something does not work.
>>
>> P.S. Could somebody with access rights delete this page:
>> https://ci.inria.fr/pharo-contribution/job/PharoBookWorkInProgress/lastSuccessfulBuild/artifact/book-result/Bloc/Bloc.html
>> ?
>>
>> Alex
>>
>> On Wed, 10 Jan 2018 at 03:26, Photon  wrote:
>>>
>>> Hello I have trouble with Bloc.  I tried to install it like this as i read
>>> it
>>> in a paper on Bloc
>>>
>>>
>>> but then this does not work because there is no suchclass, istall is send
>>> to
>>> nil.
>>>
>>>
>>>
>>> I had also trouble with the tutorial earlier. I could not see anything in
>>> the preview altho the code was aparrantly fine.
>>> I really like to do something with bloc but i cant even set it up
>>> properly.
>>> Please help me.
>>>
>>>
>>>
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>
>> --
>> Cheers,
>> Alex



Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Stephane Ducasse
Hi aliaksei I will remove this link.

On Wed, Jan 10, 2018 at 6:39 AM, Aliaksei Syrel  wrote:
> Hello Photon,
>
> I have literally no idea where you found this paper but it is years old.
>
> Could you try to install it according to instructions on Bloc GitHub page:
>
> https://github.com/pharo-graphics/Bloc
>
> You might also want to try a MemoryGame tutorial:
>
> https://github.com/pharo-graphics/Tutorials
>
> Let me know if something does not work.
>
> P.S. Could somebody with access rights delete this page:
> https://ci.inria.fr/pharo-contribution/job/PharoBookWorkInProgress/lastSuccessfulBuild/artifact/book-result/Bloc/Bloc.html
> ?
>
> Alex
>
> On Wed, 10 Jan 2018 at 03:26, Photon  wrote:
>>
>> Hello I have trouble with Bloc.  I tried to install it like this as i read
>> it
>> in a paper on Bloc
>>
>>
>> but then this does not work because there is no suchclass, istall is send
>> to
>> nil.
>>
>>
>>
>> I had also trouble with the tutorial earlier. I could not see anything in
>> the preview altho the code was aparrantly fine.
>> I really like to do something with bloc but i cant even set it up
>> properly.
>> Please help me.
>>
>>
>>
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
> --
> Cheers,
> Alex



[Pharo-users] Unresponsive/frozen Gui

2018-01-10 Thread Andrei Stebakov
I experience that issue once in a while when I leave the pharo 6.1 on
windows and when I come back to it the UI is frozen.
Now I download pharo with moose image and it started to happen again (BTW I
couldn't install Moose in my pharo 6.1 using Metacello command)
I wonder if it's something that happens to many users and I have to get
used to it (ui freezes) or there ways to avoid it.
Again, maybe it's a windows specific problem and most of the pharo users
are either on Mac or Linux.


Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Photon
Omg i didnt even reaf further asuming that i should get the grey sqaure as
result. Now once you say it it`s kinda obvoius. I keep practicing. Thanks
again for your time :)



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Aliaksei Syrel
Then the behaviour you get is expected one. There is no bug or issue there.
On page 12 in section 3.2 (Starting to draw a card) it tells you to
implement a drawOnSparta: method. After that you should get the same as on
Figure 3-1.
Since you didn't implement it, you obviously get nothing. It is like to
only buy a garage and then being surprised that there is no car inside ;)

Cheers,
Alex

On 10 January 2018 at 18:29, Photon  wrote:

> Id did it following this pdf:
> http://files.pharo.org/books-pdfs/booklet-Bloc/2017-11-09-memorygame.pdf
> 
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Photon
Id did it following this pdf: 
http://files.pharo.org/books-pdfs/booklet-Bloc/2017-11-09-memorygame.pdf
  





--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Aliaksei Syrel
Hello Photon,

MgdRawCardElement does not exist in in MemoryGame. It looks like you
created it yourself.
Please, give us more information. For example share the implementation of
that class. I am not a clairvoyant to tell where is a problem in your code
without actually seeing the code.

Cheers,
Alex

On 10 January 2018 at 15:49, Photon  wrote:

> Hi Aliaksei,
>
> thank you for your reply. I dowloade Bloc from the source you gave me and
> realized the memory tutorial is the same one wich was shown at the
> PharoDays2017. I watched this video yesterday and tried to follow along but
> it did not quite work. That was the reason why I found this strange old
> paper.
>
> I did it now again but following the PDF file. I get the same kind of
> problem. The code seems to be right but when I run a new Card object wich
> should be  grey sqaure by this point the Inspector shows nothing.
> Resetting the Bloc universe did not help either.
> 
>
>
> It looks like its would be empty. Do you have any idea how I can fix this?
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Dimitris Chloupis
yeah I am afraid I understood exactly what you meant because at first that
was my initial desire when I made Atlas.

Essentially you want auto mapping of Python objects to Pharo, so you wont
have to deal with Python and do everything from inside the Pharo image. So
essentially reading and writing Python objects as if they were Pharo
objects.

Take a more careful look to my reply, you will see that is exactly what I
am focusing on.

Unless you dont mean automatically and mean manually, which in that case is
something I have already done.

I used SmaCC , as already pointed out it already maps python syntax to
pharo objects. So lucky for you this work is done for you. But you still
need to traverse the object tree to do the remapping and there lies the
tricky part for all the reasons I already explained in the previous answer
,again assuming you want to do this automagically.

Ironically one would expect to be relative easy to convert Python objects
to Pharo objects , while making Python able to live code , incredible hard.

After trying both I can tell you that turning Python to a live coding
environment was a walk in the park. Mapping objects is making me have
nightmares.

You will be lucky if the objects are pure data of primitive format, this
means, floats, strings, integers and all the other usual suspects. In that
case you dont even need to worry about conversion you just export to JSON
and import back to Pharo and voila you have objects that are both Pharo and
Python compatible. JSON is such a common format that can be used any way
you like, you want to write it to a file, share it in memory, transmit it
through socket, anything you like its possible.

But then moment the Python objects maps to some exotic object with
dependencies  to C code, welcome to dependency hell, fasten your seat belt
its going to be a bumpy ride.

On Wed, Jan 10, 2018 at 5:59 PM Julien  wrote:

> Even if I learned things from your answer, I think you misunderstood what
> I was talking about. :p
>
> What I want is a mechanism to describe python’s objects from Pharo and
> being able to:
> 1. Serialise those objects from Python
> 2. Send those object to Pharo (whatever the way it is done: socket, write
> in a file from python and read from Pharo, etc…)
> 3. Materialize those serialised Python’s objects as Pharo objects.
>
> Basically, I want to be able to transfer data from Python to Pharo easily.
>
> Something better than getting the values held by Python objects by parsing
> their String representation « by hand »... :-)
>
> Julien
>
> ---
> Julien Delplanque
> Doctorant à l’Université de Lille 1
> http://juliendelplanque.be/phd.html
> Equipe Rmod, Inria
> Bâtiment B 40, avenue Halley 59650
> 
>  Villeneuve
> 
>  d'Ascq
> 
> Numéro de téléphone: +333 59 35 86 40 <+33%203%2059%2035%2086%2040>
>
> Le 10 janv. 2018 à 16:43, Dimitris Chloupis  a
> écrit :
>
>
>
> On Mon, Jan 8, 2018 at 5:50 PM Julien  wrote:
>
>> Beware that no mechanism to get back values from Python is defined for
>> now (except if you just want the String
>> representation of those objects, then you can get that if you use atlas).
>>
>> I’d like to have that but it is not easy. I would like a way to describe
>> how to map Python’s objects to Pharo’s objects
>> from Pharo and to have the code to do that in Python side generated
>> automatically but some thinking is needed…
>>
>> Julien
>>
>
> It won't be easy
>
> I have noted in the past the similarities between Pharo and Python but
> here there is also a massive difference.
>
> In Pharo we have the mentality of reinventing many stuffs ourselves so the
> systems is based to a very large extend on Pharo that runs on very
> efficient JIT VM. Almost everything is Pharo code.
>
> Python on the other hand is the exact opposite, Python runs on an
> extremely slow VM but more than 50% of its code in written in C, Python
> itself or its third party libraries.
>
> So the irony is that even though in theory and practice Python code is one
> of the slowest , in actual scenarios its one of the fastest able to
> outperform even Java to a very large extend because its libraries that are
> made for high performance like Numpy are predominately C code. Pretty much
> every C or C++ library has wrappers for Python which is what made it so
> popular. Hence the reason behind the insanity when it comes to top
> performance Python being second only to C++.
>
> So you will have not only map the Python oobjects  to Pharo object but
> also map the C code. Even though this may sound impossible the good news is
> that Python libraries, having the extension pyd , are basically DLLs made
> supporting a specific API which is very minimal in desig

Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Julien
Even if I learned things from your answer, I think you misunderstood what I was 
talking about. :p

What I want is a mechanism to describe python’s objects from Pharo and being 
able to:
1. Serialise those objects from Python
2. Send those object to Pharo (whatever the way it is done: socket, write in a 
file from python and read from Pharo, etc…)
3. Materialize those serialised Python’s objects as Pharo objects.

Basically, I want to be able to transfer data from Python to Pharo easily.

Something better than getting the values held by Python objects by parsing 
their String representation « by hand »... :-)

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

> Le 10 janv. 2018 à 16:43, Dimitris Chloupis  a écrit :
> 
> 
> 
> On Mon, Jan 8, 2018 at 5:50 PM Julien  > wrote:
> Beware that no mechanism to get back values from Python is defined for now 
> (except if you just want the String
> representation of those objects, then you can get that if you use atlas).
> 
> I’d like to have that but it is not easy. I would like a way to describe how 
> to map Python’s objects to Pharo’s objects
> from Pharo and to have the code to do that in Python side generated 
> automatically but some thinking is needed…
> 
> Julien
> 
> It won't be easy
> 
> I have noted in the past the similarities between Pharo and Python but here 
> there is also a massive difference. 
> 
> In Pharo we have the mentality of reinventing many stuffs ourselves so the 
> systems is based to a very large extend on Pharo that runs on very efficient 
> JIT VM. Almost everything is Pharo code.
> 
> Python on the other hand is the exact opposite, Python runs on an extremely 
> slow VM but more than 50% of its code in written in C, Python itself or its 
> third party libraries. 
> 
> So the irony is that even though in theory and practice Python code is one of 
> the slowest , in actual scenarios its one of the fastest able to outperform 
> even Java to a very large extend because its libraries that are made for high 
> performance like Numpy are predominately C code. Pretty much every C or C++ 
> library has wrappers for Python which is what made it so popular. Hence the 
> reason behind the insanity when it comes to top performance Python being 
> second only to C++. 
> 
> So you will have not only map the Python oobjects  to Pharo object but also 
> map the C code. Even though this may sound impossible the good news is that 
> Python libraries, having the extension pyd , are basically DLLs made 
> supporting a specific API which is very minimal in design. Similar to our 
> UFFI , the only major difference is that library is responsible of keeping 
> track of the reference count, which is used by Python GC to erase no longer 
> used objects from memory. Which is a very simple increase and decrease.
> 
> So not only you will have to remap the Python objects but also DLLs as well. 
> 
> To add salt to the wound , Python has something that Pharo does not. Multiple 
> inheritance. Which of course makes your goal even harder. Python coder's 
> generally avoid multiple inheritance as much as we avoid overriding 
> doesNotUnderstand , but its a feature they use none the less. 
> 
> Hence why I did not even consider trying something like that. Plus you will 
> be gaining no advantage because C code is unportable to Pharo anyway. Sure we 
> have Slang , but Slang is extra careful with types which normal Pharo code 
> does not. You will be losing performance because yes porting to Pharo as much 
> as JIT VM may be great , its no much for Python libraries that merely 
> leverage C. Plus you will have to update it each time the library changes 
> etc. 
> 
> So my conclusion was that the most efficient way was to let Python execute 
> the library and just manipulate Python. 
> 
> It's much easier to do the exact opposite, which goes against our mentality , 
> and port your Pharo objects to Python objects. Because a) your objects will 
> always be far less than a complete library and system b) you wont have to 
> worry about C code because you wont have any c) all the other negatives I 
> mention , disappear. 
> 
> It usual case of not being able to have your cake and eat it too. 
>  



Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Dimitris Chloupis
On Mon, Jan 8, 2018 at 5:50 PM Julien  wrote:

> Beware that no mechanism to get back values from Python is defined for now
> (except if you just want the String
> representation of those objects, then you can get that if you use atlas).
>
> I’d like to have that but it is not easy. I would like a way to describe
> how to map Python’s objects to Pharo’s objects
> from Pharo and to have the code to do that in Python side generated
> automatically but some thinking is needed…
>
> Julien
>

It won't be easy

I have noted in the past the similarities between Pharo and Python but here
there is also a massive difference.

In Pharo we have the mentality of reinventing many stuffs ourselves so the
systems is based to a very large extend on Pharo that runs on very
efficient JIT VM. Almost everything is Pharo code.

Python on the other hand is the exact opposite, Python runs on an extremely
slow VM but more than 50% of its code in written in C, Python itself or its
third party libraries.

So the irony is that even though in theory and practice Python code is one
of the slowest , in actual scenarios its one of the fastest able to
outperform even Java to a very large extend because its libraries that are
made for high performance like Numpy are predominately C code. Pretty much
every C or C++ library has wrappers for Python which is what made it so
popular. Hence the reason behind the insanity when it comes to top
performance Python being second only to C++.

So you will have not only map the Python oobjects  to Pharo object but also
map the C code. Even though this may sound impossible the good news is that
Python libraries, having the extension pyd , are basically DLLs made
supporting a specific API which is very minimal in design. Similar to our
UFFI , the only major difference is that library is responsible of keeping
track of the reference count, which is used by Python GC to erase no longer
used objects from memory. Which is a very simple increase and decrease.

So not only you will have to remap the Python objects but also DLLs as
well.

To add salt to the wound , Python has something that Pharo does not.
Multiple inheritance. Which of course makes your goal even harder. Python
coder's generally avoid multiple inheritance as much as we avoid overriding
doesNotUnderstand , but its a feature they use none the less.

Hence why I did not even consider trying something like that. Plus you will
be gaining no advantage because C code is unportable to Pharo anyway. Sure
we have Slang , but Slang is extra careful with types which normal Pharo
code does not. You will be losing performance because yes porting to Pharo
as much as JIT VM may be great , its no much for Python libraries that
merely leverage C. Plus you will have to update it each time the library
changes etc.

So my conclusion was that the most efficient way was to let Python execute
the library and just manipulate Python.

It's much easier to do the exact opposite, which goes against our mentality
, and port your Pharo objects to Python objects. Because a) your objects
will always be far less than a complete library and system b) you wont have
to worry about C code because you wont have any c) all the other negatives
I mention , disappear.

It usual case of not being able to have your cake and eat it too.


Re: [Pharo-users] How to I setup Bloc?

2018-01-10 Thread Photon
Hi Aliaksei,

thank you for your reply. I dowloade Bloc from the source you gave me and
realized the memory tutorial is the same one wich was shown at the
PharoDays2017. I watched this video yesterday and tried to follow along but
it did not quite work. That was the reason why I found this strange old
paper.

I did it now again but following the PDF file. I get the same kind of
problem. The code seems to be right but when I run a new Card object wich
should be  grey sqaure by this point the Inspector shows nothing. 
Resetting the Bloc universe did not help either.
 


It looks like its would be empty. Do you have any idea how I can fix this?



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Thierry Goubier
2018-01-10 14:41 GMT+01:00 Serge Stinckwich :

>
>
> On Wed, Jan 10, 2018 at 2:35 PM, Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
>
>>
>>
>> 2018-01-10 14:26 GMT+01:00 Serge Stinckwich :
>>
>>>
>>>
>>> On Wed, Jan 10, 2018 at 2:23 PM, Julien 
>>> wrote:
>>>
 Hello Serge,

 Do you mean pieces of code you wrote in Python using Numpy that you
 want to transform to Smalltalk code using PolyMath?

 It’s kind of the other way around of this project. :-)


>>> ​yes this is exactly the opposite :-(​
>>> ​I guess I need a Python parser and after that I can do AST
>>> transformation ...
>>>
>>
>> Hi Serge,
>>
>> there is a Python2.7 parser with AST that could be used.
>>
>
>
> ​yes I might have a look ... where is the code ?
>

SmaCC on github. Look for SmaCC-Python and SmaCC-Python-Tests.If you're
using Moose,
you should be able to import just SmaCC-Python from the github repository.
There is even a
BaselineOfPythonParser, but I haven't used it.

Thierry


> ​
>
> --
> 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/
>


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Julien
I see :-)

Another interesting project then. :-)

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

> Le 10 janv. 2018 à 14:39, Serge Stinckwich  a 
> écrit :
> 
> 
> 
> On Wed, Jan 10, 2018 at 2:33 PM, Julien  > wrote:
> I guess the hardest part will be to define the 1 - 1 mapping between Numpy 
> and PolyMath APIs, no?
> 
> I mean, how can you ensure that features using Floats will behave exactly the 
> same in Python and Smalltalk for example?
> 
> 
> ​Float are the same basically,​ but ​I don't want to ensure something.
> I just want to a quick&dirty code transformation :-)
> 
> Like : 
> np.square(x) <=> x squared
> np.sum(x,1) <=> x sum
> 
> et donc : 
> np.sum(np.square(x), 1) <=> (x squared) sum
> 
> -- 
> 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/ 


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Serge Stinckwich
On Wed, Jan 10, 2018 at 2:35 PM, Thierry Goubier 
wrote:

>
>
> 2018-01-10 14:26 GMT+01:00 Serge Stinckwich :
>
>>
>>
>> On Wed, Jan 10, 2018 at 2:23 PM, Julien 
>> wrote:
>>
>>> Hello Serge,
>>>
>>> Do you mean pieces of code you wrote in Python using Numpy that you want
>>> to transform to Smalltalk code using PolyMath?
>>>
>>> It’s kind of the other way around of this project. :-)
>>>
>>>
>> ​yes this is exactly the opposite :-(​
>> ​I guess I need a Python parser and after that I can do AST
>> transformation ...
>>
>
> Hi Serge,
>
> there is a Python2.7 parser with AST that could be used.
>


​yes I might have a look ... where is the code ?
​

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


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Serge Stinckwich
On Wed, Jan 10, 2018 at 2:33 PM, Julien  wrote:

> I guess the hardest part will be to define the 1 - 1 mapping between Numpy
> and PolyMath APIs, no?
>
> I mean, how can you ensure that features using Floats will behave exactly
> the same in Python and Smalltalk for example?
>
>
​Float are the same basically,​ but ​I don't want to ensure something.
I just want to a quick&dirty code transformation :-)

Like :
np.square(x) <=> x squared
np.sum(x,1) <=> x sum

et donc :
np.sum(np.square(x), 1) <=> (x squared) sum

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


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Thierry Goubier
2018-01-10 14:26 GMT+01:00 Serge Stinckwich :

>
>
> On Wed, Jan 10, 2018 at 2:23 PM, Julien 
> wrote:
>
>> Hello Serge,
>>
>> Do you mean pieces of code you wrote in Python using Numpy that you want
>> to transform to Smalltalk code using PolyMath?
>>
>> It’s kind of the other way around of this project. :-)
>>
>>
> ​yes this is exactly the opposite :-(​
> ​I guess I need a Python parser and after that I can do AST transformation
> ...
>

Hi Serge,

there is a Python2.7 parser with AST that could be used.

Thierry


> Or using regex I can do basic stuff ...​
>
> --
> 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/
>


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Julien
I guess the hardest part will be to define the 1 - 1 mapping between Numpy and 
PolyMath APIs, no?

I mean, how can you ensure that features using Floats will behave exactly the 
same in Python and Smalltalk for example?

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

> Le 10 janv. 2018 à 14:26, Serge Stinckwich  a 
> écrit :
> 
> 
> 
> On Wed, Jan 10, 2018 at 2:23 PM, Julien  > wrote:
> Hello Serge,
> 
> Do you mean pieces of code you wrote in Python using Numpy that you want to 
> transform to Smalltalk code using PolyMath?
> 
> It’s kind of the other way around of this project. :-)
> 
> 
> ​yes this is exactly the opposite :-(​
> ​I guess I need a Python parser and after that I can do AST transformation ...
> Or using regex I can do basic stuff ...​
> 
> -- 
> 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/ 


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Serge Stinckwich
On Wed, Jan 10, 2018 at 2:23 PM, Julien  wrote:

> Hello Serge,
>
> Do you mean pieces of code you wrote in Python using Numpy that you want
> to transform to Smalltalk code using PolyMath?
>
> It’s kind of the other way around of this project. :-)
>
>
​yes this is exactly the opposite :-(​
​I guess I need a Python parser and after that I can do AST transformation
...
Or using regex I can do basic stuff ...​

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


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Julien
Hello Serge,

Do you mean pieces of code you wrote in Python using Numpy that you want to 
transform to Smalltalk code using PolyMath?

It’s kind of the other way around of this project. :-)

Julien


---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

> Le 10 janv. 2018 à 14:07, Serge Stinckwich  a 
> écrit :
> 
> Thank you Julien for this very interesting piece of code.
> What I need at the moment is a way to transform semi-automatically Numpy code 
> to PolyMath code ...
> 
> On Mon, Jan 1, 2018 at 8:22 PM, Julien  > wrote:
> Hello,
> 
> My new year main resolution: stop keeping my side-projects for me.
> 
> It’s been like 1 year that I created these two projects, one coming from a 
> refactoring of the other.
> Now it is time to take time to announce them.
> 
> I initially come from Python world and during my bachelor & master, I really 
> liked to use matplotlib to plot data using Python.
> 
> So I wanted to be able to use this Python module from Pharo. I did it by 
> generating Python 3 code from Pharo and making Python 3 executing it. So, 
> first I implemented everything in MatplotLibBridge package and then I split 
> it in two package in order to be able to eventually create bridges to other 
> Python 3 modules.
> 
> So, Python3Generator [1] is made for generating programatically Python 3 code 
> from Pharo. Basically, it allows you to easily build a Python 3 AST,  to 
> serialize it in Python 3 source code and eventually to execute it. For now 
> you can transfer data from Pharo to Python (e.g. providing arguments to 
> functions that are Pharo’s objects) but you can not retrieve data stored in 
> Python variable from Pharo (but it should be possible, just I don’t need to 
> do that for my bridge to matplotlib). Some examples are provided on the 
> github’s README.
> 
> MatplotLibBridge [2] is made for creating plots using matplotlib [3] from 
> Pharo. There is a bunch of examples of what you can do on the README. The two 
> features from matplotlib I like the most are: 1. You can generate your plot 
> in a lot of file formats (png, pdf, svg, ps, etc…) 2. It allows to embed 
> LaTeX mathematical formulae everywhere in the plot (which can be really 
> cool). All the possible plots in matplotlib are not available in Pharo’s side 
> because I build parts of the bridge when I need them but it is not hard to 
> do. I someone is interested in a plot type not available yet, please tell me.
> 
> So, it is announced, if someone want to do something with those, please do it!
> 
> Happy new year.
> 
> Regards,
> 
> Julien
> 
> [1]: https://github.com/juliendelplanque/Python3Generator 
> 
> [2]: https://github.com/juliendelplanque/MatplotLibBridge 
> 
> [3]: https://matplotlib.org 
> 
> ---
> Julien Delplanque
> Doctorant à l’Université de Lille 1
> http://juliendelplanque.be/phd.html 
> Equipe Rmod, Inria
> Bâtiment B 40, avenue Halley 59650 
> 
>  Villeneuve 
> 
>  d'Ascq 
> 
> Numéro de téléphone: +333 59 35 86 40 
> 
> 
> 
> -- 
> 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/ 


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Serge Stinckwich
Thank you Julien for this very interesting piece of code.
What I need at the moment is a way to transform semi-automatically Numpy
code to PolyMath code ...

On Mon, Jan 1, 2018 at 8:22 PM, Julien  wrote:

> Hello,
>
> My new year main resolution: stop keeping my side-projects for me.
>
> It’s been like 1 year that I created these two projects, one coming from a
> refactoring of the other.
> Now it is time to take time to announce them.
>
> I initially come from Python world and during my bachelor & master, I
> really liked to use matplotlib to plot data using Python.
>
> So I wanted to be able to use this Python module from Pharo. I did it by
> generating Python 3 code from Pharo and making Python 3 executing it. So,
> first I implemented everything in MatplotLibBridge package and then I split
> it in two package in order to be able to eventually create bridges to other
> Python 3 modules.
>
> So, Python3Generator [1] is made for generating programatically Python 3
> code from Pharo. Basically, it allows you to easily build a Python 3 AST,
>  to serialize it in Python 3 source code and eventually to execute it. For
> now you can transfer data from Pharo to Python (e.g. providing arguments to
> functions that are Pharo’s objects) but you can not retrieve data stored in
> Python variable from Pharo (but it should be possible, just I don’t need to
> do that for my bridge to matplotlib). Some examples are provided on the
> github’s README.
>
> MatplotLibBridge [2] is made for creating plots using matplotlib [3] from
> Pharo. There is a bunch of examples of what you can do on the README. The
> two features from matplotlib I like the most are: 1. You can generate your
> plot in a lot of file formats (png, pdf, svg, ps, etc…) 2. It allows to
> embed LaTeX mathematical formulae everywhere in the plot (which can be
> really cool). All the possible plots in matplotlib are not available in
> Pharo’s side because I build parts of the bridge when I need them but it is
> not hard to do. I someone is interested in a plot type not available yet,
> please tell me.
>
> So, it is announced, if someone want to do something with those, please do
> it!
>
> Happy new year.
>
> Regards,
>
> Julien
>
> [1]: https://github.com/juliendelplanque/Python3Generator
> [2]: https://github.com/juliendelplanque/MatplotLibBridge
> [3]: https://matplotlib.org
>
> ---
> Julien Delplanque
> Doctorant à l’Université de Lille 1
> http://juliendelplanque.be/phd.html
> Equipe Rmod, Inria
> Bâtiment B 40, avenue Halley 59650
> 
>  Villeneuve
> 
>  d'Ascq
> 
> Numéro de téléphone: +333 59 35 86 40 <+33%203%2059%2035%2086%2040>
>
>


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