-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(release): Switch from nom to winnow #948
Conversation
This is prep for 0.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for tackling this, it's much appreciated!
This is also a huge opportunity for having the parsers cleaned up by someone who knows what they are doing. After all, whenever I deal with nom
parsing, I feel like I learn from scratch and resort to the common 5 things I know work, without that necessarily being the best or most efficient way, but merely a way that works.
With that said, there probably is potential performance improvements along the way and once you get to gix-object
. That should probably be the last crate to handle as it's probably the one with the most parsing code, and some complexity around error handling (it has two modes, one with unit error, and one with a more detailed one, all in the name of performance).But I get ahead of myself.
One more suggestion: please refrain from using conventional git prefixes unless you these to show up in the changelogs. My policy is to only use them when it's relevant to users of the crate or application, which most certainly isn't the case here. Typically I will use a conventional commit when merging to bring one summarized message into the changelog that way.
With that said, I am looking forward to the next PRs.
I'll keep an eye out for general factors. Once using winnow, if you have feedback on what makes it hard to step away and come back to it, I'm all open. Would love to find ways to make that easier. |
Maybe it's due to Whenever I started a new parser, I found myself going back to the existing ones in this codebase to learn from them. So maybe, it's all about the tutorialization to learn the ropes properly, and with a good basis it will be easier to retain that knowledge and keep feeling comfortable with it. I will let you know if something else comes to mind, the above was a quick stab at the topic. |
Definitely easy to forget though I think naming and organization can help.
I have adopted a tutorial that explains the principles and practices. Unsure if this will quite fit the role you need. Our special topics also provide a good way to look things up by problem. |
Thanks for sharing! I am sure these will come in handy the next time I have to implement one of these! I think it's also telling that many parsers since then I implemented by hand, which probably means I have been burned by Nonetheless, having the conversion to |
I think doing things by hand is fine.. For |
Been having a couple of workflow issues
Also, I didn't realize that |
I assume that you have installed About point 2, I don't know if it's related to point 1. I could probably say more if I knew the error message.
I totally forgot about that and guess I took the quick and convenient route there. It's an interesting problem as well for |
Yes, I ran The checkout is likely related
Once I have a better handle on it, I'd like to look at removing winnow from the public API |
@Byron has mentioned interest in
winnow
but priorities lie elsewhere, so I'm porting thegitoxide
repo over, starting withcargo-smart-release
.My expectation is that I will help with upgrades across breaking changes though I try to make that path as smooth as possible by providing both implementations of an API and deprecating the old one, rather than making hard cut offs, allowing the compiler to guide people through upgrades.
I started here because I assumed this was a smaller, less critical parser to test the waters with.
I did this the "easy path" which was to port to winnow 0.3 which has almost the exact same API as nom and then used the deprecation messages to help me through the process. I split this up into a lot of commits so that it would be easier to see what changed as rustfmt did its thing.