Re:Scala: sharp and gets things cut
by dragonwriter on Monday October 07, 2013 @04:44PM
(#6511126)
> Pet peeve - not sure why "sbt console" insists on compiling class files before launching a repl. I mean, I'm launching a repl since something did screw up, right ?
Presumably, your launching a REPL because something screwed up at runtime, not because something screwed up in compilation. You can't kick the tires of how code runs without compiling it, so...
'sbt console' compiles before it launches a repl because it includes your project's classpath. If you want a Scala repl that doesn't have your project's classpath (and hence doesn't need to compile things) start a repl separately from sbt.
Alternately, use "console-quick", which brings up a console with your dependencies on the classpath, but not your actual code.
As a (lengthy) side-note, that name really bugs me. In sbt, we have console-quick and console-project (brings up a console with your build on the classpath). Argh! These are kinds of consoles. They should be quick-console and project-console! Alas, those are the names that Mark Harrah gave us, so they're the ones we have to live with, I guess.
Re:Scala: sharp and gets things cut
by sandGorgon on Wednesday October 09, 2013 @11:58AM
(#6522064)
whoa... THANK YOU for that!
Sounds like you want
sbt console-quick
http://www.scala-sbt.org/0.12.3/docs/Howto/scala.html#consol...
For my purpose (working with hadoop), it has proved to be more than adequate - I get a repl to work with java classes (serious productivity jump over those who have to work with vanilla java), I dont have to muck about with classnames <> filename mapping.
I come from the JRuby world and I have a secret fetish for Clojure - but the near-Java performance of Scala is impossible to argue against.
My biggest, biggest problem is sbt - it is fairly sucky, since it inherits Maven's Madness. Pet peeve - not sure why "sbt console" insists on compiling class files before launching a repl. I mean, I'm launching a repl since something did screw up, right ?
I think Scala can be much, much simpler and better - especially in compiler error messages and tooling. But it is absolutely amazing as a Java replacement.