Skip to content

More words and explain -release #2364

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

Merged
merged 3 commits into from
Aug 2, 2022
Merged

More words and explain -release #2364

merged 3 commits into from
Aug 2, 2022

Conversation

som-snytt
Copy link
Contributor

Fixes #2308

Copy link
Contributor

@bjornregnell bjornregnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but you may want to include my suggestions (esp. the error on PathResolver that does not seem to work for Scala 3 should be addressed somehow, if it is not just me who is getting "Ignoring spurious arguments:" )

Nowadays, most people are not running `scalac` from the command line.
Instead, they use sbt, an IDE, and other tools as their interface to the compiler.
Therefore they may not even have `scalac` installed, and won't think to do `man scalac`.
The Scala command `scala`, which runs scripts or compiled code, accepts the compiler options plus a few more that determine how to run a program.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps change the compiler options to all compiler options ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or most compiler options if not exactly all are accepted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the same options as the scalac compiler", where "the compiler options" meant "options to the compiler".

Default paths can be listed by running a command line tool:
`scalac -d /tmp`

Default paths can be listed by running a tool in the distribution:
```
scala scala.tools.util.PathResolver [ <options> ]
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work for me:

$ scala scala.tools.util.PathResolver
Ignoring spurious arguments: scala.tools.util.PathResolver
Welcome to Scala 3.1.3 (17.0.3, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                               
scala> 

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I doing something wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's scala 2, scala.tools vs dotty.tools. Worth mentioning.

"-deprecation",
"-unchecked",
"-encoding", "utf8", // if an option takes an arg, supply it on the same line
"-feature", // put the next option on a new line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newline is just for readability and not illegal? Perhaps change the comment then to:
// for better readability, put the next option on a new line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it improves writability, so I said something like that. Autocorrect says "irritability", which is closer to the truth.

@som-snytt
Copy link
Contributor Author

Thanks @bjornregnell

@julienrf julienrf merged commit a74e720 into scala:main Aug 2, 2022
@som-snytt som-snytt deleted the issue/2308 branch August 2, 2022 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explain why to use -target -release etc
3 participants