Skip to content

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

Merged

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Mar 7, 2023

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 given Type[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.

@nicolasstucki nicolasstucki marked this pull request as ready for review March 7, 2023 15:36
@nicolasstucki nicolasstucki requested a review from smarter March 7, 2023 15:36
@smarter
Copy link
Member

smarter commented Mar 7, 2023

The PCP is mentioned in multiple documentation pages (staging.md, macros-spec.md, macros.md), are all these references incorrect?

@nicolasstucki
Copy link
Contributor Author

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.

@nicolasstucki nicolasstucki changed the title Update level checking nomenclature Update cross-stage safety nomenclature Mar 8, 2023
@nicolasstucki nicolasstucki force-pushed the update-level-checking-nomenclature branch 5 times, most recently from d44833e to 2ebe0ea Compare March 8, 2023 08:42
@nicolasstucki nicolasstucki changed the title Update cross-stage safety nomenclature Update macro docs Mar 8, 2023
@nicolasstucki
Copy link
Contributor Author

nicolasstucki commented Mar 8, 2023

@smarter I completely reworked macros.md and macros-spec.md using the up-to-date contents of my thesis. The diff will not be helpful for reviewing this one. If it helps, I could share the original Latex source code.

Mostly I would keep an eye out for latex formatting details that I could have missed.

@nicolasstucki nicolasstucki force-pushed the update-level-checking-nomenclature branch from b276a56 to b6e1950 Compare March 8, 2023 10:20
@nicolasstucki nicolasstucki requested review from aherlihy and removed request for smarter March 9, 2023 13:09
@nicolasstucki nicolasstucki assigned aherlihy and unassigned smarter Mar 9, 2023
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.
@nicolasstucki nicolasstucki force-pushed the update-level-checking-nomenclature branch from b6e1950 to d8c9714 Compare March 14, 2023 14:56
Copy link
Contributor

@aherlihy aherlihy left a 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>
@nicolasstucki nicolasstucki merged commit 49215aa into scala:main Mar 21, 2023
@nicolasstucki nicolasstucki deleted the update-level-checking-nomenclature branch March 21, 2023 13:20
@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 1, 2023
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.

4 participants