4 ms·
There is a lot of focus on haskell vs scala and deep intricate discussions about type systems, but here's a question - how is scala as a better java ? For my p
by sandGorgon 13y ago
There is a lot of focus on haskell vs scala and deep intricate discussions about type systems, but here's a question - how is scala as a better java ?
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.
- eeperson 13y ago'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.
- clhodapp 13y agoAlternately, 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.
- sandGorgon 13y agowhoa... THANK YOU for that!
- koeninger 13y agoSounds like you want sbt console-quick http://www.scala-sbt.org/0.12.3/docs/Howto/scala.html#console-quick http://www.scala-sbt.org/0.12.3/docs/Howto/scala.html#consol...
- dragonwriter 13y ago> 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...