Re: [Pharo-users] Problem to open Pharo 50 on Windows

2016-01-30 Thread Stephan Eggermont

On 28-01-16 15:45, Justine STIENNE wrote:

I always have the same problem. When I want to open the image, Pharo is
loading but it never becomes opened.


Did you manage to get it to work?

The new spur vm cannot open old images, and the old vm cannot open the 
new images. Though you could change the image format from old to new, it 
normally is a better idea to just load your code into a fresh image. 
Another thing is that you also need the sources file.


Stephan




Re: [Pharo-users] mini Actor model in two classes and

2016-01-30 Thread stepharo

Hi serge

I did not fixed actalk I just hack a minimal one.
If I change and fix actalk I will push fixes.
Stef

Le 29/1/16 07:39, serge.stinckw...@gmail.com a écrit :

I didn't try Actalk since a long time ;-)
Did you try on Pharo 5.0 ?
Could you push your modifications on the repo?

Sent from my iPhone

On 28 janv. 2016, at 08:40, stepharo > wrote:



thanks I will have a look.
(now drilling the floor ;)

I was reading the implementation of Actalk (port by serge)
Serge BTW the subclass of SharedQueue are not working anymore because 
they access to state that does not

exist.

Stef


Le 27/1/16 22:20, Norbert Hartl a écrit :
Super simple implementation. I made Andrew Blacks Erlang example run 
on pharo a while ago if you are interested.


http://smalltalkhub.com/#!/~NorbertHartl/Erlang 



Keep us posted what you learn so we can, too ;)

Norbert

Am 27.01.2016 um 21:53 schrieb stepharo :


Hi

Since long time I wanted to have fun building a mini actor model.
So I did one and I attached the skeleton of a future chapter for 
FunWithPharo :)


Now I will read about futures and the rest.

may be there is a problem with the compiling behavior.
(see thread learningObject)

Stef








Re: [Pharo-users] Pharo and OpenMP

2016-01-30 Thread Offray Vladimir Luna Cárdenas

Hi,

On 30/01/16 18:26, David Allouche wrote:


On 26 Jan 2016, at 18:24, Dimitris Chloupis > wrote:


First my apology for the very long post but I think this will 
interest a lot of people.


I found that intriguing.

I wonder whether the lack of response means:

  * The message was too long.
  * Nobody cares.
  * It's too wrong to respond.
  * It's too clever to respond.
  * All of the above.


Just curious…

PS: Working hard on concision ;-)



When I have messages without any answer in Pharo communities is almost 
always related with the first option (message was to long) or another 
reason is that is still pretty distant in the sense of being 
theoretical, hypothetical or something like that. What works best is 
concrete questions about practical issues, usually including code 
snippets (at least for me), while leaving long/distant stuff for blog 
post. That was the exploration I made here:


http://mutabit.com/offray/static/blog/output/posts/grafoscopio-idea-and-initial-progress.html

Cheers,

Offray


[Pharo-users] Windows headless and service

2016-01-30 Thread Torsten Bergmann
Running as Windows Service was possible back in Squeak VM days where
Andreas Raab implemented registration into SCM (Service Control Manager).
Code should be in Pharo VM too.

See also http://forum.world.st/headless-CogVM-on-Windows-td4648336.html

Possibly the "-service" may be broken/may not be recognized in Pharo Win VM
anymore, havent checked.

Bye
T.



Re: [Pharo-users] Pharo and OpenMP

2016-01-30 Thread David Allouche

> On 26 Jan 2016, at 18:24, Dimitris Chloupis  wrote:
> 
> First my apology for the very long post but I think this will interest a lot 
> of people. 

I found that intriguing.

I wonder whether the lack of response means:
The message was too long.
Nobody cares.
It's too wrong to respond.
It's too clever to respond.
All of the above.

Just curious…

PS: Working hard on concision ;-)

Re: [Pharo-users] Pharo and OpenMP

2016-01-30 Thread Paul DeBruicker
If it helps - The "original" OpenMP thread is here:

http://forum.world.st/NativeBoost-and-OpenMP-td4837865.html






David Allouche wrote
>> On 26 Jan 2016, at 18:24, Dimitris Chloupis <

> kilon.alios@

> > wrote:
>> 
>> First my apology for the very long post but I think this will interest a
>> lot of people. 
> 
> I found that intriguing.
> 
> I wonder whether the lack of response means:
> The message was too long.
> Nobody cares.
> It's too wrong to respond.
> It's too clever to respond.
> All of the above.
> 
> Just curious…
> 
> PS: Working hard on concision ;-)





--
View this message in context: 
http://forum.world.st/Pharo-and-OpenMP-tp4874277p4874989.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Pharo and OpenMP

2016-01-30 Thread Ben Coman
On Wed, Jan 27, 2016 at 1:24 AM, Dimitris Chloupis
 wrote:
> First my apology for the very long post but I think this will interest a lot
> of people.
>
> I have seen that someone out there  HELOOO has tried Pharo with
> OpenMP
>
> https://pharoweekly.wordpress.com/2015/07/17/pharo-and-openmp/
>
> For those that dont know what the hell OpenMP is, it nothing more than a
> collection of C pragmas, not very diffirent to our pharo pragmas , that tell
> to a compiler how to make code parallel.
>
> By parallel I don't mean pharo threads which are not really code that
> executes at the same time but true hardware threads and taking advantage of
> multiple cores etc. A pharo holy grail.
>
> Parallel coding is a bitch, there a lot of logical problems to face when you
> have pieces of code executing at the same time and you have to be aware of
> how the hardware is doing it because if you dont it so easy to get code as
> slow as running it on a single thread.
>
> I have been watching youtube tutorials by one of the guys that made OpenMP
> and I have to say I am very impressed. And it got me wondering "why the hell
> not pharo". The nice thing about OpenMP is that it does not matter that
> pharo VM can do only 1 thread which is the main thread, you can do multiple
> threads at C side using OpenMP and then collapse them to one thread and send
> the result back to pharo.
>
> Also note OpenMP is engineered by Intel so its a very serious library and
> comes included with most modern compilers and that includes GCC. Visual
> Studio and Clang / LLVM
>
> On the other hand lately I am also researching shared memory, actually its
> shared memory that lead me to OpenMP.   My idea is basically extending the
> live coding enviroment of pharo beyond pharo.
>
> Its sound a bit crazy but the way I see it from my very small knowledge of C
> and shared memory is that right now, pharo live coding evniroment is
> isolated from outside world. You can do live coding while inside pharo but
> the moment you go outside , say you call a C library , live coding goes out
> of the window. This why we need to have session management to manage
> resource of calling C libraries to make sure when we reload the image , the
> image does not freak out that the live state of the C libraries is gone.


I guess you won't avoid session management with this idea of memory
mapped C-image, since the external resources provide from the OS like
files, display buffers, network buffers & GPU threads would still be
destroyed by the OS when Pharo exits. Consider the case of moving your
Pharo-image + C-image to another machine.


>
> This is also why many people push things to the image side. And of course
> its much more fun to code in Pharo than C.
>
> Now bear with me because things are now getting really interesting
>
>  what if we could have an image flle for C code ?
>
> The things is that I am interested into shared memory because I want a very
> fast IPC, shared memory is the faster. I want to communicate Pharo with
> Blender, that I have accomplished via sockets, I can call python code and
> python libraries from pharo. But sockets are expensive in large loops, they
> work great for simple communication and much faster than pipes when used
> locally but try a large loop and socket will lag.
>
> Shared memory on the other hand is super fast, it basically it gives a part
> of memory that is shared among process that means also different
> applications.
>
> Now how a C image file fits into all this you may ask.
>
> Its simple.
>
> The most popular way of shared memory is called "memory mapped file", what
> it does is that it takes a file and loads it to memory as it is... sound
> familiar ? ;)
>
> what however is also doing is that it allows you share that part of the
> memory with any other application/ process as long as it also tries to load
> the file mapped to memory the same way.
>
> So what that means that we can have a place in memory that is shared between
> C code, including C dlls, and Pharo code. That file can act as an image file
> because we take that shared memory at any time that has been modified either
> by pharo, C or whatever else has access to shared memmory and store it back
> to that file. This is functionality that memory mapped files provide called
> msync.
>
> We talk here about a C image that work at least on surface very similarly to
> Pharo image.
>
> Now where OpenMP fits in all this ?
>
> Since OpenMP is about code that eats processors like peanuts , yes we could
> call it from a DLL, but with my approach even if that code crashes we will
> be able to restore it back to its live state because of that image format.
> All we do is reopen the memory mapped file and restore from it the shared
> memory. So we end up with true parallel live C/Pharo code with live state
> that and of course live code that is shared between Pharo and pretty much
> anything that uses C or python or why not other languages.
>
> So far I kn

Re: [Pharo-users] Some Spotter Questions

2016-01-30 Thread Tudor Girba
Hi,


> On Jan 28, 2016, at 10:15 AM, Sven Van Caekenberghe  wrote:
> 
> Doru,
> 
>> On 27 Jan 2016, at 17:46, Tudor Girba  wrote:
>> 
>> Hi,
>> 
>>> On Jan 27, 2016, at 4:54 PM, Sven Van Caekenberghe  wrote:
>>> 
>>> Hi,
>>> 
>>> I managed to add a spotter extension and preview, but I still have some 
>>> questions.
>> 
>> Thank you! Can you describe the extension?
> 
> Not yet, but soon ;-)

Ok, great :).


>>> Is there some global top level overview documentation about writing Spotter 
>>> extensions ?
>> 
>> Only some blog posts:
>> https://www.google.com/search?client=safari&rls=en&q=site:humane-assessment.com+GTSpotter
> 
> I found that, I also used Torsten's article:
> 
> https://medium.com/concerning-pharo/multiple-desktops-for-pharo-5cbc46f3179f
> 
> which is using GT tools in a nice/cool way.
> 
> Still, it is not enough.

Agreed.


>> Writing a help is in progress. It would be very useful to drive it through 
>> your questions.
>> 
>> 
>>> Is the only way to add a 'global/first' search extension by adding a method 
>>> to class GTSpotter itself ?
>> 
>> Yes.
>> 
>> 
>>> I don't see any other package do that (in a modular way), it feels a bit 
>>> wrong compared to how modular the GT inspector is.
>> 
>> It is exactly the same design as the inspector. Every step in Spotter has an 
>> object as an input (like the inspector), and the first object when opening 
>> Spotter is an instance of GTSpotter.
> 
> It just felt strange to be the first to add an extension there.

We were also thinking of adding an extra discovery mechanism for any class with 
a special pragma, but at the moment it worked fine like this.


>>> Is there a way to reuse a GT inspector view as a preview ? I tried that but 
>>> it did not work, but what I copied over was 99% identical.
>> 
>> Not yet. The problem is the missing 1% :)
> 
> Duplicating the functionality like we have to do today should ideally be 
> avoided (see my example at the end).

Of course :). The problem is that Spotter is built on another infrastructure 
than the Inspector. We will consolidate both in one in the future.


>>> Can you have tabs (multiple pages) in the preview ?
>> 
>> Not for now. At the moment, you can have multiple previews, and only the 
>> first one will be displayed.
> 
> OK
> 
>>> Is it possible to control on what tab an inspector opens when a matching 
>>> item is clicked (like to maintain the same view as the preview) ?
>> 
>> No.
>> 
>> 
>>> What are some best practices for the order, exact matches, fast searching, 
>>> etc … ?
>> 
>> Not much. The best practice is to simply watch the usage, and try to 
>> accommodate the best way :).
> 
> It is very cool to be able to inspect the pragma and browse each usage as 
> source code !

:). Actually, I use this as an example for people that do not use Pharo. 
Annotations are incredibly wide-spread today, and no IDE has a first-class 
search for annotations. Funny, no?


>>> Is it possible to search in multiple ways (multiple properties), not just 
>>> collection -> itemName -> GTFilterSubstring ? (Say I want to search all 
>>> fields of an address object).
>> 
>> Of course. Take a look at the GTFilter hierarchy, and you can just write 
>> your own.
>> 
>> 
>>> Searching for Color by name, or by RGB and other representations would seem 
>>> like a good tutorial example (for me).
>> 
>> I am not sure I understand, but it sounds intriguing and I am looking for a 
>> case that we can use for a tutorial. Could you elaborate? Perhaps we can 
>> write this together.
> 
> GTSpotter>>#spotterForColorFor: aStep
>  
>  aStep listProcessor
>title: 'Color';
>allCandidates: [ Color brickColorRegistry values ];
>itemName: [ :each | each name ];
>filter: GTFilterSubstring;
>wantsToDisplayOnEmptyQuery: false
> 
> Color>>#spotterPreviewColorIn: aComposite
>  
>  aComposite custom: (BorderedMorph new color: self)
> 
> This works fine. 

Nice idea. This could work well. Now, to be able to cover all Spotter 
functionality, we would also need to find a way to have a meaningful processor 
when diving in a Color object. Any idea?

How about, searching for similar colors?


> Just for fun, I would also like to be able to search using CSS style color 
> specs, like FFF or C0C0C0 (3 or 6 hex digits for RGB). How would that fit in 
> ?  There is #asHexString, but I would like a bit more control and 
> intelligence from my part: I want to write the test and there would only be 
> one answer.

That is even cooler. This would exemplify how to build a custom filter.

Cheers,
Doru


> Sven
> 
>> Cheers,
>> Doru
>> 
>> 
>>> Thx,
>>> 
>>> Sven
>> 
>> --
>> www.tudorgirba.com
>> www.feenk.com
>> 
>> "Don't give to get. Just give."
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 

--
www.tudorgirba.com
www.feenk.com

"Every thing should have the right to be different."