File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Functional programming

 
Arjun Shastry
Ranch Hand
Posts: 1893
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.



 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Arjun Shastry
Ranch Hand
Posts: 1893
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic