protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Large numeric litteral are hard to read

Open BijanVeyssi opened this issue 2 years ago • 2 comments

What language does this apply to? It applies to the Text Format Language.

Describe the problem you are trying to solve. I am currently writing big numbers in protobuf text format and it is pretty hard to read. That is why I would like to improve the readability.

Describe the solution you'd like I would like to have to support of underscores inside numeric litterals. e.g.:

  • 250000 can be written 250_000
  • 0xFFFEFFEF can be written 0xFF_FE_FF_EF

Of course, having it working with octal might also be useful for someone else.

Describe alternatives you've considered Since many other languages such as c++, rust, python, Toml implements _ inside numeric litteral I think it is one of the best solution for readability.

BijanVeyssi avatar Jan 17 '24 11:01 BijanVeyssi

We've actually gotten a related proposal internally to add FieldOptions to specify how integers should be printed in text format that I think would be related to this case (although not specifically with the 250_000 type formatting). Let me follow up and see where that proposal landed.

I believe this is something we're unlikely to have capacity to staff ourselves otherwise though given priorities.

zhangskz avatar Jan 18 '24 21:01 zhangskz

For consideration in #edition2024

googleberg avatar Feb 17 '24 16:02 googleberg

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar May 18 '24 10:05 github-actions[bot]

Still considering for #edition2024

googleberg avatar May 18 '24 18:05 googleberg

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Aug 17 '24 10:08 github-actions[bot]