Description
Similar to #12647 and again referencing lampepfl/dotty-feature-requests#131 as an umbrella of REPL parity and whether any of it is regression vs. enhancement.
While -i
is mostly an interactive usage nice-to-have, -e
may be more impactful in breaking scripts in the wild.
I've raised this independently also to ask/determine "policy" of command line interface breakage in general, and how distribution packagers treat executable names.
The official foremost recommended installation method for Scala 3 presently is Coursier—resulting in new executables of scala3-repl
and scala3-compiler
—but distribution packagers are unlikely to use that approach. The official dotty Homebrew formula maintains the scala
and scalac
executables. I believe many distribution channels are doing the same. So, it's fair to say CLI breakage is a material consideration.
Side note: the REPL- and script runner-specific scala -help
output in Scala 2 is a nicer experience IMO than Scala 3 echoing exactly the compiler usage. I'm not sure there are any REPL-specific options at this point, so filing an enhancement for this might not make sense, yet? It would be nice to summarize how script running works like the old help did, perhaps it's not appropriate to call it "script running" if synthesizing a main method etc. is no longer a feature, but the convenience of on-the-fly compiling a given source file remains.
Also, scalac -script
is undocumented in -help
.
Compiler version
3.0.0
Minimized code
$ /usr/local/Cellar/dotty/3.0.0/bin/scala -e 'println("Hello, world!")'
Output
/usr/local/Cellar/dotty/3.0.0/bin/scala: eval: line 162: syntax error near unexpected token `('
(Missing feature aside, this seems like less than ideal option handling in the wrapper shell script, versus):
$ /usr/local/Cellar/dotty/3.0.0/bin/scala -e 'println'
Unrecognized option: -e
Expectation
$ /usr/local/Cellar/scala/2.13.6/bin/scala -e 'println("Hello, world!")'
Hello, world!