Skip to content

Clearer points in favour of macro mixing #2970

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
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion _overviews/scala3-migration/compatibility-metaprogramming.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ You can learn all the new metaprogramming concepts by reading the [Macros in Sca
## Cross-building a Macro Library

You have written a wonderful macro library and you would like it to be available in Scala 2.13 and Scala 3.
There are two different approaches, the traditional cross-building technique and the more experimental mixing macro technique.
There are two different approaches, the traditional cross-building technique and the more flexible macro mixing technique.

The benefit of macro mixing is that consumers who take advantage of the `-Ytasty-reader` option can still use your macros.

You can learn about them by reading these tutorials:
- [Cross-Building a Macro Library](tutorial-macro-cross-building.html)
- [Mixing Scala 2.13 and Scala 3 Macros](tutorial-macro-mixing.html)
Expand Down
8 changes: 5 additions & 3 deletions _overviews/scala3-migration/tutorial-macro-mixing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ previous-page: tutorial-macro-mixing
next-page: tooling-syntax-rewriting
---

This tutorial shows how to mix Scala 2.13 and Scala 3 macros in a single artifact.
This tutorial shows how to mix Scala 2.13 and Scala 3 macros in a single artifact. This means that consumers can use '-Ytasty-reader' from Scala 2.13 code that uses your macros.

It can be used to create a new Scala 3 macro library and make it available for Scala 2.13 users.
It can also be used to port an existing Scala 2.13 macro library to Scala 3, although it is probably easier to cross-build.
There are two main benefits of this:

1. Making a new or existing scala 3 macro library available for Scala 2.13 users without having to provide a separate 2.13 version
2. Allowing your macros to be usable in multi-project builds that are being upgraded module by module.

## Introduction

Expand Down