aspose file tools*
The moose likes Other Languages and the fly likes Functional programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Functional programming" Watch "Functional programming" New topic
Author

Functional programming

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1871
Many maagzines/articles are saying that day of functional programming has come.After reading such articles I am thinking of learning Haskell(because one book on it is free)!

1)What is the real need for FP? I mean what is that which can not be solved by imperative languages can be solved by FP?
2)What are areas in which FP might be useful? I can see use of FP as of now is limited to academics.




MH
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

The biggest win for FP is in the realm of concurrency.

What makes concurrency difficult in imperative languages: we are always having to worry about synchronizing the state that's shared between threads. In FP everything is immutable, so there's no need to synchronize.

Technically, you can use an imperative language like Java to program in a functional style. You just don't get the full bag of tricks like lazy evaluation and tail recursion (I think).


A good workman is known by his tools.
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1871
Thanks. I heard learning curve is steep in FP.As far as Haskell goes I can see some applications-http://www.haskell.org/haskellwiki/Haskell_in_industry but I think they could be achieved by other java/python too. Are there any applications/areas where FP likely to become popular?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

If this were an obvious answer, you wouldn't have to ask it. No one really knows for sure yet.

Most people speculate that doing processing in parallel will cause signifact performance gains. Maybe FP will never catch on. Maybe it will catch on but the FP code will be written in Scala libraries by uber-geniouses and folks like me will merely call those libraries from Java code, so I'd never have to worry about writing FP code. Who knows.

FP is pretty fun to learn though. At the very least, learning FP provides another angle of strategy in writing imperative OO code.

If you decide to learn Haskell, I've got a small tad of exposure and could help out with many issues you run into. Just keep posting new threads in this forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Functional programming
 
Similar Threads
Is Erlang easy to learn?
Double-Checked Locking
Video on "Functional Thinking"
FP in Java: alternatives to exception handling
Annotations and reuse