News for hackers. Stuff that matters.
Re:Brand new Scala-lang.org by cgag on Tuesday July 30, 2013 @04:11PM (#6129679)
I just think that dual goal is messy and not really a good goal. Can anyone comment on how possible it is to just ignore any OO stuff in Scala and just treat it like a normal statically typed functional language that happens to be on the JVM?
Re:Brand new Scala-lang.org by ericssmith on Tuesday July 30, 2013 @08:13PM (#6131014)
It's quite possible, up to a point. In fact, there is a new book "Functional Programming in Scala" that shows precisely how to do that. However, Scala is a fusion of OO and FP. Even its functional features are written in terms of objects. What you don't particularly need is mutable objects. But Scala's OO features -- notably traits -- are arguably useful for structuring code.

As the language designer himself has said: Scala is not a better Java, it is not Haskell on the JVM. I would add that it isn't just SML on the JVM either. It is much better, in my opinion, to embrace Scala for what it is, a powerful, expressive, pragmatic language for industrial use.

Re:Brand new Scala-lang.org by pohl on Tuesday July 30, 2013 @04:25PM (#6129789)
Why wouldn't you be able to? That's sort of what they're getting at when they say (if you follow the link) right under the headline: "Or anything in-between."

Your discriminated unions would be "in drag" as case classes, of course. You would want to be aware of the OO parts of the language, but there's little that obligates you to use them.

Re:Brand new Scala-lang.org by cgag on Tuesday July 30, 2013 @04:59PM (#6130000)
I'm not sure, I haven't looked very deeply at the language, I'm not sure if most of the libraries and culture and such make use of OO, or if it's just baggage for Java interop.
Re:Brand new Scala-lang.org by kasey_junk on Tuesday July 30, 2013 @04:26PM (#6129793)
Quite easy with a couple of caveats: 1. You don't care about working with java libraries. 2. You don't care about generating tons of memory overhead.

Personally, if you don't have dependencies on java and if your goal is to do a pure functional application, I would stay away from the JVM as it just wasn't built for it.

Re:Brand new Scala-lang.org by cgag on Tuesday July 30, 2013 @05:07PM (#6130050)
I haven't had any trouble doing mostly pure FP with Clojure, as the general pattern is to wrap Java libraries to present a functional interface, I guess I'm curious if this is the attitude in Scala, or if you're sort of forced to embrace OO.