News for hackers. Stuff that matters.
Re:A Year Of Scala by Homunculiheaded on Sunday December 26, 2010 @03:26PM (#2041118)
As someone who has spend a fair amount of time with Haskell, Scheme, Common Lisp etc, can someone give me some insight into what's really exciting about Scala? There seem to be a lot of people I respect using it, but most of the articles I've read are of the form "coming from Java, Scala is awesome!" which I haven't found particularly enticing. Every time I look at examples I don't really see anything that sticks out as particularly interesting. I really want to get excited about Scala, and would really appreciate any insight that would help me with this.
Re:A Year Of Scala by z0r on Sunday December 26, 2010 @04:00PM (#2041162)
Just the pleasures of a powerful type system, inference, pattern matching, higher order functions... The usual good stuff, but on the JVM. I was paid to learn and program in it for a good five months earlier this year (everything ended up getting ported to python later...) and yes, it basically boils down to "coming from Java, Scala is awesome". If you have to build on top of the JVM and the Java ecosystem of libraries, it is a fine choice.
Re:A Year Of Scala by krosaen on Sunday December 26, 2010 @05:03PM (#2041250)
Which do you prefer? Python or Scala?
Re:A Year Of Scala by z0r on Sunday December 26, 2010 @05:26PM (#2041287)
I enjoyed writing Scala more than I enjoy writing Python, but there are a few undeniable advantages that Python holds over Scala. The motivation to port from Scala to Python was to avoid the lengthy build process that had been slowing down development to a crawl. There may have been other ways to alleviate this, but by the time the port was completed, it took a good 15 - 20 minutes to get the build machine to compile and package the entire project so it could be deployed to production. At this time rapid fixes were critical.

Also, the team as a whole prefers Python to Scala... I took pleasure in learning how to express my code in increasingly functional and compact ways, but my coworkers found struggling with the type system to be too much of a headache. In particular, there are rough edges when you are integrating Scala code with Scala types and data structures with Java code with Java types and data structures. In any case it will be easier to find programmers who write in Python than those who might write Scala.

Scala gave me more personal pleasure to write in, but Python isn't bad either. I miss the type system and the many classes of errors it could help prevent at compile time, but I appreciate being able to change Python code and put it to the test immediately. The loss of expressiveness is probably made up in part by being forced to write code that is more easily read. I still hope I will be able to find a job writing in a functional language in the future...

Re:A Year Of Scala by narrator on Sunday December 26, 2010 @08:16PM (#2041538)
JRebel lets you change a running Scala program without having to restart the appserver and integrates well with IDEs. I find it's easily worth its price in the amount of productivity it adds when doing Scala web development.
Re:A Year Of Scala by runT1ME on Monday December 27, 2010 @03:38PM (#2043588)
Great response. How many LOC was your project that you got that amount of slowdown? Would you say it was the primary reason even over some developers struggling with the type system?

I'm a huge Scala fan but even after a year of hobby programming here and there I feel like a beginner...

Re:A Year Of Scala by z0r on Monday December 27, 2010 @09:25PM (#2044374)
I could pull up the LOC, but it honestly wasn't the Scala compilation that was the true issue. The true issue was that the project was built with maven and it had a tremendously large number of dependencies. If all the Scala in the project had been converted to Java, the build still would have been monstrously slow. So the port was more of an escape from the JVM than an escape from Scala - and yes, the build times were the primary reason for the port. As for the type system... not a single other person left on the team misses Scala but me. (The primary Scala evangelist had been let go for unrelated reasons)
Re:A Year Of Scala by sorenbs on Sunday December 26, 2010 @03:36PM (#2041132)
Being able to do all your cool stuff in the usually boring enterprise world is the interesting part. If you don't need to integrate with container dit or java product dat there is no real need for scala.
Re:A Year Of Scala by harryh on Sunday December 26, 2010 @08:40PM (#2041575)
It's all the interesting stuff that you get with Haskell/Scheme/Lips/etc combined with the practicality of running on the JVM with easy Java integration. Practicality being the key word.
Re:A Year Of Scala by technomancy on Sunday December 26, 2010 @11:51PM (#2041856)
That description actually sounds a lot more like Clojure to me.
Re:A Year Of Scala by harryh on Monday December 27, 2010 @11:17AM (#2042807)
Well with Clojure you get something that's more Lispy. With scala you get basically a mashup of Java + ML.
Re:A Year Of Scala by runT1ME on Monday December 27, 2010 @03:32PM (#2043573)
I don't think Clojure has much at all to do with Haskell other than the pure functional aspect. One is a dynamic lispy language, the other has a very rigid type system (note I said rigid, not cumbersome) that's pretty much the antithesis of a lisp...
Re:A Year Of Scala by technomancy on Tuesday December 28, 2010 @05:17PM (#2047044)
Clojure's STM is based pretty heavily on Haskell's.
Re:A Year Of Scala by runT1ME on Tuesday December 28, 2010 @08:08PM (#2047545)
Yes, they're both pure functional so you need an STM to do anything...
Re:A Year Of Scala by technomancy on Wednesday December 29, 2010 @04:34PM (#2050242)
I can't tell if this is a troll or just a misunderstanding, but it's wrong on two counts: Clojure is not purely functional, and side-effects are done more often with monads than STM in Haskell.
Re:A Year Of Scala by runT1ME on Wednesday December 29, 2010 @08:28PM (#2050841)
are you sure I have the misunderstanding? Which Monad do you think people use for side effects in haskell? Do you think STM in Haskell is not handled by the STM monad?