Hi everyone! Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog. Cheers! Uko
Hey Uko, this pattern for a message sent: `@msg:`@args can match message sends with or without arguments, so it matches both 1 squared. and 1 raisedTo:2 The problem is that the first match "1 squared" will give a DNU on the right pane, as the argument var '@args is empty. 2016-08-04 10:23 GMT+02:00 Yuriy Tymchuk <yuriy.tymchuk@me.com>:
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy. tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
Cheers! Uko
2016-08-04 11:38 GMT+02:00 Nicolai Hess <nicolaihess@gmail.com>:
Hey Uko,
this pattern for a message sent:
`@msg:`@args
can match message sends with or without arguments, so it matches both
1 squared. and 1 raisedTo:2
The problem is that the first match "1 squared" will give a DNU on the right pane, as the argument var '@args is empty.
And if you match a method, it can happen that the keys <-> values in the map are actually strings or text and not a pattern variable (-source--, -pragma-, and the pattern method selector).
2016-08-04 10:23 GMT+02:00 Yuriy Tymchuk <yuriy.tymchuk@me.com>:
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.ty mch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
Cheers! Uko
Thank you for the feedback Nicolai! I will take a look as soon as I get back home :) Cheers. Uko Sent from my iPhone
On 04 Aug 2016, at 11:56, Nicolai Hess <nicolaihess@gmail.com> wrote:
2016-08-04 11:38 GMT+02:00 Nicolai Hess <nicolaihess@gmail.com>:
Hey Uko,
this pattern for a message sent:
`@msg:`@args
can match message sends with or without arguments, so it matches both
1 squared. and 1 raisedTo:2
The problem is that the first match "1 squared" will give a DNU on the right pane, as the argument var '@args is empty.
And if you match a method, it can happen that the keys <-> values in the map are actually strings or text and not a pattern variable (-source--, -pragma-, and the pattern method selector).
2016-08-04 10:23 GMT+02:00 Yuriy Tymchuk <yuriy.tymchuk@me.com>:
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
<Screen Shot 2016-08-01 at 13.40.49.png>
Cheers! Uko
Yes, I have fixed that, but forgot to merge the development branch :). The latest version should work. Uko
On 04 Aug 2016, at 11:56, Nicolai Hess <nicolaihess@gmail.com> wrote:
2016-08-04 11:38 GMT+02:00 Nicolai Hess <nicolaihess@gmail.com <mailto:nicolaihess@gmail.com>>: Hey Uko,
this pattern for a message sent:
`@msg:`@args
can match message sends with or without arguments, so it matches both
1 squared. and 1 raisedTo:2
The problem is that the first match "1 squared" will give a DNU on the right pane, as the argument var '@args is empty.
And if you match a method, it can happen that the keys <-> values in the map are actually strings or text and not a pattern variable (-source--, -pragma-, and the pattern method selector).
2016-08-04 10:23 GMT+02:00 Yuriy Tymchuk <yuriy.tymchuk@me.com <mailto:yuriy.tymchuk@me.com>>: Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html <http://blog.yuriy.tymch.uk/2016/08/matchtool.html> The tool is available for Pharo 6 from the catalog.
<Screen Shot 2016-08-01 at 13.40.49.png>
Cheers! Uko
This is very cool Uko. I suggest to have a list of small examples, one click away from the main UI. Alexandre
On Aug 4, 2016, at 4:23 AM, Yuriy Tymchuk <yuriy.tymchuk@me.com> wrote:
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
<Screen Shot 2016-08-01 at 13.40.49.png>
Cheers! Uko
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On 04 Aug 2016, at 13:34, Alexandre Bergel <alexandre.bergel@me.com> wrote:
This is very cool Uko.
Thank you.
I suggest to have a list of small examples, one click away from the main UI.
Good point, Iâll add this to my TODO list. Uko
Alexandre
On Aug 4, 2016, at 4:23 AM, Yuriy Tymchuk <yuriy.tymchuk@me.com> wrote:
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
<Screen Shot 2016-08-01 at 13.40.49.png>
Cheers! Uko
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
BTW our experience with anne and JC when they tried to document how the patterns were working is that there are some situations
that are not clear, and this is why Camille and Mark started to work on another solution.
I hope to get to know more soom.
There will be a presentation during ESUG. So, see you there :)
really nice. Stef Le 4/8/16 à 10:23, Yuriy Tymchuk a écrit :
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
Cheers! Uko
BTW our experience with anne and JC when they tried to document how the patterns were working is that there are some situations that are not clear, and this is why Camille and Mark started to work on another solution. I hope to get to know more soom. Stef Le 4/8/16 à 10:23, Yuriy Tymchuk a écrit :
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
Cheers! Uko
I know about all that, and Iâve tried to discuss about some kind of collaboration, but it didnât work out. RBPattern nodes are straight-forward. The are just a Smalltalk code with special nodes. The problem about them is that it is not clear what is happening, because you have to create a LintRule which creates one more Rule which creates an AST node, and then it traverses an AST and changes it in the same time⦠for me it was a lot of mess. I moved to the lowest level and introduces a really simple API: matchNode := RBPatternParser parseExpression: aMatchString. matchNode match: anASTNode onSuccess: [ :map | âdo something with a mapping" ] onFailure: [ âdo something in case of failureâ ] And you can easily debug this, and other tools can use this, for example match tool does: testAST nodesDo: [ :node | âtry to match nodeâ ] so I can look for all possible matches. Iâve heard that Camille and Mark are making something super generic for matching objects, but my problem is that I need to give people possibility to make their rules easy, and each time I ask if I can use something there is still work in progress. There is another problem: for now I have no use case for matching objects, I have a prototype of rules about objects, but sadly itâs out of my scope. Then how easy is the syntax? RBPatternCode is the closest you can get to Smalltalk code, if we give people another syntax they will have to learn something new and will resist. Finally what infrastructure do we have around it? I always use rubular.com when I need to work with regex, and now I will always use MatchTool when I need to work with the pattern code. Is there any support for inspecting the matches from the new framework? So in the end Iâm always ready for collaboration and always looking for collaboration, but at the moment I donât need some super-powerful matching framework. I need something easy for people to use, and this is why Iâm refactoring rules and implementing tools like this. And it seems easier for me to fix a bug in pattern code matching (especially as it is easier to debug it) than adopting a new framework. Another example. MatchTool should definitely marry RewriteTool, because after youâve investigated the matches you should be able to say: "ok, and now I want to transform thisâ, and then you enter another expression and save a rule. In fact RewriteTool inspired me a lot. Because it is very useful, but you enter code and it is not highlighted, so you have no clue if you made a mistake. Or you create a âmeta variableâ and you want to know what are these `@ things and you have to google. Or your code is finally matching, but you have no idea what was matched to what. I really hate when I have no clue what is happening, and this is why Iâve implemented MatchTool. Cheers. Uko
On 04 Aug 2016, at 13:45, stepharo <stepharo@free.fr> wrote:
BTW our experience with anne and JC when they tried to document how the patterns were working is that there are some situations
that are not clear, and this is why Camille and Mark started to work on another solution. I hope to get to know more soom.
Stef
Le 4/8/16 à 10:23, Yuriy Tymchuk a écrit :
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html <http://blog.yuriy.tymch.uk/2016/08/matchtool.html> The tool is available for Pharo 6 from the catalog.
<Mail Attachment.png>
Cheers! Uko
Le 4/8/16 à 14:27, Yuriy Tymchuk a écrit :
I know about all that, and Iâve tried to discuss about some kind of collaboration, but it didnât work out.
this is not a problem :)
RBPattern nodes are straight-forward. The are just a Smalltalk code with special nodes.
Indeed
The problem about them is that it is not clear what is happening, Yes it killed me often in the past. I would like to have something super simple to be able to write rules. because you have to create a LintRule which creates one more Rule which creates an AST node, and then it traverses an AST and changes it in the same time⦠for me it was a lot of mess. I moved to the lowest level and introduces a really simple API:
matchNode := RBPatternParser parseExpression: aMatchString. matchNode match: anASTNode onSuccess: [ :map | âdo something with a mapping" ] onFailure: [ âdo something in case of failureâ ] good. Gustavo may be interested by your work.
And you can easily debug this, and other tools can use this, for example match tool does:
testAST nodesDo: [ :node | âtry to match nodeâ ]
so I can look for all possible matches.
It is sad that I did not record precisely the problems that anne and JC encountered. Because now I forgot but it basically kills the enrrgy to write a nice chapter on how to use the rules so this is good that your tool is making easier to work with them.
Iâve heard that Camille and Mark are making something super generic for matching objects, but my problem is that I need to give people possibility to make their rules easy, and each time I ask if I can use something there is still work in progress.
Sure my point was not to say not to do it and to use the system of Mark and Camille :)
There is another problem: for now I have no use case for matching objects, I have a prototype of rules about objects, but sadly itâs out of my scope. we should let them deliver and we will see. Then how easy is the syntax? RBPatternCode is the closest you can get to Smalltalk code, if we give people another syntax they will have to learn something new and will resist. We will see. May be we can clone your tool and use their matcher. Finally what infrastructure do we have around it? I always use rubular.com <http://rubular.com> when I need to work with regex, and now I will always use MatchTool when I need to work with the pattern code. We should integrate your tool to the system :) Is there any support for inspecting the matches from the new framework? I do not think so.
So in the end Iâm always ready for collaboration and always looking for collaboration, but at the moment I donât need some super-powerful matching framework. For me I need something that I can understand and I can use. The problem is that with RB I never could :). I got always frustrated because I forgot a . or @t This is why I asked Mark to work on the rewrite tools using direct manipulation. I need something easy for people to use, and this is why Iâm refactoring rules and implementing tools like this. And it seems easier for me to fix a bug in pattern code matching (especially as it is easier to debug it) than adopting a new framework. Ok now Anne and JC got frustrated by it. If you can understand it then it is probably the way to go for you.
Another example. MatchTool should definitely marry RewriteTool, because after youâve investigated the matches you should be able to say: "ok, and now I want to transform thisâ, and then you enter another expression and save a rule. In fact RewriteTool inspired me a lot. Because it is very useful, but you enter code and it is not highlighted, so you have no clue if you made a mistake. Or you create a âmeta variableâ and you want to know what are these `@ things and you have to google. Or your code is finally matching, but you have no idea what was matched to what. :) same experience here. So often I was doing everything by hand and frustrated I really hate when I have no clue what is happening, and this is why Iâve implemented MatchTool. Yes please. I'm sure that mark would be happy to get his tool more used.
Cheers. Uko
On 04 Aug 2016, at 13:45, stepharo <stepharo@free.fr <mailto:stepharo@free.fr>> wrote:
BTW our experience with anne and JC when they tried to document how the patterns were working is that there are some situations
that are not clear, and this is why Camille and Mark started to work on another solution.
I hope to get to know more soom.
Stef
Le 4/8/16 à 10:23, Yuriy Tymchuk a écrit :
Hi everyone!
Iâm happy to announce a new tool that can help you to understand to the pattern code is working in match & rewrite rules. You can read more on my blogpost: http://blog.yuriy.tymch.uk/2016/08/matchtool.html The tool is available for Pharo 6 from the catalog.
<Mail Attachment.png>
Cheers! Uko
participants (5)
-
Alexandre Bergel -
Mark Rizun -
Nicolai Hess -
stepharo -
Yuriy Tymchuk