Skip to content
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

Consider making Scala CLI backwards compatible with current scala commands #1310

Closed
romanowski opened this issue Aug 30, 2022 · 4 comments
Closed
Assignees
Labels
SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.
Projects

Comments

@romanowski
Copy link
Member

A list of incompatible options that makes a lot of sense:

  • -classpath does not work even if prefixed with -O (how to pass agrs in such case?)
  • -d conflicts with Scala CLI dependencies - do we really need to emit classes from REPL?
  • -color - we have it on by default if I am not mistaken
  • -encoding
  • -explain, -explain-types (-explaintypes from Scala 2)
  • -feature
  • -help - conflicts with our help
  • -language (-language:<features> from Scala 2)
  • -nowarn
  • -print-lines
  • -release (-target from Scala 2)
  • -source
  • -sourcepath and -sourceroot (-rootdir from Scala 2) but I have mixed feeling about those
  • -unchecked
  • @<file> - provide a file with arguments and options

A list of options that I can see some usage but proabaly are not critical (so we can just fallback to require -O prefix)

  • -old-syntax
  • -new-syntax
  • -no-indent
  • -from-tasty
  • -javabootclasspath, -bootclasspath (-nobootcp and -toolcp from Scala 2)- not sure if we can support both
  • -scalajs, -scalajs-genStaticForwardersForNonTopLevelObjects, -scalajs-mapSourceURI - I was under impression that REPL does not support Scala JS but even if so I think --js and related flags has superior UX
  • -uniqid, -verbose - debugging REPL is instead for powerusers and I think we can expect them to prefix these options with -O
  • -dependencyfile - not supported in Scala 3
  • -no-specialization- not supported in Scala 3
  • -opt:<optimizations>, -opt-inline-from:<patterns>, -opt-warnings:<warnings> - not supported in Scala 3
  • -print - not supported in Scala 3
  • -usemanifestcp - not supported in Scala 3

A list of options that I do not see a use case in REPL:

  • -indent - do not print indent based version of the provided code also when running
  • -print-tasty - do not print TASTY from provided code
  • -project-url
  • -rewrite - no effect also when running code from file
  • -semanticdb-target - does not seem to have any effect

A list of options I have no idea what they do:

  • -extdirs
  • -javaextdirs
@romanowski romanowski added the SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command. label Aug 30, 2022
@Gedochao Gedochao self-assigned this Sep 1, 2022
@Gedochao Gedochao added this to In progress in Issue Board Sep 1, 2022
@Gedochao
Copy link
Contributor

Gedochao commented Sep 1, 2022

relevant: #1313

@julienrf
Copy link
Contributor

julienrf commented Sep 1, 2022

Thank you for going over the list :) There is one thing that I am not sure to understand: you assessed the relevance of every option in the context of the REPL, but I think these options in the old scala command were also active when running a program, not just in the REPL mode?

@romanowski romanowski changed the title Make Scala CLI backwards compatible with current scala commands Consider making Scala CLI backwards compatible with current scala commands Sep 1, 2022
@romanowski
Copy link
Member Author

I tried to assest them also in the contested of running the program and in many cases I was surprised that given option has no effect (e.g. -print-tasty).

Also, I changed the issue a bit to consider what should be added and not to just add 100% of the options listed (even from the main category).

@Gedochao
Copy link
Contributor

Gedochao commented Nov 2, 2022

This has mostly been addressed already, so I'm closing the ticket.
Most popular scalac options which make sense in the context of scala-cli are already available without -O.
Aliases have been added where clashes with native scala-cli options happened.
Documentation has been added in #1503
Other relevant PRs: #1501, #1413, #1369, #1340, #1313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.
Projects
Development

No branches or pull requests

3 participants