scala-lang icon indicating copy to clipboard operation
scala-lang copied to clipboard

Windows & Scala 3 UX - consistency

Open ScalaWilliam opened this issue 4 years ago • 6 comments
trafficstars

Hi all!

Just noticed Scala 3 is now officially on the scala-lang.org website - that's absolutely fantastic! I would like to share some of my findings from a Windows user's point of view, that could be smoother.

Current UX & Explanation: it could do with more consistency (click to expand)

First, the download instructions on the homepage point to the Coursier & SBT websites. image

You may then choose to do a quick set-up with Coursier, however for Windows users to enter commands like 'bitsadmin', is very unusual; people rarely ever do this on Windows. image (also the Windows instruction here is below the fold so you take a bit of time to find it; I include some examples of how Python and Nodejs do it below).

There is another page, getting started, which instead has a link to the Coursier binary. Windows shows it may be unsafe - is there any way to fix this? image

This could be 'the' installer, and after installing you should get greeted with a message how to proceed. In fact, after running it myself, I was very pleased that everything I needed was installed, which is absolutely fantastic.

Let's look at Python: When you go to the Python website, and try to download, it gives you a .exe, which you then open, image

And then it gives you an installer (I already have it installed). image

Node.js: image

(this one I also have installed 😁 ) image

There could be a segment of the market who might jump off at this point because this is their first point of touch with Scala, especially if coming for example from .NET which has all-inclusive GUI installers and similar.

While many people in the Scala community use Mac we could definitely do better with smoother support for Windows, especially considering inclusivity; many potential members of the Scala community might come from countries where a Mac costs several months of salary, and normally use the OS that came with their PC, Windows; however they might drop off early despite all the amazing efforts done by the Scala community. Python's start-up UX is great and I believe is a huge contributor to its popularity.

My suggestion (click to expand for some HTML)

For Windows users, at the Download page, give only 1 choice, which is the "Scala Installer" (don't confuse them with SBT, and Coursier -- they probably heard of Scala only 5 minutes ago!). If anything, they could also be offered an offline installer with a small link below (which includes all the dependencies). Once the "Scala Installer" (Coursier) installs everything, it opens an HTML page with instructions how to use Scala.

image

HTML (edited rapidly, so 🦅 )
<div class="install-steps">


<div class="download-options">
  <div class="download-left">
    
    <a href="https://git.io/coursier-cli-windows-exe" class="btn-download">
      <i class="fa fa-download"></i>
      <span>Download the Scala installer (.exe, 64-bit)</span>
    </a>
    <div class="text-variant" style="text-align:center">
      <p style="font-style:italic">Do you need an offline installer? <a>Download here (59MB)</a>.</p>
<p>The Scala Installer will install Scala as well as various utilities like SBT, Coursier, scalafmt, the Ammonite REPL, all of which you can use from PowerShell or cmd. <u>Batteries included</u>.</p>
      
    </div>
  </div>
  
</div>
</div>

ScalaWilliam avatar May 25 '21 23:05 ScalaWilliam

See also https://github.com/coursier/coursier/issues/2058 and https://github.com/lampepfl/dotty/issues/12502

bjornregnell avatar Jun 16 '21 17:06 bjornregnell

Any update on this? The main Scala language website does not say how to run a Scala 3 application. Surely this is important.

jacobus avatar Jun 18 '21 20:06 jacobus

@jacobus Agree. @ScalaWilliam Maybe the title of this issue should be broader, as this is not just UX consistency, it's about degradation of functionality from Scala 2. We need a runner on all 3 platforms.

bjornregnell avatar Jun 19 '21 10:06 bjornregnell

See also https://github.com/scala/scala-lang/issues/1250

bjornregnell avatar Jun 19 '21 10:06 bjornregnell

why not just copy the approach kotlin uses:

$ kotlinc hello.kt -include-runtime -d hello.jar
$ java -jar hello.jar
Hello World!

so for scala3 it could be something like this:

$ alias scala3c=scala3-compiler
$ scala3c hello.scala -include-runtime -d hello.jar
$ java -jar hello.jar
Hello World!

or just make -include-runtime the default and add a -exclude-runtime flag instead

$ scala3c hello.scala -d hello.jar
$ java -jar hello.jar
Hello World!

and also a scala3-runner

$ alias scala3c=scala3-compiler
$ scala3c hello.scala
$ scala3 hello
Hello World!

python had a similar issue and was able to solve it by releasing python and python3 cli executables

mrt181 avatar Jul 15 '21 10:07 mrt181

Once scala-cli replaces scala as the default Scala runner, perhaps we could close this.

SethTisue avatar Dec 07 '23 03:12 SethTisue