aboutsummaryrefslogtreecommitdiff
path: root/src/dotty
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-16 08:53:41 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-17 18:39:48 +0100
commit784864d34413f8f42385b1a1c980d65dcbd0052b (patch)
tree16b0912ac1ee82422857e57120afcf7bd46277a3 /src/dotty
parentae5bccd3d4a9e52aec93088a39fd0d6b658306ba (diff)
downloaddotty-784864d34413f8f42385b1a1c980d65dcbd0052b.tar.gz
dotty-784864d34413f8f42385b1a1c980d65dcbd0052b.tar.bz2
dotty-784864d34413f8f42385b1a1c980d65dcbd0052b.zip
Warm up interpreter during first prompt.
Diffstat (limited to 'src/dotty')
-rw-r--r--src/dotty/tools/dotc/repl/InterpreterLoop.scala9
-rw-r--r--src/dotty/tools/dotc/repl/Main.scala1
2 files changed, 4 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/repl/InterpreterLoop.scala b/src/dotty/tools/dotc/repl/InterpreterLoop.scala
index 8cc4d0927..cc5dda947 100644
--- a/src/dotty/tools/dotc/repl/InterpreterLoop.scala
+++ b/src/dotty/tools/dotc/repl/InterpreterLoop.scala
@@ -73,14 +73,13 @@ class InterpreterLoop(
val version = ".next (pre-alpha)"
/** The first interpreted command always takes a couple of seconds
- * due to classloading. To bridge the gap, wait until the welcome message
- * has been printed before calling bindSettings. That way,
- * the user can read the welcome message while this
- * command executes.
+ * due to classloading. To bridge the gap, we warm up the interpreter
+ * by letting it interpret a dummy line while waiting for the first
+ * line of input to be entered.
*/
def firstLine(): String = {
val futLine = Future(in.readLine(prompt))
- // bindSettings() // TODO adapt to dotty and re-enable (?)
+ interpreter.beQuietDuring(interpreter.interpret("val __$__ = 1 + 1"))
Await.result(futLine, Duration.Inf)
}
diff --git a/src/dotty/tools/dotc/repl/Main.scala b/src/dotty/tools/dotc/repl/Main.scala
index e286be116..b2b92299e 100644
--- a/src/dotty/tools/dotc/repl/Main.scala
+++ b/src/dotty/tools/dotc/repl/Main.scala
@@ -17,7 +17,6 @@ package repl
* - figure out why we can launch REPL only with `java`, not with `scala`.
* - make a doti command (urgent, easy)
* - create or port REPL tests (urgent, intermediate)
- * - make interpreter run a pseudo line on startup to pre-load compiler (somewhat urgent, easy)
* - copy improvements of current Scala REPL wrt to this version
* (somewhat urgent, intermediate)
* - re-enable bindSettings (not urgent, easy, see TODO in InterpreterLoop.scala)