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

REPL: display the compiler + Java version on startup #13193

Merged

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Jul 28, 2021

before:

scala>                                                                                                                  

after:

Welcome to Scala 3.0.3-RC1-bin-SNAPSHOT-nonbootstrapped-git-2b1b622 (1.8.0_292, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                      
scala> 

which brings 3 in line with Scala 2:

Welcome to Scala 2.13.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_292).
Type in expressions for evaluation. Or try :help.

scala> 

@SethTisue
Copy link
Member

apologies to @som-snytt for not festooning this with configuration knobs and levers

@som-snytt
Copy link
Contributor

I will say that trimming the message was one of my early contributions, IIRC. There was back and forth about what to say in one line that is beginner friendly but not annoying. Now we need Seth's other favorite feature, the prompt with version string.

@SethTisue
Copy link
Member

Now we need Seth's other favorite feature, the prompt with version string.

😋

Co-authored-by: Seth Tisue <seth@tisue.net>
@dwijnand dwijnand force-pushed the display-compiler-version-in-repl branch from 7db844f to 2b1b622 Compare July 29, 2021 20:26
@SethTisue
Copy link
Member

in case anyone doubts the value of having a banner and including this information:

first, I think it's crucial for beginners to tell them about :help, otherwise the discoverability of all the colon commands is zero

second, about showing the Scala version and JDK version, one could also imagine having an :info command (or some such) to show it, rather than displaying it every time

but by the time a user thinks to run something like :info it's too late. if the time ever even comes, most of the time it won't come. meanwhile they're running the wrong Scala version or the wrong JDK version and don't even realize it, and don't have a reason to check it with :info. or to go through the two-stage process of first trying :help to even find out about :info in the first place... a user won't normally invoke :help without a reason

then maybe they're filing a bug report or asking for help on Gitter, and do they think to tell us what their Scala and JDK versions are? maybe, but if it's right there in the REPL banner it's a lot likelier they'll do that

having it in the banner reminds people that hey, Scala isn't just Scala, it often matters which version you have and what JDK you're running it on

and although we certainly don't want creeping banner bloat, I feel like the Scala 2 style banner is sufficiently brief as not to waste space or be annoying

I may be a bit biased because I happen to be answer-questions-on-Gitter guy and I'm also triage-people's-bug-reports guy :-)

@ekrich
Copy link
Contributor

ekrich commented Aug 3, 2021

I do think adding a :info as well would be a good idea. This way you could check if the repl has been open a long time.

@dwijnand dwijnand assigned anatoliykmetyuk and unassigned dwijnand Aug 3, 2021
@anatoliykmetyuk anatoliykmetyuk merged commit 8b2afe5 into scala:master Aug 5, 2021
@dwijnand dwijnand deleted the display-compiler-version-in-repl branch August 5, 2021 14:25
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
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.

6 participants