From 72ba4c1df8f7b6e7033463d5c37e9786d515bd38 Mon Sep 17 00:00:00 2001 From: John Duffell Date: Wed, 14 Feb 2024 10:50:20 +0000 Subject: [PATCH 1/3] document multi project build macro mixing benefits --- _overviews/scala3-migration/tutorial-macro-mixing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_overviews/scala3-migration/tutorial-macro-mixing.md b/_overviews/scala3-migration/tutorial-macro-mixing.md index a0a88b17ce..bd5b2956b8 100644 --- a/_overviews/scala3-migration/tutorial-macro-mixing.md +++ b/_overviews/scala3-migration/tutorial-macro-mixing.md @@ -7,10 +7,10 @@ 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. There are two main benefits of this: -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. +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 multi-project builds to be upgraded module by module, even where macro libraries are used. ## Introduction From a2934a5e00c67ad005de4f969511719062747a05 Mon Sep 17 00:00:00 2001 From: John Duffell Date: Wed, 14 Feb 2024 11:04:52 +0000 Subject: [PATCH 2/3] make it clearer the benefits of macro mixing --- _overviews/scala3-migration/compatibility-metaprogramming.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_overviews/scala3-migration/compatibility-metaprogramming.md b/_overviews/scala3-migration/compatibility-metaprogramming.md index aae66f0532..675f5fc4a3 100644 --- a/_overviews/scala3-migration/compatibility-metaprogramming.md +++ b/_overviews/scala3-migration/compatibility-metaprogramming.md @@ -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) From a59ef922f4ef733444630c6d36f163aa7ceeeacf Mon Sep 17 00:00:00 2001 From: John Duffell Date: Wed, 14 Feb 2024 11:10:04 +0000 Subject: [PATCH 3/3] mention -Ytasty-reader in connection with macro mixing --- _overviews/scala3-migration/tutorial-macro-mixing.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/_overviews/scala3-migration/tutorial-macro-mixing.md b/_overviews/scala3-migration/tutorial-macro-mixing.md index bd5b2956b8..99514f6370 100644 --- a/_overviews/scala3-migration/tutorial-macro-mixing.md +++ b/_overviews/scala3-migration/tutorial-macro-mixing.md @@ -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. There are two main benefits of this: +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. + +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 multi-project builds to be upgraded module by module, even where macro libraries are used. +2. Allowing your macros to be usable in multi-project builds that are being upgraded module by module. ## Introduction