News for hackers. Stuff that matters.
Re:Which Programming Languages Are Functional? by bad_user on Wednesday December 30, 2015 @10:57AM (#10812530)
I've tried working in an FP style in the "multiparadigm" languages you've mentioned, but it's hard, really hard. Well actually, the irony is that JavaScript is the one that's bearable and that's because (1) you can find some Javascript libraries that are doing FP and (2) it's very flexible.

Static languages such as Java and C# are not OK though. For one they lack features that are essential for statically typed languages. For example higher kinded types is an essential feature for FP. Without that you can't build libraries of reusable FP stuff. Comparing it with Scala for example you can't build Scalaz or the newer Cats or Shapeless [1].

The other problem is that FP programming languages come with FP libraries. You can't underestimate the importance of having good implementations for persistent collections be the default.

On having "no side effects", that's not what FP is about. After all, without side-effects you couldn't get any output out of a program. FP is about encoding those side-effects in types and abstractions you can reason about, or in other words it's about controlling side-effects. Haskell developers are fond of their IO monads. FRP is another way of doing that, being particularly good at dealing with user interfaces. And for example FRP-related libraries that were born by playing to the strengths of the mainstream languages we are dealing with are Facebook's React and Microsoft's Rx.

BTW, this is one of the best books on functional programming available today: http://www.manning.com/bjarnason/

[1] https://github.com/scalaz/scalaz, https://github.com/non/cats, https://github.com/milessabin/shapeless

Re:Which Programming Languages Are Functional? by cygx on Wednesday December 30, 2015 @11:08AM (#10812591)
I beg to somewhat differ: As far as purely functional languages go, it is about reification of side effects (eg via monads or uniqueness types) in such a way that you do get to use pure functions.

My personal definition of 'functional' is based on this lack of side-effects (or, more abstractly, on modelling computation as a declaration of relations between sets, which is what mathematical functions are), but it gets fuzzy once you leave the realm of purely functional languages.

If you prefer another definition for pragmatic reasons, I'm fine with it, it's just not my choice.

Re:Which Programming Languages Are Functional? by AdieuToLogic on Wednesday December 30, 2015 @06:26PM (#10815090)
+1 for referencing the "Functional Programming in Scala" book. It is, as you rightly state, one of the best books out there regarding FP concepts and written in a very approachable style IMHO.
Re:Which Programming Languages Are Functional? by felixgallo on Wednesday December 30, 2015 @12:39PM (#10813176)
While HKT are pretty neat, they're hardly essential, and to claim that without them you literally can't build reusable FP libraries is ridiculous.
Re:Which Programming Languages Are Functional? by tome on Wednesday December 30, 2015 @02:20PM (#10813752)
Perhaps it's more accurate to say there are well-known, pervasive, use cases that are not possible without HKTs.