On making the Scala REPL less confusing

71 views
Skip to first unread message

Raphael Bosshard

unread,
Nov 3, 2016, 10:57:38 AM11/3/16
to scala-internals
Hi all,

triggered by a discussion on Gitter I earlier wrote to scala-language about how confusing the REPL output sometimes is. During the following discussions on scala-language and Gitter it was established that the format of the REPL (definition) outputs should not be treated via separate PRs but as one PR.

So, there you have it: https://issues.scala-lang.org/browse/SI-10024

For me the question is: what is the consistent, beginner-friendly, not-confusing format for REPL definition outputs I may implement for you?

Happy coding,
Raphael

som-snytt

unread,
Nov 5, 2016, 2:00:56 AM11/5/16
to scala-internals
I don't know the answer, but I suspect it's not one-size-fits-all.

Some "modes of operation" might be clearly defined, such as: output is Scala text, or terse output as currently. In former mode, "strings", latterly, "strings".toString without quotes.

I've often wanted a verbose beginner mode, with something like scala-clippy enabled.

I think the REPL should enable various interactions with the language: evaluating exprs, of course, but also making it easy to inspect byte code and detect how syntax is desugared or how certain constructs are compiled (lambdas, singletons, lazy vals, etc).

The workflow is obviously different for a newbie and a power user. Speaking of which, current "power mode" is probably underused. So the interface should invite users to explore increasingly powerful features of both the REPL and the language.

A useful exercise would be to do this for spark-shell users.
Reply all
Reply to author
Forward
0 new messages