Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace macros with proc_macros #295

Closed
5 tasks done
theduke opened this issue Dec 18, 2018 · 2 comments
Closed
5 tasks done

Replace macros with proc_macros #295

theduke opened this issue Dec 18, 2018 · 2 comments
Assignees
Labels
enhancement Improvement of existing features or bugfix k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer
Milestone

Comments

@theduke
Copy link
Member

theduke commented Dec 18, 2018

Replace all macros used for defining GraphQL types with proc macro implementations.

This should probably be a two-step process: first implement proc-macro alternatives for everything and have tests for functional equivalence.
Then remove the old macros with a new breaking version.

@theduke theduke mentioned this issue Dec 18, 2018
2 tasks
@theduke theduke changed the title Replace all macros with proc_macros Replace macros with proc_macros Dec 18, 2018
@samuela
Copy link
Contributor

samuela commented Feb 18, 2020

Forgive me if this is a noob question, but what's the difference between macros and proc macros?

@tyranron
Copy link
Member

tyranron commented Jun 4, 2020

@samuela

Forgive me if this is a noob question, but what's the difference between macros and proc macros?

If it's still relevant, see the official reference:

TL;DR

Declarative macros:

  • declared via pattern-match syntax
  • guaranteed to be hygienic
  • restricted in expresiveness to certain patterns

Procedural macros:

  • declared as a separate crate
  • hygiene is up to an implementor
  • accept and produce raw tokens, so can generate arbitrary kind of stuff

@tyranron tyranron added k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer enhancement Improvement of existing features or bugfix labels Jun 4, 2020
@tyranron tyranron self-assigned this Jun 4, 2020
@tyranron tyranron added this to the 0.16.0 milestone Jun 1, 2022
@tyranron tyranron closed this as completed Jun 1, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Improvement of existing features or bugfix k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer
Projects
None yet
Development

No branches or pull requests

3 participants