Scala Shell

Scala Shell (scalash) is a shell for programming in Scala. Scalash is run from the command line and allows the programmer to experiment with code in real time. It allows you to enter Scala commands at the prompt and have the interpreter respond immediately.
A quick summary of the features present:
  • colourized output (highlighting)
  • auto-completion, aka Tab-completion
  • start script support - when an interactive shell is started, Scala Shell reads and executes commands from ~/.scalarc, if that file exists.
  • persistent history (~/.scala_history)
  • command history
  • command load

You can install the current release directly with Scala Bazaar:
sbaz update
sbaz install scalashell-scala

7 comments:

sanity said...

It didn't work, see here

Jonhnny Weslley said...

The jline-<VERSION>.jar file must be in CLASS_PATH env variable. Try:

sbaz install jline

bwanab said...

After installing jline I got:

scala:0> Exception in thread "main" java.lang.ClassNotFoundException: binder0
at scala.tools.nsc.interpreter.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:27)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at scala.tools.nsc.Interpreter.bind(Interpreter.scala:543)
at org.scalashell.scalash.ScalaShell$$anonfun$bindSettings$1.apply(ScalaShell.scala:64)
at org.scalashell.scalash.ScalaShell$$anonfun$bindSettings$1.apply(ScalaShell.scala:61)
at scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:110)
at org.scalashell.scalash.ScalaShell.bindSettings(ScalaShell.scala:61)
at org.scalashell.scalash.ScalaShell.repl(ScalaShell.scala:106)
at org.scalashell.scalash.ScalaShell.run(ScalaShell.scala:183)
at org.scalashell.scalash.Main$.main(Main.scala:54)
at org.scalashell.scalash.Main.main(Main.scala)

Jonhnny Weslley said...

Hi bwanab,
what is the scala and jline versions used?

bwanab said...

scala: 2.7.2.RC2
jline: 0.9.91

Daya Sharma said...

it seems scalashell-scala doesn't behave like 'irb' ruby interactive shell in that the tab completion doesn't work for either method names or class names.

Could you possibly tell me where does tab completion work ? Or what is it that I need to do to make it work.

thanks,
-daya

Jonhnny Weslley said...

Hi Daya Sharma,
The current version doesn't support tab completion for either method names, just for commands. Tab completion for methods is under development.

Post a Comment