Skip to content

std.builtin.CompilerBackend: useless renaming #16805

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

Closed
wants to merge 13 commits into from
Closed

std.builtin.CompilerBackend: useless renaming #16805

wants to merge 13 commits into from

Conversation

BratishkaErik
Copy link
Contributor

@BratishkaErik BratishkaErik commented Aug 13, 2023

Remove stage1 tag since old C++ compiler was removed NUKED in #13560, rename remaining stage2_* backends to zsf_* (choosed this prefix for clarity over simply omitting old prefix, but if you want I can omit it or change to other prefix).
Gains one more free tag (out of 18_446_744_073_709_551_615) and one possible bug removed (switching/checking if (backend == .stage1) even when this compiler was removed) (I forgot that this enum is non-exhaustive)

… tags

stage1 compiler was removed in e7d2834,
so let's remove tag that occupies space while we are pre-1.0.
Backend `other` not touched, `stage2_llvm` needed for
boostrapping at the moment.

Signed-off-by: Eric Joldasov <[email protected]>
Signed-off-by: Eric Joldasov <[email protected]>
…m`, reorder integer values

Signed-off-by: Eric Joldasov <[email protected]>
Signed-off-by: Eric Joldasov <[email protected]>
@mlugg
Copy link
Member

mlugg commented Aug 13, 2023

I think you're misunderstanding the purpose of this enum. The whole point of it is to work around issues in compiler implementations, using compiler-specific logic. Because the stage1 compiler existed at one point in time, the enum tag exists to allow programs - both old and new - to support it if they desire.

IMO, this enum should never have tags removed: it is intended to be a record of every major Zig compiler implementation which has existed, and removing tags is a completely pointless breaking change with no benefits and some potential (if minor) downsides.

Additionally, renaming stage2_* to zsf_* could lead to confusion: this isn't the only compiler implementation the ZSF have ever worked on (because stage1 also existed). This change, again, has zero benefits and a potential downside of confusion.

@BratishkaErik BratishkaErik deleted the compilerbackend-enum-remove-stage1 branch August 13, 2023 14:38
@BratishkaErik
Copy link
Contributor Author

Ok, nearly got it, but should it then be commented as such (/// All tags are preserved for historical and compatibility purposes.)? I didn't find something similar here and thought that it's fine to free one tag while we are pre-1.0.

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

Successfully merging this pull request may close these issues.

2 participants