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 <[email protected] <mailto:[email protected]>> 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



Reply via email to