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
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
+1 for the visitor. What would be nice is to generate methods in the form #visit<Class Name>: for all classes in a given hierarchy (eg Magritte's MAVisitor). The default implementation of such a method would be to call #visit<My Super Class name>: 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 <julien@tamere.eu> 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
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<Class Name>: for all classes in a given hierarchy (eg Magritte's MAVisitor). The default implementation of such a method would be to call #visit<My Super Class name>:
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 <julien@tamere.eu> 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
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<Class Name>: for all classes in a given hierarchy (eg Magritte's MAVisitor). The default implementation of such a method would be to call #visit<My Super Class name>:
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 <julien@tamere.eu> 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
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
Hi Otto, 2016-10-18 5:01 GMT-03:00 Otto Behrens <otto@finworks.biz>:
+1 for the visitor. What would be nice is to generate methods in the form #visit<Class Name>: for all classes in a given hierarchy (eg Magritte's MAVisitor). The default implementation of such a method would be to call #visit<My Super Class name>:
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 <julien@tamere.eu> 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
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 <julien@tamere.eu> 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
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 <otto@finworks.biz> 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 <julien@tamere.eu> 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
Sorry, I did not catch this thread before. If you are looking for a terse way to describe state machines, you may want to have a look at LRP, a live programming language for nested state machines (for robotics), implemented in Pharo. It seems to have what you are talking about in your mail. It is made for robotics, but in the end can be used for a lot more stuff since it has a clean integration with Pharo. The URL of LRP is http://pleiad.cl/LRP If you have any questions, feel free to ask! -- 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 19 Oct 2016, at 00:44, Otto Behrens <otto@finworks.biz> wrote:
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.
Thank you Otto, I had a look and it seems a nice implementation (couldn't load into the image but using the Monticello Browser) Cheers, Hernán 2016-10-19 0:44 GMT-03:00 Otto Behrens <otto@finworks.biz>:
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 <julien@tamere.eu> 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
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.morales@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
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 <kilon.alios@gmail.com>:
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.morales@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
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.morales@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 <kilon.alios@gmail.com>:
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.morales@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
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/um... ) and one for VW syntax ( https://github.com/OpenPonk/class-editor/blob/master/docs/vw-code-generation... ) (the code is here https://github.com/OpenPonk/class-editor/tree/master/repository/DynaCASE-Gen... and here https://github.com/OpenPonk/class-editor/tree/master/repository/UML-CodeGene... ) 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
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 <i.uhnak@gmail.com>:
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
2016-10-18 9:35 GMT-03:00 Lionel Akue <lionelakue@gmail.com>:
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 <i.uhnak@gmail.com>:
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
Sure I will look and let you know. Lionel Le 18 oct. 2016 18:07, "Hernán Morales Durand" <hernan.morales@gmail.com> a écrit :
2016-10-18 9:35 GMT-03:00 Lionel Akue <lionelakue@gmail.com>:
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 <i.uhnak@gmail.com>:
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
Hernan What is the input you take to generate magritte? Lionel would like to have a kind of Crud on top of Pharo and it would be good for business. Stef Le 18/10/16 à 18:07, Hernán Morales Durand a écrit :
2016-10-18 9:35 GMT-03:00 Lionel Akue <lionelakue@gmail.com <mailto:lionelakue@gmail.com>>:
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 <i.uhnak@gmail.com <mailto:i.uhnak@gmail.com>>:
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/um... <https://github.com/OpenPonk/class-editor/blob/master/docs/code-generation/um...> ) and one for VW syntax ( https://github.com/OpenPonk/class-editor/blob/master/docs/vw-code-generation... <https://github.com/OpenPonk/class-editor/blob/master/docs/vw-code-generation...> )
(the code is here https://github.com/OpenPonk/class-editor/tree/master/repository/DynaCASE-Gen... <https://github.com/OpenPonk/class-editor/tree/master/repository/DynaCASE-Gen...> and here https://github.com/OpenPonk/class-editor/tree/master/repository/UML-CodeGene... <https://github.com/OpenPonk/class-editor/tree/master/repository/UML-CodeGene...> )
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
Hi Stef 2016-10-19 17:29 GMT-03:00 stepharo <stepharo@free.fr>:
Hernan
What is the input you take to generate magritte?
Something like this: CGStMagritte uniqueInstance inputClass: ModelClass1; targetClass: ModelClass1; setBooleanAttributes: 'instVar1' label: 'label iVar1' priority: 10; setDateAndTimeAttributes: 'instVar2' label: 'label Date and Time' priority: 20; setDateAttributes: 'instVar3' label: 'label Date' priority: 30; setFileAttributes: 'iVarFile' label: 'label File' priority: 40; setMemoAttributes: 'iVarMemo' label: 'label Memo' priority: 50; setMultiOptionAttributes: 'iVarMultiOption' label: 'label Multi Option' priority: 60; setNumberAttributes: 'iVarInteger' label: 'label Integer' priority: 70; generateMethods. Smalltalk tools browser openOnClass: ModelClass1. self inform: 'Done'. which generates ModelClass1>>descriptionInstVar1 <magitteDescription> | tmp2 | tmp2 := MABooleanDescription new. tmp2 accessor: #instVar1; label: 'label iVar1'; priority: 10. ^ tmp2 yourself ModelClass1>>descriptionInstVar2 <magitteDescription> | tmp2 | tmp2 := MADateAndTimeDescription new. tmp2 accessor: #instVar2; label: 'label Date and Time'; priority: 20. ^ tmp2 yourself and so on. Lionel would like to have a kind of Crud on top of Pharo and it would be
good for business.
Cool, hope he finds useful the code generator
Stef
Le 18/10/16 à 18:07, Hernán Morales Durand a écrit :
2016-10-18 9:35 GMT-03:00 Lionel Akue <lionelakue@gmail.com>:
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 <i.uhnak@gmail.com>:
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
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-td4... Peter
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.morales@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
They are useful for writing VM plugins for example. The generic part. On Tue, Oct 18, 2016 at 6:53 PM, Todd Blanchard <tblanchard@mac.com> 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.morales@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
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, phil@highoctane.be wrote:
They are useful for writing VM plugins for example. The generic part.
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.
Looks fun :) Le 18/10/16 à 19:10, Evan Donahue a écrit :
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
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.
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 < vonbecmann@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.
would be nice to ask dragos his Smalltalk code :) Le 18/10/16 à 21:20, phil@highoctane.be a écrit :
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 <vonbecmann@gmail.com <mailto:vonbecmann@gmail.com>> wrote:
Implementing State Machines in Smalltalk (1993) Trevor Hopkins http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.6732 <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.
Le 18/10/16 à 07:24, Hernán Morales Durand a écrit :
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. That one and a FAMIX Metamodel. Brice should build one so may be he can use yours and extend it.
Let me know your thoughts.
Cheers,
Hernán
participants (13)
-
Bernardo Ezequiel Contreras -
Dimitris Chloupis -
Evan Donahue -
Hernán Morales Durand -
Johan Fabry -
Julien Delplanque -
Lionel Akue -
Otto Behrens -
Peter Uhnak -
phil@highoctane.be -
stepharo -
Thierry Goubier -
Todd Blanchard