0

I like the idea of using Scala as a scripting language (https://www.scala-sbt.org/1.x/docs/Scripts.html). However, it always takes a long time even for a simplest Hello World script to run, presumably because sbt is recompiling the script every time.

Is there a way to instruct sbt to save the compilation results, in case the script hasn't changed since the last compilation?

2
  • 1
    I think you cannot avoid recompilation fully, but you can use ammonite instead of vanilla scala REPL. Surely things you put into predef would get cached. Commented Apr 21, 2020 at 12:03
  • @MateuszKubuszok Thanks, looks like ammonite is exactly what I was looking for :) Never heard of it before, will definitely give it a try! Commented Apr 21, 2020 at 13:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.