RFC: Let's stop wasting the time of people who want to learn Scala?

600 views
Skip to first unread message

Simon Ochsenreither

unread,
Apr 14, 2016, 10:22:20 PM4/14/16
to scala-debate
Hi,

currently, people learning to program have to
  • download the JDK
  • install the JDK
  • setup $JAVA_HOME
  • download the Scala distribution
  • figure out that this is not what they want
  • download SBT
  • create a shell script/unzip SBT
  • put sbt on their $PATH
  • run sbt

before they are even compiling their first application.


Can we think about how we can get rid of all these steps and migrate to something that just works?


I wrote a short native application that does all of that in less than a minute while requiring zero interaction from the user: (time is with an existing ivy cache, not first-SBT-startup-time)

$ time ../sbs/target/debug/sbs XDG: "/home/soc/.cache/sbs/"
source url: "https://cdn.azul.com/zulu/bin/zulu8.13.0.5-jdk8.0.72-linux_x64.tar.gz"
target path: "openjdk-zulu/zulu8.13.0.5-jdk8.0.72-linux_x64.tar.gz"
source url: "https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.11/sbt-launch.jar"
target path: "sbt-launcher/0.13.11/sbt-launch.jar"
...
[info] Set current project to threetenbp (in build file:/home/soc/Entwicklung/threetenbp/)
threetenbpRoot>
$ ../sbs/target/debug/sbs 4,00s user 0,54s system 26% cpu 17,186 total


Comments, opinions?

Thanks!

Bye,

Simon

Vlad Patryshev

unread,
Apr 14, 2016, 10:49:44 PM4/14/16
to Simon Ochsenreither, scala-debate
let me test it on my coworkers

Anyway, Kudos! - as they were saying in the XXth century.

Thanks,
-Vlad

--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Simon Ochsenreither

unread,
Apr 14, 2016, 11:01:06 PM4/14/16
to scala-debate, [email protected]
Rob just recommended naming sbs "scala" ... that probably makes sense. :-)

Paul Hudson

unread,
Apr 14, 2016, 11:02:47 PM4/14/16
to Simon Ochsenreither, scala-debate
I just install the scala-ide and I'm away... (but mostly I write toy applications)

--

Simon Ochsenreither

unread,
Apr 15, 2016, 6:41:48 AM4/15/16
to scala-debate
Rough overview from the source code:

/*
  WHAT IS SUPPOSED TO HAPPEN:

  0. Copy this binary to $HOME/bin/.
  1. Figure out which versions we want:
      Java version – use the following precedence:
      - Use commandline argument (TODO)
      - Read from build.properties (TODO)
      - Query current stable version available from Azul (TODO)
      - Use hard-coded version
      SBT launcher version – use the following precedence:
      - Use commandline argument (TODO)
      - Query current stable version available from repository (TODO)
      - Use hard-coded version
      SBT version: (TODO)
      The SBT launcher deals with that, but if a "bootstrap SBT file" becomes available in the future:
       - Read from build.properties (TODO)
       - Use hard-coded version (in sbt-launcher) (TODO)
  2. Figure out whether we have the requested versions available locally, otherwise download and extract:
      OpenJDK:
      - Does the directory exist? (TODO)
        yes -> nothing to do
        no  -> Do we have a complete zip archive? (TODO)
               yes -> extract it
               no  -> download and extract it
      SBT launcher:
      - Does the jar file exist?
        yes -> nothing to do
        no  -> download it
      SBT: (TODO)
      The SBT launcher deals with that, but if a "bootstrap SBT file" becomes available in the future:
      - Download SBT bootstrap file
      - Extract it to the place SBT expects it
  3, Run SBT using the requested JDK and SBT launcher version.

  OPTIONS WHICH MIGHT MAKE SENSE:
  - offline:          Try to build/run without internet access (TODO)
  - local-jdk=<path>: Try to use a locally installed JDK       (TODO)
 */

Eric Richardson

unread,
Jun 11, 2016, 1:42:48 AM6/11/16
to scala-debate
Hi Simon,

Have you considered just using sbt as the entry point for Scala? I talked to several people about this at Scala Days NY this year but the response was lukewarm at best. What it takes just to create a project in Scala IDE and get it running is just crazy. We have so many entry points: activator, sbt, scala, ScalaIDE, IntelliJ, etc. Plus like you say this all runs on a JVM/JDK which is very complicated for people without Java or other JVM language experience. If you conclude that sbt is the default build tool then to do anything significant you need it anyway.

With this model.
1. Install sbt
2. All other alternatives and downloads are driven from sbt.
3. If we have configurations then maybe end users can customize what components they want by default.

Eric

Craig Tataryn

unread,
Jun 11, 2016, 1:53:04 AM6/11/16
to Eric Richardson, scala-debate
But SBT has its drawbacks in that it's extremely confusing to most. You have to read SBT in Action to really get a good grasp of it. More times then not this is the sentiment towards sbt:


But it sounds like the Scala folk want to do something about it though a GSoC:

A next generation Scala build tool
This project is about extending and contributing to the implementation of a vision that only exist in partial, unreleased prototypes right now. The idea is to build a tool for a intuitive, easy to use, composable, statically checked builds that is used like an ordinary Scala library with no surprises. Several pieces of the puzzle exist as prototypes, but need improvement and many other pieces are entirely missing. In particular this GSOC project could be about building an interface to interoperate with SBT builds and SBT plugins, using them as components in new style builds. Other features yet to be built include publishing artifacts, signing them using GPG, packaging and many more. The exact tasks will depend on the state of the project at the time GSOC applications happen. It will be a chance to work on tooling and contribute to something that has a chance to maybe some day change something fundamental in the Scala eco system --.http://scala-lang.org/gsoc/2016.html

Craig





--

Serge

unread,
Jun 11, 2016, 7:42:21 AM6/11/16
I think, that Scala folk should contribute to the existing gradle plugin
for Scala, which is ideal to build scala projects.

On 11.06.2016 01:52, Craig Tataryn wrote:
> But SBT has its drawbacks in that it's extremely confusing to most.
> You have to read SBT in Action to really get a good grasp of it. More
> times then not this is the sentiment towards sbt:
>
> https://www.reddit.com/r/scala/comments/473imk/its_absurd_that_sbt_has_simple_in_its_name/
>
> But it sounds like the Scala folk want to do something about it though
> a GSoC:
> ...

Craig Tataryn

unread,
Jun 11, 2016, 7:47:52 AM6/11/16
That'll never happen because of a need for dog-fooding, but I completely support that.

Craig





>
> But it sounds like the Scala folk want to do something about it though 
> a GSoC:
> ...

-- 
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Donald McLean

unread,
Jun 11, 2016, 4:28:32 PM6/11/16
to scala-debate
Installing the JDK is something you'll never get away from.

Otherwise, for most people, an IDE is your friend. Choice of IDE is very personal - I can't stand Eclipse in any form, but I love JetBrains IDEA.
--
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Simon Ochsenreither

unread,
Jun 12, 2016, 10:57:41 PM6/12/16
to scala-debate
Hi Eric,


> Have you considered just using sbt as the entry point for Scala?
using sbt won't address the issue of requiring/downloading/installing/managing JDK installs. Without a preexisting JDK install, sbt won't even run.


> I talked to several people about this at Scala Days NY this year but the response was lukewarm at best.
Yes, if more people cared we wouldn't be in this sad state. :-/
But we should also consider it survivor bias: Those who use Scala managed to struggle through the setup ... those who didn't manage to do it cannot be met at a Scala conference.

Bye,

Simon

Eric Richardson

unread,
Jun 13, 2016, 7:23:22 PM6/13/16
to scala-debate
Hi Simon,

Yes, I was forgetting the JVM.

I would like to see the entry to Scala a bit easier as it is a nice language and it would be great if more people used Scala.

Your idea is great for sure because easier is better.

Eric

PUB Razvan Cojocaru

unread,
Nov 9, 2016, 9:31:15 PM11/9/16
to Eric Richardson, scala-debate
or… just… http://www.tryscala.com/

… it is old, but with this approach, you could start learning instantly...



Reply all
Reply to author
Forward
0 new messages