Going back to the original argument made by Robert, I believe you mean that Scala is not a *purely* functional language, with which I would agree. Any language can be somewhat functional, in other words you can write in it using a functional style. Even Java, where things like the builder pattern enabling immutable instances post construction, and Google collections library and Fork Join with their predicates and function definitions, can lend a more functional style to your code.
Fact is, my style has become more functional since I started using Scala, even in Java source. I don't believe I have ever claimed that Scala is a purely functional language (soundbyte please, if I did), but that it certainly introduces more functional facing features into a language should not be in dispute. On the contrary, I am interested in Scala because I find it one of the most pragmatic mixin languages out there right now - you get static typing that is stronger than even Java, but without many of the down sides because of clever type inference in the compiler. You get better Object Orientation than Java, with concepts like traits and (yes, Joe will argue with me here) properties in the language or libraries, and on top of that you get better support for immutability and other functional features. I also believe Scala is a great choice for scientists and mathematicians. Most of the ones I know still use Fortran, and there's not much pure-functional about Fortran. F# is a problem cos I don't do windows. Also, I have mentioned in the show before that I have messed with purely functional languages (most notably Miranda) in the past and found that their super-strict functional style didn't sit well with my own programming approach. Scala is the first language that offers this level of functional features that I have been comfortable with and really look forward to using. Sometimes I use it in a functional way, sometimes I fall back into OO where it makes sense - it's my choice and I love having that choice. I will take a look at OCaml as well, but that brings me to the other huge advantage of Scala - I can re-use all of my skills and experience with the Java SE libraries and the wealth of Java frameworks out there. Scala even abstracts away many of the rough edges in commonly used libraries with simple wrapping techniques, meaning that what I end up with is the same libraries I already know, but in many cases they are better than the original. Running on the JVM is also a huge benefit, as is compatibility with existing Java code bases (which are a fact of life for me). Anyway - perhaps the takeaway from this is that Scala isn't a purely functional language, but I believe you can be a purely functional programmer and still use Scala effectively. Cay Horstmann demonstrates some of this with his functional programming class at SJSU where he sticks to just the functional parts of Scala (immutable list processing, recursion, etc.) and stays away from the OO. Dick On May 15, 6:36 am, Joshua Marinacci <[email protected]> wrote: > I thought a 'functional language' simply meant that they had > constructs which enforce true strict functions, meaning subroutine > calls which are guaranteed to never have side effects, which take > arguments and return a single value, and can be aggressively optimized > by the compiler/runtime because they are strict functions. > > On May 15, 2009, at 8:27 AM, Gabriel C. wrote: > > > > > About currying, is worth noting that in Haskell, f (x,y) = x + y can't > > be curried (and must be called with parenthesis!!!) and Haskell is as > > functional as you can be... > > (yes, I know, I'm cheating because I'm not defining a function with > > two parameters, is a function with one tuple parameter) > > The point is that having to define f(x:Int)(y:Int) instead f > > (x:Int,y:Int) is not that far from having to define f x y instead of f > > (x,y)... > > (a little more detail > > inhttp://gabrielsw.blogspot.com/2009/02/flavors-of-curry-scala-vs-haske...) > > > Regards > > > On May 14, 8:35 pm, Robert Fischer <[email protected]> > > wrote: > >> If Dick is going to keep going on about how functional and > >> mathematical Scala is, and how that's so > >> great, maybe he should check out OCaml/F#? > > >> I've just posted to my blog about how Scala is *not* a functional > >> language. Which is not to say > >> it's a bad language -- it's just not a functional language. > > >>http://enfranchisedmind.com/blog/posts/scala-not-functional/ > > >> ~~ Robert Fischer. > >> Grails Training http://GroovyMag.com/training > >> Smokejumper Consultinghttp://SmokejumperIT.com > >> Enfranchised Mind Bloghttp://EnfranchisedMind.com/blog > > >> Check out my book, "Grails Persistence with GORM and > >> GSQL"!http://www.smokejumperit.com/redirect.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
