Even though it works with any compiler version, an updated scala-cli might be necessary if my script relies on a using directive introduced in a new scala-cli version. If the scala version using directive ensured that the scala and scala-cli versions were guaranteed to be in sync, this wouldn’t be an issue.
Even though it works with any compiler version, an updated scala-cli might be necessary if my script relies on a using directive introduced in a new scala-cli version. If the scala version using directive ensured that the scala and scala-cli versions were guaranteed to be in sync, this wouldn’t be an issue.
It would probably be better in some cases, but that clashes with the whole idea of package managers if we did a behind the scenes update.
We can do that though I think via parameter --scala-cli-version
so that would theoretically be possible.
This can work currently via for example
scala --cli-version 0.2.0 version
This proposal was discussed during the SIP meeting today. There was a long discussion (see below), but ultimately the Committee voted to accept moving the proposal from the experimental stage to the completed stage. Here are the points that were raised by the Committee:
- The content of the proposal should be updated to reflect the changes that happened during the experimental phase (e.g. drop of multi-line using directives in the syntax specification, possibly express their syntax without relying on the grammar of Scala).
- The versioning adopted by Scala CLI has complex implications (in addition to the points raised by @smarter above):
- following the same versioning as Scala 3 may foster some confusion because the users will believe that they need to update Scala CLI to use a newer version of Scala although what they need to do really is to bump the version of Scala in their using directive (ie, they may think that Scala and Scala CLI are the same things, although they are not exactly the same).
- on the other hand, with separate versioning, beginners may perceive some unnecessary complexity (“why do I need a tool besides the compiler itself?”). Also, if Scala CLI gets installed via a package named
scala
(as incs install scala
orbrew install scala
), it has to use a version that is higher than the current version of the existingscala
packages (someone suggested using a version prefixed by the year, like 2023.1.0.0).