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

Idea: more intuitive crate name #169

Closed
dherman opened this issue Mar 10, 2019 · 6 comments
Closed

Idea: more intuitive crate name #169

dherman opened this issue Mar 10, 2019 · 6 comments
Milestone

Comments

@dherman
Copy link

dherman commented Mar 10, 2019

When I was learning procedural macros, I found the name proc_macro2 not super illuminating and even a bit demoralizing: it gave me the feeling that there was a potentially unbounded number of concepts and not-necessarily-coordinated technologies I’d need to learn in order to get off the ground.

The purpose of this crate, if I’ve understood properly, is like what the web ecosystem calls a “polyfill”: a shim library that serves as a bridge to allow people to migrate to a new platform capability before that capability has become universally available.

Would it be worth considering, maybe for a future 0.x minor release (ie a pre-stable “Major” release), moving the crate to a new name like proc_macro_polyfill or proc_macro_shim?

I feel a name change could really help people compartmentalize the purpose of this crate as they’re learning procedural macros, which could really help prevent them falling off the on-ramp.

Thoughts?

@dherman
Copy link
Author

dherman commented Mar 10, 2019

(/cc @dtolnay who I mentioned this idea to on Discord)

@dherman
Copy link
Author

dherman commented Mar 10, 2019

Or replace underscores with - but otherwise same proposal :)

@alexcrichton
Copy link
Contributor

Seems reasonable to me! The crate ended up surviving far longer than I originally thought it would, and I agree that the name is pretty bad given its intended purpose today!

We'll want to, as usual, coordinate with syn and quote for a breaking change, but this seems plausible to pick up when that happens.

@dtolnay dtolnay added this to the 1.0 milestone Apr 23, 2019
@mystor
Copy link
Contributor

mystor commented Aug 10, 2019

@dtolnay Do we want to do this renaming before quote and syn hit 1.0?

@dtolnay
Copy link
Owner

dtolnay commented Aug 10, 2019

Not necessarily -- we can make proc-macro2 reexport from the new name once one is picked, making them effectively aliases. Then quote and syn would be free to change their dependency to the new name in a nonbreaking release.

The future of proc_macro is still pretty unclear. In rust-lang/rust#57288 / rust-lang/rust@38c82a2 it seems that the types from proc_macro will end up as a submodule of a crate called meta which is wired up to require no extern crate (like std and core, unlike current proc_macro). With that in mind, a name like proc_macro_shim may not continue making sense indefinitely anyway.

I think it would be good to focus on progress around meta first, and roll that out simultaneously with whatever naming changes in proc-macro2 make them coherent together.

@mystor
Copy link
Contributor

mystor commented Aug 11, 2019

Interesting! I hadn't seen the discussion around the meta name. Given there's turmoil there, I think it's reasonable to leave this crate's name as-is for now.
Is there a discussion/RFC for what meta will look like? Mostly curious, but I might be able to help out.

@dtolnay dtolnay closed this as completed Dec 10, 2021
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

No branches or pull requests

4 participants