-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update macro docs #17060
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
Update macro docs #17060
Conversation
The PCP is mentioned in multiple documentation pages (staging.md, macros-spec.md, macros.md), are all these references incorrect? |
Yes. I will update them. |
d44833e
to
2ebe0ea
Compare
@smarter I completely reworked Mostly I would keep an eye out for latex formatting details that I could have missed. |
b276a56
to
b6e1950
Compare
Before `3.0` we experimented with the Phase Consistency Principle (PCP) which was described in [A practical unification of multi-stage programming and macros](https://dl.acm.org/doi/10.1145/3278122.3278139). This principle restricted term and types to be used at the same level. Now, and since `3.0` we use a more general version of cross-stage safety where types can be used at any level. Lower levels get erased and higher levels require a given `Type[T]`. The most updated reference is in [Scalable Metaprogramming in Scala 3](https://github.com/nicolasstucki/nicolasstucki/raw/main/Scalable%20Metaprogramming%20in%20Scala%203.pdf). We must remove the use of the term PCP to avoid confusion in the current implementation.
Copy pasted and adapted a bit the contents of chapter 3 of _Scalable Metaprogramming in Scala 3_. The previous version was based on _A practical unification of multi-stage programming and macros_. This version was extremely out of date.
b6e1950
to
d8c9714
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some formatting suggestions. What's the difference between _spec/TODOreference and reference?
Co-authored-by: anna herlihy <herlihyap@gmail.com>
Copy pasted and adapted a bit the contents of chapter 3 of Scalable Metaprogramming in Scala 3.
The previous version was based on A practical unification of multi-stage programming and macros. This version was extremely out of date.
Old nomenclature of cross-stage safty
Before
3.0
we experimented with the Phase Consistency Principle (PCP) which was described in A practical unification of multi-stage programming and macros. This principle restricted term and types to be used at the same level.Now, and since
3.0
we use a more general version of level consistency where types can be used at any level. Lower levels get erased and higher levels require a givenType[T]
. The most updated reference is in Scalable Metaprogramming in Scala 3.We must remove the use of the term PCP to avoid confusion in the current implementation.