Skip to content

Commit

Permalink
Add temporary Scala 3 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Feb 3, 2021
1 parent 832accf commit 7312742
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions readme-scala-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## WIP Scala 3 support via Scala 2.13 / 3 compatibility

Relies on the `compiler` module introduced in https://github.com/lihaoyi/Ammonite/pull/1144.

Run with
```text
$ ./mill -i 'amm[3].run'
```

Only Scala `3.0.0-M1` works for now, as it's the only Scala 3 version that can both depend on and
be depended upon by Scala `2.13.4` modules. (The [Tasty reader version](https://github.com/lampepfl/dotty/blob/353677355f3a5ffe38b9abb31f07e61fbb37f50b/tasty/src/dotty/tools/tasty/TastyFormat.scala#L266-L267)
is the same for both `2.13.4` and `3.0.0-M1`. It was incremented in `3.0.0-M2` and `3.0.0-M3`, which
prevents `2.13.4` to read their Tasty files.)

pprint wasn't published for `3.0.0-M1`, so we use the `2.13` version. We can't use the
`TPrint` macros from Scala 3 because of that, so types are printed as `???`. Simple
unit tests (like `./mill 'amm.repl[3].test' ammonite.session.AdvancedTests.pprint`) pass,
thanks to a regex replacing types in the test fixtures with `???`. Not sure how far we
can get with that approach. [Scala version decoupling](https://github.com/alexarchambault/Ammonite/tree/wip-scala-3)
doesn't suffer that tasty reader version problem, so we can use `3.0.0-M2` fine for it.

0 comments on commit 7312742

Please sign in to comment.