Skip to content
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

Use operator precedence to print C code #970

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JasonGross
Copy link
Collaborator

@JasonGross JasonGross commented May 4, 2021

I'm attempting to make the printing code more uniform and factor out common patterns a bit more, in part to decrease the likelihood of transcription errors, but I'm afraid I might be making this code harder to read and understand. I'd love feedback on this @andres-erbsen @jedisct1 (and anyone else interested in looking at the backend code). The relevant file to look at is src/Stringification/C.v

This is also in part to allow implementing @FiloSottile's request in #949 to not have so many useless parentheses.

@jedisct1
Copy link
Contributor

jedisct1 commented May 4, 2021

This is certainly making the output look nicer.

However I'm not convinced that this is necessary. Extra parenthesis don't make the compiled code run any slower, and this is automatically generated code, that will not be manually modified.

The Coq code is far more complex to understand, which may hurt addition of new languages.

@JasonGross JasonGross marked this pull request as draft June 2, 2021 14:19
@JasonGross JasonGross marked this pull request as ready for review June 2, 2021 14:21
@JasonGross JasonGross marked this pull request as draft October 4, 2021 16:40
@lorandam
Copy link

I think your doing great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants