4 ms·
Or even better than using libraries for functional programming in Java, learn and use Scala. You can mix Scala and Java code where needed.
by moondowner 16y ago
Or even better than using libraries for functional programming in Java, learn and use Scala. You can mix Scala and Java code where needed.
- srean 16y agoOr Clojure for that matter.
- sandGorgon 16y agoscala != functional programming http://enfranchisedmind.com/blog/posts/scala-not-functional/ http://enfranchisedmind.com/blog/posts/scala-not-functional/ It does have functional programming constructs though Clojure is a much better candidate for FP on the JVM.
- srean 16y agoYou are right. But scala does not make it any harder if one chooses to write functional code.
- gtani 16y agohttp://enfranchisedmind.com/blog/posts/what-is-a-functional-programming-language/ http://enfranchisedmind.com/blog/posts/what-is-a-functional-... Note: NOT written by same guy who did "Scala not Functional". Everybody has a different definition of FP in mind with these, uh, parameters: - "no hidden side effects"; clearly demarcated IO functions, database calls. - curry, partial function application; lexical closures - TCO - 1st class, higher-order functions - Immutable / persistent collections / data structures Altho most people agree that these are orthogonal to the definition of FP, (but nice to have: - type inference (ML's is variously referred to as Damas-Milner or Hindley-Milner) or static typing - lazy eval - pattern matching - green/lightweight threads with message passing OR STM/MVCC - monads,arrows, functors, CPS http://stackoverflow.com/questions/485418/distinctive-traits-of-the-functional-languages http://stackoverflow.com/questions/485418/distinctive-traits... http://stackoverflow.com/questions/1112773/what-are-the-core-concepts-in-functional-programming http://stackoverflow.com/questions/1112773/what-are-the-core...
- gtani 16y agois scala FP? Usually FP languages are : - lisps and schemes: CL, racket, - the ML/erlang/haskell axis incl ocaml, - spoken of in reverent tones: dylan, clean, mozart/oz - the JVM/CLR languages: clojure, F#, scala, groovy, jruby
- moondowner 16y agoWell you have the answer: "- the JVM/CLR languages: clojure, F#, scala, groovy, jruby" Yes, it is, it's and OO and FP.
- sp4rki 16y agoI second Clojure for a functional programming language on the JVM. Why anyone would want to do functional programming in Java is really beyond my comprehension though.
- moondowner 16y agoScala is and object oriented and functional. People don't count it in the functional languages listings because it's not a pure functional language, that's all. Here's a nice 108 page presentation, named Pragmatic Real-World Scala. http://www.slideshare.net/rawwell/pragmaticrealworldscalajfokus200912332510764413842pdf-1898530 http://www.slideshare.net/rawwell/pragmaticrealworldscalajfo...