-
Notifications
You must be signed in to change notification settings - Fork 27
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
Drop BigEndian from codegen input #81
Conversation
411239d
to
e3cfb25
Compare
b6f266b
to
6798c44
Compare
3a0e908
to
40b0156
Compare
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.
This ended up being quite a bit cleaner than I expected, and the codegen inputs definitely make sense. I think a lot of the things I would otherwise touch on here were mentioned in our call, so I will try to be brief:
- on returning spanned errors versus panicking: this is definitely a tradeoff? One way to think about it is about whether you're using the tool with a new codegen input, or if you're working on the codegen code itself. If you're working on the codegen code, panciking is useful, but if you're working on a new codegen input this is much less true. Which case matters more? In my work I was optimizing for making it easier to use the codegen tool than to hack on it, so I made an effort to avoid panicking where possible, and focus on reporting errors in the input files.
BigEndian
: if we don't have it here, we've lost one of the main motivations for having it in the code at all, so this is something to revisit in followup.- logging: it took me some googling to figure out what env var I should pass to enable logging, and when I did it seemed to produce a lot of noise. Maybe the solution here is to change the default level to
Info
, and useInfo
for things we want to print regardless?
Overall it's definitely encouraging to see you jump in here and make significant changes without too much evident frustration, I definitely wasn't sure how much joy folks would find in modifying the codegen code itself.
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.
lgtm modulo existing comments :)
Should the codegen tour's section on BigEndian be updated somehow after this PR? |
Remove BigEndian from codegen inputs. Output is unchanged, except a few places where a (pointless?)
BigEndian<u8>
is changed to nakedu8
. Fixes #71.I have a lot of noisy logging that I would ideally like to keep but have toggled off by default, akin to a debug level log in normal Google source. Not sure how best to get that in Rust. EDIT: per @dfrg I added log & env_logger which seem to work well.