Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Otto Behrens
Sorry, I see there are some unresolved dependencies on our code. Let
me know if I should work on that.

On Wed, Oct 19, 2016 at 5:44 AM, Otto Behrens  wrote:
>> Do you mean internal or embedded DSL? I am open to write an DSL if
>> facilitates the job, the thing with the Trevor's paper is that he defines 6
>> implementations of FSM's (and in each implementation he considers several
>> issues leading to sub-implementations) so I would like a DSL which let me
>> express different implementations for the same FSM. Plus there are FSM
>> implementations out there: HotDraw, Connectors, MIDIInputParser, XMIReader,
>> SState, etc. I think a "correct" DSL would enable to define any of them
>> right?
>
> I just meant some syntactically terse way of expressing a state
> machine so that one can see the logic clearly. Representing a state
> machine in a graphical way is ideal. We did this once, but the problem
> is to make the state machine definition resilient to refactorings and
> changes to the code. What I mean is that compiling something into code
> is a one way thing; to keep it maintained, one would like to "reverse
> compile" and draw the state machine from code.
>
> A "correct" DSL would be something like a Harel state diagram, which
> should be able to express most requirements.
>
> I attach our state package, if you're interested. Not directly one of
> the approaches in Trevor's paper. Perhaps another option. I would like
> to extend it to use guards and actions and more.
>
>> The approach I am using now is a parametrized code generator, using
>> templates (not in the form of T4 templates), so it's a long way.
>> Maybe Helvetia could help?
>
> Out of my depth here; will have to read a lot more.
>
>>
>>
>>>
>>> On Tue, Oct 18, 2016 at 9:29 AM, Julien Delplanque 
>>> wrote:
>>> > Hello,
>>> >
>>> > A generator for the visitor design pattern:
>>> > - Generate methods in visited objects: VisitedObject>>#accept: (with the
>>> > selector name configurable)
>>> > - Generate empty methods (or methods with a "self
>>> > subclassResponsability" if
>>> > an abstract visitor is generated)
>>> > called in #accept: methods of VisitedObjects in the Visitor i.e
>>> > Visitor>>#acceptVisitedObject: (with the selector
>>> > name configurable again).
>>> >
>>> > Each time this design pattern has to be used, it is annoying to write by
>>> > hand all these methods.
>>> >
>>> > Regards,
>>> >
>>> > Julien
>>> >
>>> >
>>> > On 18/10/16 07:24, Hernán Morales Durand wrote:
>>> >>
>>> >> Hi guys,
>>> >>
>>> >> I am writing a code generator, doing a few iterations right now.
>>> >> I want your opinion, which most useful thing would you like to be
>>> >> generated
>>> >> automatically? It could be a pattern, an idiom, another language...
>>> >>
>>> >> For example my own wish (roadmap) list:
>>> >>
>>> >> - A "settings framework" settings class generator.
>>> >> - A state machine generator (based in the excellent paper of Trevor P.
>>> >> Hopkins)
>>> >> - A Spec UI generator.
>>> >>
>>> >> Let me know your thoughts.
>>> >>
>>> >> Cheers,
>>> >>
>>> >> Hernán
>>> >>
>>> >
>>> >
>>>
>>



Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Otto Behrens
> Do you mean internal or embedded DSL? I am open to write an DSL if
> facilitates the job, the thing with the Trevor's paper is that he defines 6
> implementations of FSM's (and in each implementation he considers several
> issues leading to sub-implementations) so I would like a DSL which let me
> express different implementations for the same FSM. Plus there are FSM
> implementations out there: HotDraw, Connectors, MIDIInputParser, XMIReader,
> SState, etc. I think a "correct" DSL would enable to define any of them
> right?

I just meant some syntactically terse way of expressing a state
machine so that one can see the logic clearly. Representing a state
machine in a graphical way is ideal. We did this once, but the problem
is to make the state machine definition resilient to refactorings and
changes to the code. What I mean is that compiling something into code
is a one way thing; to keep it maintained, one would like to "reverse
compile" and draw the state machine from code.

A "correct" DSL would be something like a Harel state diagram, which
should be able to express most requirements.

I attach our state package, if you're interested. Not directly one of
the approaches in Trevor's paper. Perhaps another option. I would like
to extend it to use guards and actions and more.

> The approach I am using now is a parametrized code generator, using
> templates (not in the form of T4 templates), so it's a long way.
> Maybe Helvetia could help?

Out of my depth here; will have to read a lot more.

>
>
>>
>> On Tue, Oct 18, 2016 at 9:29 AM, Julien Delplanque 
>> wrote:
>> > Hello,
>> >
>> > A generator for the visitor design pattern:
>> > - Generate methods in visited objects: VisitedObject>>#accept: (with the
>> > selector name configurable)
>> > - Generate empty methods (or methods with a "self
>> > subclassResponsability" if
>> > an abstract visitor is generated)
>> > called in #accept: methods of VisitedObjects in the Visitor i.e
>> > Visitor>>#acceptVisitedObject: (with the selector
>> > name configurable again).
>> >
>> > Each time this design pattern has to be used, it is annoying to write by
>> > hand all these methods.
>> >
>> > Regards,
>> >
>> > Julien
>> >
>> >
>> > On 18/10/16 07:24, Hernán Morales Durand wrote:
>> >>
>> >> Hi guys,
>> >>
>> >> I am writing a code generator, doing a few iterations right now.
>> >> I want your opinion, which most useful thing would you like to be
>> >> generated
>> >> automatically? It could be a pattern, an idiom, another language...
>> >>
>> >> For example my own wish (roadmap) list:
>> >>
>> >> - A "settings framework" settings class generator.
>> >> - A state machine generator (based in the excellent paper of Trevor P.
>> >> Hopkins)
>> >> - A Spec UI generator.
>> >>
>> >> Let me know your thoughts.
>> >>
>> >> Cheers,
>> >>
>> >> Hernán
>> >>
>> >
>> >
>>
>


Wonka-StateTransition-Core-otto.1645.mcz
Description: Binary data


Wonka-StateTransition-Tests-Core-otto.4385.mcz
Description: Binary data


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Dimitris Chloupis
I would not hold my breath if I were you for 3 reasons

1) this idea will go through only if my direct bridge via shared memory
between Pharo and Unreal fails are is proven very limited, which I highly
doubt.

2) even if I proceed with it, I will certainly be specialised for Unreal
and have little interest in covering C++, huge and ugly syntax. So it will
probably be just a few steps further than CCodeGenerator than a full
implementation.

3) I am interested in producing readable C++ code, which makes this project
even harder

long term though I could proceed with this anyway if I deem it useful under
specific scenarios.

To really make this tempting for C++ coders would need a full
implementation.

But in any case as I said, its very low priority for me, just a worse case
scenario that I would try to avoid as much as I can.

On Tue, Oct 18, 2016 at 6:03 PM Hernán Morales Durand <
hernan.mora...@gmail.com> wrote:

> Hi Dimitris,
>
> That would be certainly nice. C++ is hard, but if one start with a basic
> instantiation template it could be easier to move forward to more complex
> tasks like mapping data structures to STL, their containers and iterators.
> And I think it would attract C++ developers to Smalltalk.
> Cheers,
>
> Hernán
>
>
> 2016-10-18 4:54 GMT-03:00 Dimitris Chloupis :
>
> There is the CCodeGenerator , which is basically Slang, Smalltalk that is
> turned into basic C. I would like to expand it to generate C++ at some
> point for converting pharo code to C++ code that I will be able to add to
> Unreal. Though its a very low priority project for me.
>
> http://smalltalkhub.com/#!/~PavelKrivanek/CCodeGenerator
>
> Personally I am against generalized solutions because they tend to be bad
> for specialized cases , on the other hand I welcome any code that I can use
> as inspiration for my own code generator.
>
> On Tue, Oct 18, 2016 at 8:25 AM Hernán Morales Durand <
> hernan.mora...@gmail.com> wrote:
>
> Hi guys,
>
> I am writing a code generator, doing a few iterations right now.
> I want your opinion, which most useful thing would you like to be
> generated automatically? It could be a pattern, an idiom, another
> language...
>
> For example my own wish (roadmap) list:
>
> - A "settings framework" settings class generator.
> - A state machine generator (based in the excellent paper of Trevor P.
> Hopkins)
> - A Spec UI generator.
>
> Let me know your thoughts.
>
> Cheers,
>
> Hernán
>
>
>


Re: [Pharo-users] Cog VM on Raspberry Pi ?

2016-10-18 Thread Sven Van Caekenberghe
Thanks, Esteban, that works:

pi@raspberrypi ~/Pharo $ ./pharo-arm-vm/pharo --version
5.0-201610181220  Tue Oct 18 14:42:58 UTC 2016 gcc 4.9.2 [Production Spur VM]
CoInterpreter VMMaker.oscog-rsf.1951 uuid: c714858a-7f63-47bd-a9ec-4bc1350eead2 
Oct 18 2016
StackToRegisterMappingCogit VMMaker.oscog-rsf.1951 uuid: 
c714858a-7f63-47bd-a9ec-4bc1350eead2 Oct 18 2016
VM: 201610181220 https://github.com/estebanlm/opensmalltalk-vm.git $ Date: Tue 
Oct 18 14:20:17 2016 +0200 $
Plugins: 201610181220 https://github.com/estebanlm/opensmalltalk-vm.git $
Linux testing-gce-a8263b5d-fc45-4502-a6e9-cbf3483c9374 4.4.0-42-generic 
#62~14.04.1-Ubuntu SMP Fri Oct 7 23:15:48 UTC 2016 armv7l GNU/Linux
plugin path: /home/pi/Pharo/pharo-arm-vm/ [default: 
/home/pi/Pharo/pharo-arm-vm/]

pi@raspberrypi ~/Pharo $ ./pharo-arm-vm/pharo -vm-display-null Pharo.image 
printVersion
[version] 5.0 #50581

pi@raspberrypi ~/Pharo $ ./pharo-arm-vm/pharo -vm-display-null Pharo.image eval 
'1 tinyBenchmarks'
'167210973 bytecodes/sec; 11337746 sends/sec'

Speed is similar to what I got before 160M bytecodes/s, 11M sends/s

Maybe all the VMs that I tried before were all Cog VMs ?

Is there still a stack VM (PharoS for ARM, 5.0) ?

> On 18 Oct 2016, at 22:56, Esteban Lorenzano  wrote:
> 
> Hi Sven, 
> 
> this vm: pharo-linux-i386.7237aa8.zip
> 
> should work. Name is bad but is an ARMv6 VM… did you tried it?
> 
> Esteban
> 
>> On 18 Oct 2016, at 22:50, Sven Van Caekenberghe  wrote:
>> 
>> 
>>> On 18 Oct 2016, at 22:16, Todd Blanchard  wrote:
>>> 
>>> There is a scratch on cog vm as part of the standard raspbian distro.
>>> 
>>> Have you tried that?
>> 
>> The Squeak VMs that come with raspbian seem to be of the older variant (I am 
>> using Pharo 5).
>> 
>> You known, "This interpreter (vers. 6505) cannot read image file (vers. 
>> 6521)."
>> 
>> Still, in order to be sure we are talking about the exact same VM, version 
>> info is needed.
>> 
 On Oct 18, 2016, at 09:27, Sven Van Caekenberghe  wrote:
 
 
> On 18 Oct 2016, at 14:29, Henrik Johansen  
> wrote:
> 
> 
>> On 17 Oct 2016, at 8:43 , Sven Van Caekenberghe  wrote:
>> 
>> Hi,
>> 
>> Does a (faster) Cog VM for the Raspberry Pi actually exist ?
>> 
>> I tried comparing the latest OpenSmalltalk VM with some older ones, only 
>> to find that they are all equally fast (slow actually):
>> 
>> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image printVersion
>> [version] 5.0 #50581
>> 
>> "http://files.pharo.org/vm/pharoS/raspbian/latest.zip;
>> 
>> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image eval '1 
>> tinyBenchmarks'
>> '167429692 bytecodes/sec; 11160247 sends/sec'
>> 
>> "http://www.mirandabanda.org/files/Cog/VM/VM.r3427/cogspurlinuxhtARM-15.33.3427.tgz;
>> 
>> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
>> Pharo.image eval '1 tinyBenchmarks'
>> '166992824 bytecodes/sec; 11337746 sends/sec'
>> 
>> "https://bintray.com/opensmalltalk/vm/download_file?file_path=cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz;
>> 
>> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
>> Pharo.image eval '1 tinyBenchmarks'
>> '166992824 bytecodes/sec; 11337746 sends/sec'
>> 
>> That is no significant difference on a RPi 3, at all. Is this normal ? 
>> Am I missing something ?
>> 
>> Thx,
>> 
>> Sven
>> 
>> PS: Just for reference, my Mac Book Pro is 10 times faster
>> 
>> 1 tinyBenchmarks  "'1323852617 bytecodes/sec; 174185794 sends/sec'"
> 
> Are you 100% sure you benched different VM's?
> A stack VM (PharoS) getting the same results as a Spur VM 
> (cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz) is rather 
> suspicious...
> 
> At least on my Pi3, the spur Cog VM gives  numbers around 250M 
> bytecodes/160M sends
> which, while still "slow", is a decent bump in speed compared to what 
> you're seeing.
> 
> Cheers,
> Henry
 
 Hi Henry,
 
 That is exactly the kind of reference/experience I am looking for.
 Could you please point me to the exact download URL you downloaded ?
 I will happily test it ;-)
 
 Thx,
 
 Sven
 
 
 
>>> 
>>> 
>> 
>> 
> 




Re: [Pharo-users] Cog VM on Raspberry Pi ?

2016-10-18 Thread Esteban Lorenzano
Hi Sven, 

this vm: pharo-linux-i386.7237aa8.zip 


should work. Name is bad but is an ARMv6 VM… did you tried it?

Esteban

> On 18 Oct 2016, at 22:50, Sven Van Caekenberghe  wrote:
> 
> 
>> On 18 Oct 2016, at 22:16, Todd Blanchard  wrote:
>> 
>> There is a scratch on cog vm as part of the standard raspbian distro.
>> 
>> Have you tried that?
> 
> The Squeak VMs that come with raspbian seem to be of the older variant (I am 
> using Pharo 5).
> 
> You known, "This interpreter (vers. 6505) cannot read image file (vers. 
> 6521)."
> 
> Still, in order to be sure we are talking about the exact same VM, version 
> info is needed.
> 
>>> On Oct 18, 2016, at 09:27, Sven Van Caekenberghe  wrote:
>>> 
>>> 
 On 18 Oct 2016, at 14:29, Henrik Johansen  
 wrote:
 
 
> On 17 Oct 2016, at 8:43 , Sven Van Caekenberghe  wrote:
> 
> Hi,
> 
> Does a (faster) Cog VM for the Raspberry Pi actually exist ?
> 
> I tried comparing the latest OpenSmalltalk VM with some older ones, only 
> to find that they are all equally fast (slow actually):
> 
> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image printVersion
> [version] 5.0 #50581
> 
> "http://files.pharo.org/vm/pharoS/raspbian/latest.zip;
> 
> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image eval '1 
> tinyBenchmarks'
> '167429692 bytecodes/sec; 11160247 sends/sec'
> 
> "http://www.mirandabanda.org/files/Cog/VM/VM.r3427/cogspurlinuxhtARM-15.33.3427.tgz;
> 
> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
> Pharo.image eval '1 tinyBenchmarks'
> '166992824 bytecodes/sec; 11337746 sends/sec'
> 
> "https://bintray.com/opensmalltalk/vm/download_file?file_path=cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz;
> 
> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
> Pharo.image eval '1 tinyBenchmarks'
> '166992824 bytecodes/sec; 11337746 sends/sec'
> 
> That is no significant difference on a RPi 3, at all. Is this normal ? Am 
> I missing something ?
> 
> Thx,
> 
> Sven
> 
> PS: Just for reference, my Mac Book Pro is 10 times faster
> 
> 1 tinyBenchmarks  "'1323852617 bytecodes/sec; 174185794 sends/sec'"
 
 Are you 100% sure you benched different VM's?
 A stack VM (PharoS) getting the same results as a Spur VM 
 (cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz) is rather 
 suspicious...
 
 At least on my Pi3, the spur Cog VM gives  numbers around 250M 
 bytecodes/160M sends
 which, while still "slow", is a decent bump in speed compared to what 
 you're seeing.
 
 Cheers,
 Henry
>>> 
>>> Hi Henry,
>>> 
>>> That is exactly the kind of reference/experience I am looking for.
>>> Could you please point me to the exact download URL you downloaded ?
>>> I will happily test it ;-)
>>> 
>>> Thx,
>>> 
>>> Sven
>>> 
>>> 
>>> 
>> 
>> 
> 
> 



Re: [Pharo-users] Cog VM on Raspberry Pi ?

2016-10-18 Thread Sven Van Caekenberghe

> On 18 Oct 2016, at 22:16, Todd Blanchard  wrote:
> 
> There is a scratch on cog vm as part of the standard raspbian distro.
> 
> Have you tried that?

The Squeak VMs that come with raspbian seem to be of the older variant (I am 
using Pharo 5).

You known, "This interpreter (vers. 6505) cannot read image file (vers. 6521)."

Still, in order to be sure we are talking about the exact same VM, version info 
is needed.

>> On Oct 18, 2016, at 09:27, Sven Van Caekenberghe  wrote:
>> 
>> 
>>> On 18 Oct 2016, at 14:29, Henrik Johansen  
>>> wrote:
>>> 
>>> 
 On 17 Oct 2016, at 8:43 , Sven Van Caekenberghe  wrote:
 
 Hi,
 
 Does a (faster) Cog VM for the Raspberry Pi actually exist ?
 
 I tried comparing the latest OpenSmalltalk VM with some older ones, only 
 to find that they are all equally fast (slow actually):
 
 pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image printVersion
 [version] 5.0 #50581
 
 "http://files.pharo.org/vm/pharoS/raspbian/latest.zip;
 
 pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image eval '1 
 tinyBenchmarks'
 '167429692 bytecodes/sec; 11160247 sends/sec'
 
 "http://www.mirandabanda.org/files/Cog/VM/VM.r3427/cogspurlinuxhtARM-15.33.3427.tgz;
 
 pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
 Pharo.image eval '1 tinyBenchmarks'
 '166992824 bytecodes/sec; 11337746 sends/sec'
 
 "https://bintray.com/opensmalltalk/vm/download_file?file_path=cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz;
 
 pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
 Pharo.image eval '1 tinyBenchmarks'
 '166992824 bytecodes/sec; 11337746 sends/sec'
 
 That is no significant difference on a RPi 3, at all. Is this normal ? Am 
 I missing something ?
 
 Thx,
 
 Sven
 
 PS: Just for reference, my Mac Book Pro is 10 times faster
 
 1 tinyBenchmarks  "'1323852617 bytecodes/sec; 174185794 sends/sec'"
>>> 
>>> Are you 100% sure you benched different VM's?
>>> A stack VM (PharoS) getting the same results as a Spur VM 
>>> (cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz) is rather 
>>> suspicious...
>>> 
>>> At least on my Pi3, the spur Cog VM gives  numbers around 250M 
>>> bytecodes/160M sends
>>> which, while still "slow", is a decent bump in speed compared to what 
>>> you're seeing.
>>> 
>>> Cheers,
>>> Henry
>> 
>> Hi Henry,
>> 
>> That is exactly the kind of reference/experience I am looking for.
>> Could you please point me to the exact download URL you downloaded ?
>> I will happily test it ;-)
>> 
>> Thx,
>> 
>> Sven
>> 
>> 
>> 
> 
> 




Re: [Pharo-users] Cog VM on Raspberry Pi ?

2016-10-18 Thread Todd Blanchard
There is a scratch on cog vm as part of the standard raspbian distro.

Have you tried that?

> On Oct 18, 2016, at 09:27, Sven Van Caekenberghe  wrote:
> 
> 
>> On 18 Oct 2016, at 14:29, Henrik Johansen  
>> wrote:
>> 
>> 
>>> On 17 Oct 2016, at 8:43 , Sven Van Caekenberghe  wrote:
>>> 
>>> Hi,
>>> 
>>> Does a (faster) Cog VM for the Raspberry Pi actually exist ?
>>> 
>>> I tried comparing the latest OpenSmalltalk VM with some older ones, only to 
>>> find that they are all equally fast (slow actually):
>>> 
>>> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image printVersion
>>> [version] 5.0 #50581
>>> 
>>> "http://files.pharo.org/vm/pharoS/raspbian/latest.zip;
>>> 
>>> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image eval '1 
>>> tinyBenchmarks'
>>> '167429692 bytecodes/sec; 11160247 sends/sec'
>>> 
>>> "http://www.mirandabanda.org/files/Cog/VM/VM.r3427/cogspurlinuxhtARM-15.33.3427.tgz;
>>> 
>>> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
>>> Pharo.image eval '1 tinyBenchmarks'
>>> '166992824 bytecodes/sec; 11337746 sends/sec'
>>> 
>>> "https://bintray.com/opensmalltalk/vm/download_file?file_path=cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz;
>>> 
>>> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
>>> Pharo.image eval '1 tinyBenchmarks'
>>> '166992824 bytecodes/sec; 11337746 sends/sec'
>>> 
>>> That is no significant difference on a RPi 3, at all. Is this normal ? Am I 
>>> missing something ?
>>> 
>>> Thx,
>>> 
>>> Sven
>>> 
>>> PS: Just for reference, my Mac Book Pro is 10 times faster
>>> 
>>> 1 tinyBenchmarks  "'1323852617 bytecodes/sec; 174185794 sends/sec'"
>> 
>> Are you 100% sure you benched different VM's?
>> A stack VM (PharoS) getting the same results as a Spur VM 
>> (cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz) is rather suspicious...
>> 
>> At least on my Pi3, the spur Cog VM gives  numbers around 250M 
>> bytecodes/160M sends
>> which, while still "slow", is a decent bump in speed compared to what you're 
>> seeing.
>> 
>> Cheers,
>> Henry
> 
> Hi Henry,
> 
> That is exactly the kind of reference/experience I am looking for.
> Could you please point me to the exact download URL you downloaded ?
> I will happily test it ;-)
> 
> Thx,
> 
> Sven
> 
> 
> 




Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Todd Blanchard
Yes, this is another one and I would like to see a nice interface to clang that 
then generated all the glue code for a given library based on its public header 
files.

Smalltalk Agents used to do something like this.  You could point it at a 
library and it would open it and generate Smalltalk bindings to everything the 
library exported.

Ben has been blogging about experiments with just this, I'm kind of following 
along in his footsteps.  Being able to import pretty much any library with a 
few clicks and use it from Pharo would go a long way towards making it 
attractive for real development.  It seems rather silly we are doing all this 
painstaking work to keep database drivers and such up to date when we might be 
able to automate the bulk of it.

> On Oct 18, 2016, at 10:38, p...@highoctane.be wrote:
> 
> 
> They are useful for writing VM plugins for example. The generic part.




Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Thierry Goubier

Le 18/10/2016 à 15:45, Otto Behrens a écrit :

for things like that, I would consider looking into the SmaCC visitor
automatic generation. From an grammar, SmaCC creates the class, respecting
an eventual inheritance constraint you specify, adds the instance variables,
and generates the visitor (and an equality test too).


Nice. Will have a look. Thanks.


The thing is basically SmaCC is a automaton compiler, with two different 
generation strategies based on the type of automaton you are interested in.


Plus a tree / visitor generation code.


Regarding state machines generation, what class of automatons are you
looking at? Because I'm looking at automatons generation by reusing SmaCC
(for a tentative hardware architecture subject).


We have some domain specific objects, for example investment
instructions, that go through some domain specific state transitions.
It is not enormous, but a state transition model helps to understand
what valid transitions there are. As a simplistic example, when we
receive an investment instruction, one user "submits" the instruction,
another "authorises". From there it moves into a processing state and
then complete when the investment is placed.

What will be nice is to set up guards on transitions, entry / exit
actions and more nice things that can be done with a state machine.
Reading the state machine then gives a nice overview of the logic.
What will be nice is to see that in the form of a graph, with all the
annotations.



We do not currently use complexities like concurrency and nesting, but
have seen that working before.

Does this answer what you're asking?


Yes, I think I understand, including the need for a graphical 
representation.


I'm interested in finding opportunities for automata as a way to compute 
(and synthesize hardware). I've seen very interesting results with 
synthesis of automata co-processors on FPGAs (and the Micron Automata 
processor as well). I suggested an internship in my lab, and it was 
bumped up to a possible post-doc opportunity.


But I'm more into expressing them as a RE / as a Grammar than 
explicitely... studying a way to convert between the different 
representations could be interesting.


Thierry



Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread p...@highoctane.be
http://www.micro-workflow.com/PDF/wecfo.pdf seemed interesting.

Not state machines per se but still.

Longer paper here: http://micro-workflow.com/PDF/phdthesis.pdf

Phil

On Tue, Oct 18, 2016 at 8:47 PM, Bernardo Ezequiel Contreras <
vonbecm...@gmail.com> wrote:

> Implementing State Machines in Smalltalk (1993) Trevor Hopkins
> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.6732
>
> - A state machine generator (based in the excellent paper of Trevor P.
>> Hopkins)
>>
>>
> i add it to my reading list. thanks
>
>
> --
> Bernardo E.C.
>
> Sent from a cheap desktop computer in South America.
>


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Bernardo Ezequiel Contreras
Implementing State Machines in Smalltalk (1993) Trevor Hopkins
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.6732

- A state machine generator (based in the excellent paper of Trevor P.
> Hopkins)
>
>
i add it to my reading list. thanks


-- 
Bernardo E.C.

Sent from a cheap desktop computer in South America.


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Lionel Akue
Sure I will look and let you know.

Lionel

Le 18 oct. 2016 18:07, "Hernán Morales Durand"  a
écrit :

>
> 2016-10-18 9:35 GMT-03:00 Lionel Akue :
>
>> Great!
>>
>> We had the same idea :)
>>
>>
> Let me know if we can join forces to speed uo things.
>
>
>> The first requirements I wrote was  to generate Spec UI directly. But I
>> rather chose to make Magritte compatible with Spec.
>>
>> So from the Magritte description, we could generate Spec, Seaside ...
>>
>>
> The CodeGenerator I wrote already generates Magritte code. If you load it
> in Pharo 5
>
> Gofer it
> smalltalkhubUser: 'hernan' project: 'CodeGenerator';
> configuration;
> loadDevelopment.
>
> Have a look at the usage examples:
>
> #exampleMagritteDescriptionCreation1
> #exampleMagritteDescriptionCreation2
> #exampleMagritteDescriptionCreation3
>
> If you have suggestions I would like to read.
>
> Hernán
>
>
>> Lionel
>>
>> 2016-10-18 14:20 GMT+02:00 Peter Uhnak :
>>
>>> Hi Hernan,
>>>
>>> I wrote some time ago two basic code generators (both in Pharo) from
>>> UML-ified FAMIX for a particular user (so there are some domain-specific
>>> patterns),
>>> one for Pharo syntax ( https://github.com/OpenPonk/cl
>>> ass-editor/blob/master/docs/code-generation/uml-to-code.md )
>>> and one for VW syntax ( https://github.com/OpenPonk/cl
>>> ass-editor/blob/master/docs/vw-code-generation/pim-psm.md )
>>>
>>> (the code is here https://github.com/OpenPonk/cl
>>> ass-editor/tree/master/repository/DynaCASE-Generator.package and here
>>> https://github.com/OpenPonk/class-editor/tree/master/reposit
>>> ory/UML-CodeGenerator.package )
>>>
>>> The most pain I had was with expressing templateable code to which I
>>> could just plug specific data, I wanted to look at QVT but didn't have the
>>> time yet.
>>> But it would be interesting to see if your generator could address such
>>> issues; plus soon I want to iterate on my generators to have more live
>>> interaction (so the code is generated on the fly as the model is created,
>>> although I am using Pharo Refactoring engine for now, which is also quite
>>> powerful.)
>>>
>>> Addionally, Lionel (in cc) is working on some meta system generating
>>> classes with magritte descriptions.
>>>
>>> So it would be cool if we could have some really cool generator that
>>> could do many cool things. :)
>>>
>>> Peter
>>>
>>> On Tue, Oct 18, 2016 at 02:24:28AM -0300, Hernán Morales Durand wrote:
>>> > Hi guys,
>>> >
>>> > I am writing a code generator, doing a few iterations right now.
>>> > I want your opinion, which most useful thing would you like to be
>>> generated
>>> > automatically? It could be a pattern, an idiom, another language...
>>> >
>>> > For example my own wish (roadmap) list:
>>> >
>>> > - A "settings framework" settings class generator.
>>> > - A state machine generator (based in the excellent paper of Trevor P.
>>> > Hopkins)
>>> > - A Spec UI generator.
>>> >
>>> > Let me know your thoughts.
>>> >
>>> > Cheers,
>>> >
>>> > Hernán
>>>
>>
>>
>


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread p...@highoctane.be
They are useful for writing VM plugins for example. The generic part.

On Tue, Oct 18, 2016 at 6:53 PM, Todd Blanchard  wrote:

> My personal feeling on code generators is they are a bad code smell and
> the desire to use them tends to imply that your programming language isn't
> dynamic enough.
>
> That said I have used DNE on proto object proxies to capture messages sent
> and generate handlers (I have used this on Morphic to try to figure out
> what methods actually get called vs the ones that don't).
>
> I have also used this sort of thing to build a model that matches a
> database schema.
>
> But I wouldn't typically make code generation a routine part of my
> development process.
>
> > On Oct 17, 2016, at 22:24, Hernán Morales Durand <
> hernan.mora...@gmail.com> wrote:
> >
> > Hi guys,
> >
> > I am writing a code generator, doing a few iterations right now.
> > I want your opinion, which most useful thing would you like to be
> generated automatically? It could be a pattern, an idiom, another
> language...
> >
> > For example my own wish (roadmap) list:
> >
> > - A "settings framework" settings class generator.
> > - A state machine generator (based in the excellent paper of Trevor P.
> Hopkins)
> > - A Spec UI generator.
> >
> > Let me know your thoughts.
> >
> > Cheers,
> >
> > Hernán
> >
>
>
>
>


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Evan Donahue
So this isn't a specific out-of-the-box solution to any of the
code-generation use cases people have been discussing, but I thought it was
relevant enough to toss it out there.

I'm currently doing some work on program synthesis using a Pharo port of the
miniKanren logic programming language (http://minikanren.org/). The Pharo
version is here: http://smalltalkhub.com/#!/~EvanDonahue/SmallKanren . 

So far, I've only used it to implement this paper on generating scheme
programs (http://smalltalkhub.com/#!/~EvanDonahue/SmallKanren), the
implementation of which is here:
http://smalltalkhub.com/#!/~EvanDonahue/Barliman . 

I've thought a bit about things like generating GUI's, and it seems like
something interesting could be done there, since you could imagine feeding
it constraints and then giving the results a thumbs up/thumbs down to see
other satisfying layouts more or less like the ones you voted on, but the
probabilistic learning component is an object of current research and isn't
ready yet. 

I was planning on sending out an announcement once it was more complete and
robust, as right now it has lots of tests but not much documentation, and
the architecture is changing rapidly, per research requirements, but if
anyone is interested in knowing more about it feel free to get in touch.
This is part of a broader research program on intelligent interfaces, so
hopefully some cooler things come out of it later down the line.

Cheers,
Evan



--
View this message in context: 
http://forum.world.st/CodeGenerator-your-opinions-tp4919152p4919250.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Todd Blanchard
My personal feeling on code generators is they are a bad code smell and the 
desire to use them tends to imply that your programming language isn't dynamic 
enough.

That said I have used DNE on proto object proxies to capture messages sent and 
generate handlers (I have used this on Morphic to try to figure out what 
methods actually get called vs the ones that don't).

I have also used this sort of thing to build a model that matches a database 
schema.

But I wouldn't typically make code generation a routine part of my development 
process.

> On Oct 17, 2016, at 22:24, Hernán Morales Durand  
> wrote:
> 
> Hi guys,
> 
> I am writing a code generator, doing a few iterations right now.
> I want your opinion, which most useful thing would you like to be generated 
> automatically? It could be a pattern, an idiom, another language... 
> 
> For example my own wish (roadmap) list:
> 
> - A "settings framework" settings class generator.
> - A state machine generator (based in the excellent paper of Trevor P. 
> Hopkins)
> - A Spec UI generator.
> 
> Let me know your thoughts.
> 
> Cheers,
> 
> Hernán
> 




Re: [Pharo-users] Cog VM on Raspberry Pi ?

2016-10-18 Thread Sven Van Caekenberghe

> On 18 Oct 2016, at 14:29, Henrik Johansen  
> wrote:
> 
> 
>> On 17 Oct 2016, at 8:43 , Sven Van Caekenberghe  wrote:
>> 
>> Hi,
>> 
>> Does a (faster) Cog VM for the Raspberry Pi actually exist ?
>> 
>> I tried comparing the latest OpenSmalltalk VM with some older ones, only to 
>> find that they are all equally fast (slow actually):
>> 
>> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image printVersion
>> [version] 5.0 #50581
>> 
>> "http://files.pharo.org/vm/pharoS/raspbian/latest.zip;
>> 
>> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image eval '1 
>> tinyBenchmarks'
>> '167429692 bytecodes/sec; 11160247 sends/sec'
>> 
>> "http://www.mirandabanda.org/files/Cog/VM/VM.r3427/cogspurlinuxhtARM-15.33.3427.tgz;
>> 
>> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
>> Pharo.image eval '1 tinyBenchmarks'
>> '166992824 bytecodes/sec; 11337746 sends/sec'
>> 
>> "https://bintray.com/opensmalltalk/vm/download_file?file_path=cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz;
>> 
>> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
>> Pharo.image eval '1 tinyBenchmarks'
>> '166992824 bytecodes/sec; 11337746 sends/sec'
>> 
>> That is no significant difference on a RPi 3, at all. Is this normal ? Am I 
>> missing something ?
>> 
>> Thx,
>> 
>> Sven
>> 
>> PS: Just for reference, my Mac Book Pro is 10 times faster
>> 
>> 1 tinyBenchmarks  "'1323852617 bytecodes/sec; 174185794 sends/sec'"
> 
> Are you 100% sure you benched different VM's?
> A stack VM (PharoS) getting the same results as a Spur VM 
> (cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz) is rather suspicious...
> 
> At least on my Pi3, the spur Cog VM gives  numbers around 250M bytecodes/160M 
> sends
> which, while still "slow", is a decent bump in speed compared to what you're 
> seeing.
> 
> Cheers,
> Henry

Hi Henry,

That is exactly the kind of reference/experience I am looking for.
Could you please point me to the exact download URL you downloaded ?
I will happily test it ;-)

Thx,

Sven





Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Hernán Morales Durand
2016-10-18 9:35 GMT-03:00 Lionel Akue :

> Great!
>
> We had the same idea :)
>
>
Let me know if we can join forces to speed uo things.


> The first requirements I wrote was  to generate Spec UI directly. But I
> rather chose to make Magritte compatible with Spec.
>
> So from the Magritte description, we could generate Spec, Seaside ...
>
>
The CodeGenerator I wrote already generates Magritte code. If you load it
in Pharo 5

Gofer it
smalltalkhubUser: 'hernan' project: 'CodeGenerator';
configuration;
loadDevelopment.

Have a look at the usage examples:

#exampleMagritteDescriptionCreation1
#exampleMagritteDescriptionCreation2
#exampleMagritteDescriptionCreation3

If you have suggestions I would like to read.

Hernán


> Lionel
>
> 2016-10-18 14:20 GMT+02:00 Peter Uhnak :
>
>> Hi Hernan,
>>
>> I wrote some time ago two basic code generators (both in Pharo) from
>> UML-ified FAMIX for a particular user (so there are some domain-specific
>> patterns),
>> one for Pharo syntax ( https://github.com/OpenPonk/cl
>> ass-editor/blob/master/docs/code-generation/uml-to-code.md )
>> and one for VW syntax ( https://github.com/OpenPonk/cl
>> ass-editor/blob/master/docs/vw-code-generation/pim-psm.md )
>>
>> (the code is here https://github.com/OpenPonk/cl
>> ass-editor/tree/master/repository/DynaCASE-Generator.package and here
>> https://github.com/OpenPonk/class-editor/tree/master/reposit
>> ory/UML-CodeGenerator.package )
>>
>> The most pain I had was with expressing templateable code to which I
>> could just plug specific data, I wanted to look at QVT but didn't have the
>> time yet.
>> But it would be interesting to see if your generator could address such
>> issues; plus soon I want to iterate on my generators to have more live
>> interaction (so the code is generated on the fly as the model is created,
>> although I am using Pharo Refactoring engine for now, which is also quite
>> powerful.)
>>
>> Addionally, Lionel (in cc) is working on some meta system generating
>> classes with magritte descriptions.
>>
>> So it would be cool if we could have some really cool generator that
>> could do many cool things. :)
>>
>> Peter
>>
>> On Tue, Oct 18, 2016 at 02:24:28AM -0300, Hernán Morales Durand wrote:
>> > Hi guys,
>> >
>> > I am writing a code generator, doing a few iterations right now.
>> > I want your opinion, which most useful thing would you like to be
>> generated
>> > automatically? It could be a pattern, an idiom, another language...
>> >
>> > For example my own wish (roadmap) list:
>> >
>> > - A "settings framework" settings class generator.
>> > - A state machine generator (based in the excellent paper of Trevor P.
>> > Hopkins)
>> > - A Spec UI generator.
>> >
>> > Let me know your thoughts.
>> >
>> > Cheers,
>> >
>> > Hernán
>>
>
>


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Hernán Morales Durand
Hi Otto,

2016-10-18 5:01 GMT-03:00 Otto Behrens :

> +1 for the visitor. What would be nice is to generate methods in the
> form #visit: for all classes in a given hierarchy (eg
> Magritte's MAVisitor). The default implementation of such a method
> would be to call #visit:
>
> We have been using state machines for a long time and have built
> generators for it (on a previous project, for which I do not have the
> code). I still think that is a useful idea. It is difficult for the
> code generator to maintain changes in the generated code with changes
> in the "spec". Will you then define a DSL for the state machine?
>
>
Do you mean internal or embedded DSL? I am open to write an DSL if
facilitates the job, the thing with the Trevor's paper is that he defines 6
implementations of FSM's (and in each implementation he considers several
issues leading to sub-implementations) so I would like a DSL which let me
express different implementations for the same FSM. Plus there are FSM
implementations out there: HotDraw, Connectors, MIDIInputParser, XMIReader,
SState, etc. I think a "correct" DSL would enable to define any of them
right?

The approach I am using now is a parametrized code generator, using
templates (not in the form of T4 templates), so it's a long way.
Maybe Helvetia could help?



> On Tue, Oct 18, 2016 at 9:29 AM, Julien Delplanque 
> wrote:
> > Hello,
> >
> > A generator for the visitor design pattern:
> > - Generate methods in visited objects: VisitedObject>>#accept: (with the
> > selector name configurable)
> > - Generate empty methods (or methods with a "self
> subclassResponsability" if
> > an abstract visitor is generated)
> > called in #accept: methods of VisitedObjects in the Visitor i.e
> > Visitor>>#acceptVisitedObject: (with the selector
> > name configurable again).
> >
> > Each time this design pattern has to be used, it is annoying to write by
> > hand all these methods.
> >
> > Regards,
> >
> > Julien
> >
> >
> > On 18/10/16 07:24, Hernán Morales Durand wrote:
> >>
> >> Hi guys,
> >>
> >> I am writing a code generator, doing a few iterations right now.
> >> I want your opinion, which most useful thing would you like to be
> >> generated
> >> automatically? It could be a pattern, an idiom, another language...
> >>
> >> For example my own wish (roadmap) list:
> >>
> >> - A "settings framework" settings class generator.
> >> - A state machine generator (based in the excellent paper of Trevor P.
> >> Hopkins)
> >> - A Spec UI generator.
> >>
> >> Let me know your thoughts.
> >>
> >> Cheers,
> >>
> >> Hernán
> >>
> >
> >
>
>


Re: [Pharo-users] Nao robot with Pharo and LRP

2016-10-18 Thread Alexandre Bergel
This is great!!!
Keep going!

Alexandre



> On Oct 18, 2016, at 6:09 AM, Miguel Campusano  wrote:
> 
> Hello,
> I've been working on an API for the Nao Robot [1] in Pharo. You can find an 
> early demo of how it works in Pharo:
> https://www.youtube.com/watch?v=z8jopUfLWtQ 
> 
> 
> Moreover, I built a communication bridge between the Nao and LRP [2]. LRP is 
> a live programming language for robotic behaviors. You can see a working demo 
> of the nao moving via LRP here:
> https://www.youtube.com/watch?v=q1jGDtaW41U 
> 
> 
> I want to emphasize how easy and fun can be to program a robot with a live 
> environment. Looking at the robot and see how immediately changes its 
> behavior whenever you send a command, that is cool!
> 
> You can find the API here (I have to write the documentation on how to use 
> it):
> http://www.smalltalkhub.com/#!/~mcamp/NaoSocket 
> 
> 
> This is a work in progress. The Nao has several features that I'm planning to 
> incorporate in the API when they are needed. 
> 
> To make this work I use TCP sockets to communicate with the robot. For the 
> Nao, there is a documentation on how the robot communicates via binary 
> packages, but the documentation lacks a lot of information that I managed to 
> figure it out by reading the binary information (thanks gtInspector for that) 
> and understanding how the robot works.
> 
> [1] https://www.ald.softbankrobotics.com/en/cool-robots/nao 
> 
> [2] pleiad.cl/lrp 


Re: [Pharo-users] Nao robot with Pharo and LRP

2016-10-18 Thread Johan Fabry

Excellent work ! :-)

--
Does this mail seem too brief? Sorry for that, I don’t mean to be rude! Please 
see http://emailcharter.org  .

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile

> On 18 Oct 2016, at 06:09, Miguel Campusano  wrote:
> 
> Hello,
> I've been working on an API for the Nao Robot [1] in Pharo. You can find an 
> early demo of how it works in Pharo:
> https://www.youtube.com/watch?v=z8jopUfLWtQ 
> 
> 
> Moreover, I built a communication bridge between the Nao and LRP [2]. LRP is 
> a live programming language for robotic behaviors. You can see a working demo 
> of the nao moving via LRP here:
> https://www.youtube.com/watch?v=q1jGDtaW41U 
> 
> 
> I want to emphasize how easy and fun can be to program a robot with a live 
> environment. Looking at the robot and see how immediately changes its 
> behavior whenever you send a command, that is cool!
> 
> You can find the API here (I have to write the documentation on how to use 
> it):
> http://www.smalltalkhub.com/#!/~mcamp/NaoSocket 
> 
> 
> This is a work in progress. The Nao has several features that I'm planning to 
> incorporate in the API when they are needed. 
> 
> To make this work I use TCP sockets to communicate with the robot. For the 
> Nao, there is a documentation on how the robot communicates via binary 
> packages, but the documentation lacks a lot of information that I managed to 
> figure it out by reading the binary information (thanks gtInspector for that) 
> and understanding how the robot works.
> 
> [1] https://www.ald.softbankrobotics.com/en/cool-robots/nao 
> 
> [2] pleiad.cl/lrp 


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Hernán Morales Durand
Hi Dimitris,

That would be certainly nice. C++ is hard, but if one start with a basic
instantiation template it could be easier to move forward to more complex
tasks like mapping data structures to STL, their containers and iterators.
And I think it would attract C++ developers to Smalltalk.
Cheers,

Hernán


2016-10-18 4:54 GMT-03:00 Dimitris Chloupis :

> There is the CCodeGenerator , which is basically Slang, Smalltalk that is
> turned into basic C. I would like to expand it to generate C++ at some
> point for converting pharo code to C++ code that I will be able to add to
> Unreal. Though its a very low priority project for me.
>
> http://smalltalkhub.com/#!/~PavelKrivanek/CCodeGenerator
>
> Personally I am against generalized solutions because they tend to be bad
> for specialized cases , on the other hand I welcome any code that I can use
> as inspiration for my own code generator.
>
> On Tue, Oct 18, 2016 at 8:25 AM Hernán Morales Durand <
> hernan.mora...@gmail.com> wrote:
>
>> Hi guys,
>>
>> I am writing a code generator, doing a few iterations right now.
>> I want your opinion, which most useful thing would you like to be
>> generated automatically? It could be a pattern, an idiom, another
>> language...
>>
>> For example my own wish (roadmap) list:
>>
>> - A "settings framework" settings class generator.
>> - A state machine generator (based in the excellent paper of Trevor P.
>> Hopkins)
>> - A Spec UI generator.
>>
>> Let me know your thoughts.
>>
>> Cheers,
>>
>> Hernán
>>
>>


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Otto Behrens
> for things like that, I would consider looking into the SmaCC visitor
> automatic generation. From an grammar, SmaCC creates the class, respecting
> an eventual inheritance constraint you specify, adds the instance variables,
> and generates the visitor (and an equality test too).

Nice. Will have a look. Thanks.

> Regarding state machines generation, what class of automatons are you
> looking at? Because I'm looking at automatons generation by reusing SmaCC
> (for a tentative hardware architecture subject).

We have some domain specific objects, for example investment
instructions, that go through some domain specific state transitions.
It is not enormous, but a state transition model helps to understand
what valid transitions there are. As a simplistic example, when we
receive an investment instruction, one user "submits" the instruction,
another "authorises". From there it moves into a processing state and
then complete when the investment is placed.

What will be nice is to set up guards on transitions, entry / exit
actions and more nice things that can be done with a state machine.
Reading the state machine then gives a nice overview of the logic.
What will be nice is to see that in the form of a graph, with all the
annotations.

We do not currently use complexities like concurrency and nesting, but
have seen that working before.

Does this answer what you're asking?

>
> Regards,
>
> Thierry
>
>
> Le 18/10/2016 à 10:01, Otto Behrens a écrit :
>>
>> +1 for the visitor. What would be nice is to generate methods in the
>> form #visit: for all classes in a given hierarchy (eg
>> Magritte's MAVisitor). The default implementation of such a method
>> would be to call #visit:
>>
>> We have been using state machines for a long time and have built
>> generators for it (on a previous project, for which I do not have the
>> code). I still think that is a useful idea. It is difficult for the
>> code generator to maintain changes in the generated code with changes
>> in the "spec". Will you then define a DSL for the state machine?
>>
>> On Tue, Oct 18, 2016 at 9:29 AM, Julien Delplanque 
>> wrote:
>>>
>>> Hello,
>>>
>>> A generator for the visitor design pattern:
>>> - Generate methods in visited objects: VisitedObject>>#accept: (with the
>>> selector name configurable)
>>> - Generate empty methods (or methods with a "self subclassResponsability"
>>> if
>>> an abstract visitor is generated)
>>> called in #accept: methods of VisitedObjects in the Visitor i.e
>>> Visitor>>#acceptVisitedObject: (with the selector
>>> name configurable again).
>>>
>>> Each time this design pattern has to be used, it is annoying to write by
>>> hand all these methods.
>>>
>>> Regards,
>>>
>>> Julien
>>>
>>>
>>> On 18/10/16 07:24, Hernán Morales Durand wrote:


 Hi guys,

 I am writing a code generator, doing a few iterations right now.
 I want your opinion, which most useful thing would you like to be
 generated
 automatically? It could be a pattern, an idiom, another language...

 For example my own wish (roadmap) list:

 - A "settings framework" settings class generator.
 - A state machine generator (based in the excellent paper of Trevor P.
 Hopkins)
 - A Spec UI generator.

 Let me know your thoughts.

 Cheers,

 Hernán

>>>
>>>
>>
>>
>
>



Re: [Pharo-users] [Seaside] [ANN] Zürich Smalltalk Meetup Nov 8th, 2016

2016-10-18 Thread Mariano Martinez Peck
On Tue, Oct 18, 2016 at 1:35 AM, jtuc...@objektfabrik.de <
jtuc...@objektfabrik.de> wrote:

> There are great news about the upcoming Smalltalker’s Meetup in Zürich.
>
> We’ve found a conference room for the evening and will start off with a
> “show us your project” session in a room with a big screen and start the
> social part after your input at a nice Australian Steakhouse.
>
> The best thing is: we already have a first session: Michal is going to
> show his new Gemstone-based persistence framework for Pharo. It can be used
> to develop in Pharo and keep your objects stored in Gemstone.
>

Hi,

I would love to be in Zurich, but I obviously can't :(
So... is there a way to get some more info about that "Gemstone-based
persistence framework for Pharo"? And who is Michal? Last name?

Thanks,


> We need your input
>
> This new setup with a meeting room adds more value to all of us: we can
> now not only talk about each others’ epxeriences and porjects, but see what
> they’re up to and what they found.
>
> So to make this event an even better one than before, we need people who’d
> like to share their ideas, their latest work on some hobby or professional
> project. There’s no need for a full-fledged sales pitch with fog and visual
> effects and such, just bring your laptop and show us what you do! The room
> is reserved for ca. 1 hour, so we can have, say, 2-3 presentations before
> we leave for beer and steaks.
>
> So if you have something interesting to show or would like to find people
> to join on some early project you’re starting/planning, give us a chance to
> learn about it. If you’ve built some interesting tool or use Smalltalk for
> something very special to you, let us know and share your fascination and
> ideas. We’ll sure appreciate that!
>
> But if you spontaneously decide you want to show something or start some
> discussion, feel free to do so. You just need to be prepared that we might
> have to leave the room before it’s your turn. Timeslots are limited.
>
> It would be good if you’d pre-announce your demo to me for two reasons:
> first, we can see if we need to rent tho room for a little longer, but even
> better, your topic might attract even more people so I can post your topic
> and make sure people get the message.
> So where and when?
>
> We’ll meet at 7pm on Nov 8th, 2016 at
>
> Alpha Sprachwelt AG 
> Stadelhoferstrasse 10
> 8001 Zürich
>
> Around 8-8:30 pm we’ll walk over to the Outback Lodge where we’ve reserved
> a table. With Steaks and Drinks we can discuss ideas, talk about the good
> old times or do some spontaneous hacking. For directions to the Lodge visit
> http://www.outback-lodge.ch/index.php/stadelhofen
> How to register? How much is it?
>
> This is a meetup of friends, so it’s free to come, we look forward to
> meeting you and keeping in touch. You pay your meal and drinks, but the
> rest is free.
>
> We ask you to register on our Doodle page at 
> http://doodle.com/poll/c9c7tatwqppyhkhq
>
>
> Please also indicate in a comment to your registration if you want to give
> a short presentation.
>
>
>
> See you soon in Zürich!
>
> ___
> seaside mailing list
> seas...@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
Mariano
http://marianopeck.wordpress.com


Re: [Pharo-users] looking for a tutorial on sounds in Pharo

2016-10-18 Thread Grigory Hatsevich
I’m interested in using a computer as a musical instrument and a  
XXI-century tool to learn how to play and compose music.


First, I’d like to implement a Janko keyboard emulator in Pharo (like this  
one http://monxmood.free.fr/roche/roche.html, but with various  
customizations) – it is an alternative piano keyboard layout that is 12  
times easier to learn to play because of its regular structure – unlike  
traditional piano keyboard layout. Demonstration of a real Janko piano:  
https://www.youtube.com/watch?v=cK4REjqGc9w=4m


Also I see playing with note sequences as a good way to learn programming  
(for those who love music, like me).




On Mon, 17 Oct 2016 02:21:57 +0700, Dimitris Chloupis  
 wrote:


I have used the Sound library for my project ChronosManager to play back  
an alarm sound, its an easy to use library but >quite powerful. Last  
time I checked could not get it working on Linux but it worked like a  
charm on MacOS and I think it >worked well also on windows.

Is there something specific you are interested for ?

On Sun, Oct 16, 2016 at 2:16 PM Grigory Hatsevich  
 wrote:
Hi! I'm looking for a tutorial about sound generation in Pharo. I've  
found
"PharoSoundTutorial" (https://github.com/xmessner/PharoSoundTutorial)  
but

it is in French. Is there an English version of this tutorial or some
other English text about sounds in Pharo?

Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Lionel Akue
Great!

We had the same idea :)

The first requirements I wrote was  to generate Spec UI directly. But I
rather chose to make Magritte compatible with Spec.

So from the Magritte description, we could generate Spec, Seaside ...

Lionel

2016-10-18 14:20 GMT+02:00 Peter Uhnak :

> Hi Hernan,
>
> I wrote some time ago two basic code generators (both in Pharo) from
> UML-ified FAMIX for a particular user (so there are some domain-specific
> patterns),
> one for Pharo syntax ( https://github.com/OpenPonk/
> class-editor/blob/master/docs/code-generation/uml-to-code.md )
> and one for VW syntax ( https://github.com/OpenPonk/
> class-editor/blob/master/docs/vw-code-generation/pim-psm.md )
>
> (the code is here https://github.com/OpenPonk/class-editor/tree/master/
> repository/DynaCASE-Generator.package and here
> https://github.com/OpenPonk/class-editor/tree/master/
> repository/UML-CodeGenerator.package )
>
> The most pain I had was with expressing templateable code to which I could
> just plug specific data, I wanted to look at QVT but didn't have the time
> yet.
> But it would be interesting to see if your generator could address such
> issues; plus soon I want to iterate on my generators to have more live
> interaction (so the code is generated on the fly as the model is created,
> although I am using Pharo Refactoring engine for now, which is also quite
> powerful.)
>
> Addionally, Lionel (in cc) is working on some meta system generating
> classes with magritte descriptions.
>
> So it would be cool if we could have some really cool generator that could
> do many cool things. :)
>
> Peter
>
> On Tue, Oct 18, 2016 at 02:24:28AM -0300, Hernán Morales Durand wrote:
> > Hi guys,
> >
> > I am writing a code generator, doing a few iterations right now.
> > I want your opinion, which most useful thing would you like to be
> generated
> > automatically? It could be a pattern, an idiom, another language...
> >
> > For example my own wish (roadmap) list:
> >
> > - A "settings framework" settings class generator.
> > - A state machine generator (based in the excellent paper of Trevor P.
> > Hopkins)
> > - A Spec UI generator.
> >
> > Let me know your thoughts.
> >
> > Cheers,
> >
> > Hernán
>


Re: [Pharo-users] Cog VM on Raspberry Pi ?

2016-10-18 Thread Henrik Johansen

> On 17 Oct 2016, at 8:43 , Sven Van Caekenberghe  wrote:
> 
> Hi,
> 
> Does a (faster) Cog VM for the Raspberry Pi actually exist ?
> 
> I tried comparing the latest OpenSmalltalk VM with some older ones, only to 
> find that they are all equally fast (slow actually):
> 
> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image printVersion
> [version] 5.0 #50581
> 
> "http://files.pharo.org/vm/pharoS/raspbian/latest.zip;
> 
> pi@raspberrypi ~/Pharo $ ./pharo -nodisplay Pharo.image eval '1 
> tinyBenchmarks'
> '167429692 bytecodes/sec; 11160247 sends/sec'
> 
> "http://www.mirandabanda.org/files/Cog/VM/VM.r3427/cogspurlinuxhtARM-15.33.3427.tgz;
> 
> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
> Pharo.image eval '1 tinyBenchmarks'
> '166992824 bytecodes/sec; 11337746 sends/sec'
> 
> "https://bintray.com/opensmalltalk/vm/download_file?file_path=cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz;
> 
> pi@raspberrypi ~/Pharo $ ./products/phcogspurlinuxhtRPi/pharo -nodisplay 
> Pharo.image eval '1 tinyBenchmarks'
> '166992824 bytecodes/sec; 11337746 sends/sec'
> 
> That is no significant difference on a RPi 3, at all. Is this normal ? Am I 
> missing something ?
> 
> Thx,
> 
> Sven
> 
> PS: Just for reference, my Mac Book Pro is 10 times faster
> 
> 1 tinyBenchmarks  "'1323852617 bytecodes/sec; 174185794 sends/sec'"

Are you 100% sure you benched different VM's?
A stack VM (PharoS) getting the same results as a Spur VM 
(cog_linux32ARMv6_pharo.cog.spur_201610142319.tar.gz) is rather suspicious...

At least on my Pi3, the spur Cog VM gives  numbers around 250M bytecodes/160M 
sends
which, while still "slow", is a decent bump in speed compared to what you're 
seeing.

Cheers,
Henry


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Peter Uhnak
On Tue, Oct 18, 2016 at 02:24:28AM -0300, Hernán Morales Durand wrote:
> - A Spec UI generator.

Oh, and Stephan did CRUD(e) Spec generator 
http://forum.world.st/ANN-SpecGenerator-easy-CRUD-applications-with-Spec-td4889624.html

Peter



Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Peter Uhnak
Hi Hernan,

I wrote some time ago two basic code generators (both in Pharo) from UML-ified 
FAMIX for a particular user (so there are some domain-specific patterns),
one for Pharo syntax ( 
https://github.com/OpenPonk/class-editor/blob/master/docs/code-generation/uml-to-code.md
 )
and one for VW syntax ( 
https://github.com/OpenPonk/class-editor/blob/master/docs/vw-code-generation/pim-psm.md
 )

(the code is here 
https://github.com/OpenPonk/class-editor/tree/master/repository/DynaCASE-Generator.package
 and here  
https://github.com/OpenPonk/class-editor/tree/master/repository/UML-CodeGenerator.package
 )

The most pain I had was with expressing templateable code to which I could just 
plug specific data, I wanted to look at QVT but didn't have the time yet.
But it would be interesting to see if your generator could address such issues; 
plus soon I want to iterate on my generators to have more live interaction (so 
the code is generated on the fly as the model is created, although I am using 
Pharo Refactoring engine for now, which is also quite powerful.)

Addionally, Lionel (in cc) is working on some meta system generating classes 
with magritte descriptions.

So it would be cool if we could have some really cool generator that could do 
many cool things. :)

Peter

On Tue, Oct 18, 2016 at 02:24:28AM -0300, Hernán Morales Durand wrote:
> Hi guys,
> 
> I am writing a code generator, doing a few iterations right now.
> I want your opinion, which most useful thing would you like to be generated
> automatically? It could be a pattern, an idiom, another language...
> 
> For example my own wish (roadmap) list:
> 
> - A "settings framework" settings class generator.
> - A state machine generator (based in the excellent paper of Trevor P.
> Hopkins)
> - A Spec UI generator.
> 
> Let me know your thoughts.
> 
> Cheers,
> 
> Hernán



Re: [Pharo-users] Spec: scaling imageModels

2016-10-18 Thread matteob8 via Pharo-users
--- Begin Message ---
Hi Stef,
I think that an automatic scaled behaviour is very useful for 
ImageModel,
especially if you need to generate list of images, that automatically adapts
to their container (i.e. Thumbnails).

Playing with AlpahImageMorph I found that the desired behaviour can be
obtained setting the "layout" state to the "#scaledAspect" symbol.

So I've added the "ImageModel>>switchScaledLayout" method, that will 
simply
call its MorphicAdapter, through the command "self changed:
#switchScaledLayout with: {}".
Then I've created the "MorphicImageAdapter>>switchScaledLayout" method,
that switchs among the "#center" and "#scaledAspect" morph layouts (note:
"#center" is the default for the Spec's "MorpdicImageAdapter").
Below the code the code I used:


MorphicImageAdapter>>switchScaledLayout
"Switch between scaled and fixed representation"

self
widgetDo: [ :w | 
| oldLayout |
oldLayout := w layout.
oldLayout = #scaledAspect
ifTrue: [ w layout: #center ]
ifFalse: [ w layout: #scaledAspect ] ].




Please let me know if you have any advice,

Thanks,
Matteo



--
View this message in context: 
http://forum.world.st/Spec-scaling-imageModels-tp4918440p4919199.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

--- End Message ---


[Pharo-users] Nao robot with Pharo and LRP

2016-10-18 Thread Miguel Campusano
Hello,
I've been working on an API for the Nao Robot [1] in Pharo. You can find an
early demo of how it works in Pharo:
https://www.youtube.com/watch?v=z8jopUfLWtQ

Moreover, I built a communication bridge between the Nao and LRP [2]. LRP
is a live programming language for robotic behaviors. You can see a working
demo of the nao moving via LRP here:
https://www.youtube.com/watch?v=q1jGDtaW41U

I want to emphasize how easy and fun can be to program a robot with a live
environment. Looking at the robot and see how immediately changes its
behavior whenever you send a command, that is cool!

You can find the API here (I have to write the documentation on how to use
it):
http://www.smalltalkhub.com/#!/~mcamp/NaoSocket

This is a work in progress. The Nao has several features that I'm planning
to incorporate in the API when they are needed.

To make this work I use TCP sockets to communicate with the robot. For the
Nao, there is a documentation on how the robot communicates via binary
packages, but the documentation lacks a lot of information that I managed
to figure it out by reading the binary information (thanks gtInspector for
that) and understanding how the robot works.

[1] https://www.ald.softbankrobotics.com/en/cool-robots/nao
[2] pleiad.cl/lrp


Re: [Pharo-users] [Seaside] Seaside can not be used with Pharo 60261

2016-10-18 Thread Johan Brichau
I only received a config for Grease :)
In my haste, I did not check you need Seaside :)

Right now, I’m a bit too busy so until someone can provide a working config, it 
will have to wait.

cheers
Johan

> On 18 Oct 2016, at 10:19, Norbert Hartl  wrote:
> 
> You uploaded ConfigurationOfGrease but not Seaside. Mistake?
> 
> Norbert
> 
>> Am 18.10.2016 um 10:11 schrieb Johan Brichau :
>> 
>> I uploaded the changes by Christophe. If it does not work, let me know. I 
>> did not try.
>> 
>> cheers
>> Johan
>> 
>> ps: right now the configuration is identical for pharo5.x and pharo6.x. If 
>> things start to fail for Pharo 6, we need to make another baseline to not 
>> break the configuration for pharo 4 and pharo 5
>> 
>>> On 18 Oct 2016, at 10:00, Johan Brichau  wrote:
>>> 
>>> Sure. Christophe Demarey has asked me if he can publish his changes to fix 
>>> the config for pharo 6.
>>> 
>>> I will upload them as soon as I receive them
>>> 
>>> Johan
>>> 
 On 17 Oct 2016, at 21:04, Esteban Lorenzano  wrote:
 
 this is a question more appropriate for Seaside list :) 
 
> On 17 Oct 2016, at 20:07, Pierre CHANSON  wrote:
> 
> In #SmalltalkImage>>metacelloPlatformAttributes, #'pharo5.x' 
> #'pharo5.0.x’ have been removed and Seaside does not have configuration 
> for pharo6.
> 
> Is there a plan to update the configuration of Seaside ?
> 
> Thanks !
> 
> Pierre and Norbert
 
 ___
 seaside mailing list
 seas...@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>> 
>> 
>> 
> 
> 




Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Thierry Goubier

Hi Otto,

for things like that, I would consider looking into the SmaCC visitor 
automatic generation. From an grammar, SmaCC creates the class, 
respecting an eventual inheritance constraint you specify, adds the 
instance variables, and generates the visitor (and an equality test too).


Regarding state machines generation, what class of automatons are you 
looking at? Because I'm looking at automatons generation by reusing 
SmaCC (for a tentative hardware architecture subject).


Regards,

Thierry

Le 18/10/2016 à 10:01, Otto Behrens a écrit :

+1 for the visitor. What would be nice is to generate methods in the
form #visit: for all classes in a given hierarchy (eg
Magritte's MAVisitor). The default implementation of such a method
would be to call #visit:

We have been using state machines for a long time and have built
generators for it (on a previous project, for which I do not have the
code). I still think that is a useful idea. It is difficult for the
code generator to maintain changes in the generated code with changes
in the "spec". Will you then define a DSL for the state machine?

On Tue, Oct 18, 2016 at 9:29 AM, Julien Delplanque  wrote:

Hello,

A generator for the visitor design pattern:
- Generate methods in visited objects: VisitedObject>>#accept: (with the
selector name configurable)
- Generate empty methods (or methods with a "self subclassResponsability" if
an abstract visitor is generated)
called in #accept: methods of VisitedObjects in the Visitor i.e
Visitor>>#acceptVisitedObject: (with the selector
name configurable again).

Each time this design pattern has to be used, it is annoying to write by
hand all these methods.

Regards,

Julien


On 18/10/16 07:24, Hernán Morales Durand wrote:


Hi guys,

I am writing a code generator, doing a few iterations right now.
I want your opinion, which most useful thing would you like to be
generated
automatically? It could be a pattern, an idiom, another language...

For example my own wish (roadmap) list:

- A "settings framework" settings class generator.
- A state machine generator (based in the excellent paper of Trevor P.
Hopkins)
- A Spec UI generator.

Let me know your thoughts.

Cheers,

Hernán












Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Otto Behrens
+1 for the visitor. What would be nice is to generate methods in the
form #visit: for all classes in a given hierarchy (eg
Magritte's MAVisitor). The default implementation of such a method
would be to call #visit:

We have been using state machines for a long time and have built
generators for it (on a previous project, for which I do not have the
code). I still think that is a useful idea. It is difficult for the
code generator to maintain changes in the generated code with changes
in the "spec". Will you then define a DSL for the state machine?

On Tue, Oct 18, 2016 at 9:29 AM, Julien Delplanque  wrote:
> Hello,
>
> A generator for the visitor design pattern:
> - Generate methods in visited objects: VisitedObject>>#accept: (with the
> selector name configurable)
> - Generate empty methods (or methods with a "self subclassResponsability" if
> an abstract visitor is generated)
> called in #accept: methods of VisitedObjects in the Visitor i.e
> Visitor>>#acceptVisitedObject: (with the selector
> name configurable again).
>
> Each time this design pattern has to be used, it is annoying to write by
> hand all these methods.
>
> Regards,
>
> Julien
>
>
> On 18/10/16 07:24, Hernán Morales Durand wrote:
>>
>> Hi guys,
>>
>> I am writing a code generator, doing a few iterations right now.
>> I want your opinion, which most useful thing would you like to be
>> generated
>> automatically? It could be a pattern, an idiom, another language...
>>
>> For example my own wish (roadmap) list:
>>
>> - A "settings framework" settings class generator.
>> - A state machine generator (based in the excellent paper of Trevor P.
>> Hopkins)
>> - A Spec UI generator.
>>
>> Let me know your thoughts.
>>
>> Cheers,
>>
>> Hernán
>>
>
>



Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Dimitris Chloupis
There is the CCodeGenerator , which is basically Slang, Smalltalk that is
turned into basic C. I would like to expand it to generate C++ at some
point for converting pharo code to C++ code that I will be able to add to
Unreal. Though its a very low priority project for me.

http://smalltalkhub.com/#!/~PavelKrivanek/CCodeGenerator

Personally I am against generalized solutions because they tend to be bad
for specialized cases , on the other hand I welcome any code that I can use
as inspiration for my own code generator.

On Tue, Oct 18, 2016 at 8:25 AM Hernán Morales Durand <
hernan.mora...@gmail.com> wrote:

> Hi guys,
>
> I am writing a code generator, doing a few iterations right now.
> I want your opinion, which most useful thing would you like to be
> generated automatically? It could be a pattern, an idiom, another
> language...
>
> For example my own wish (roadmap) list:
>
> - A "settings framework" settings class generator.
> - A state machine generator (based in the excellent paper of Trevor P.
> Hopkins)
> - A Spec UI generator.
>
> Let me know your thoughts.
>
> Cheers,
>
> Hernán
>
>