What is the new language F# is all about? Where is that going to be useful? And what is Microsoft's future plan (release road map) regarding this language?
F# allows you to easily implement functional concepts, has powerful matching facilities, and extremely flexible metaprogramming. If nothing else, you'll start to think about the structure of your programs in a very different way.
Edit: Also, I recommend checking this out: http://research.microsoft.com/fsharp/about.aspx
F# is basically bringing functional programing to the .NET platform meaning an even greater diversity and options to the already well filled .NET toolbox. It's useful since it brings both another paradigm and opens up a different view to think about problems and also since much of functional programming is about avoiding side effect it lends itself extremely well to parallelization.
I think right now it would be most useful to do it for interest/learning. However, there are practical applications of functional languages in highly threaded environments. It is also a good thing to discuss in an interview if one of the interviewers has a PHd in computer science.
Yes, it's useful. It's useful just like any functional programming language is useful. One reason that I like to learn other languages pertains to the Sapir-Whorf Hypothesis:
The hypothesis postulates that a particular language's nature influences the habitual thought of its speakers: that different language patterns yield different patterns of thought. This idea challenges the possibility of perfectly representing the world with language, because it implies that the mechanisms of any language condition the thoughts of its speaker community.
There are certain classes of applications (like financial applications, number crunching, etc.) where functional programming REALLY shines. Outside of those scenarios, it's all about using the right tool for the right job.
Dustin Campbell has a great post on functions in F#. Curried functions are especially cool.
Let's take a simple function that increments a number by 1:
let inc x = x + 1;;
Since functions are first-class citizens in F#, the function definition above is actually a more concise way of saying this:
let inc = (fun x -> x + 1);;
Where it gets really fun is when you have a function with more than one parameter. In F#, technically there is no such thing, a function with two parameters is actually a function that takes one parameter and returns another function that takes the other parameter and returns the value.
So, an add function:
let add x y = x + y;;
Is actually defined as:
let add = (fun x -> (fun y -> x + y));;
I know, that's a bit of a mind bender at first, but it allows us to do some VERY cool things, like "partially-applied functions" (a.k.a. curried functions). Let's redefined our inc function above to be a partially-applied function based on our add function:
let inc = add 1;;
Yes, we just called the add function and only passed it one parameter. This evaluated the first part of the function and returned another function expecting our second parameter. Very cool!
As an OOP developer, here's one way to think about functional programming: everything you currently know about functions is incompletele :). A story for you:
In the world of Object-oriented development, we tend to eat, sleep, and dream about Objects. Objects are the Manna of Life, a continued source of sustenance for our development body.
But what about Functions? Sadly, Functions exist solely to be obedient servants to the needs of their Object masters. Functions are not first-class citizens in an Object world. Functions are relegated to the dingy back alleys and filthy pool halls of development life, sent scrounging to seek out torn and tattered, week-old newspapers just to stay warm at night. They live a life of under-appreciation, doomed to forever swim just below the water level of a developer's consciousness.
If you're interested in aspect oriented programming, F# is the way to go... Just learn it anyway, there's no harm in learning a new language...
Since this question got nice viewership, I thought I'll share a nice article by Scott Hanselman on this topic. Hope this will help some one else.
F# is all about brevity, interactivity, interoperability and a non-mainstream approach to factoring and structuring programs.
F# is useful and, in particular, is much better suited to some applications than C#:
Variant types and pattern matching in F# make it extremely well-suited for the manipulation of trees, which can be anything from the representation of a program inside a compiler written in F# (this family of programming languages were bred for compiler writing), computer graphics, XML handling and other applications that make heavy use of trees.
First-class functions provide a very concise and comprehensible way to factor programs that is very well suited to heavily abstract algorithms found in mathematical computing, including conventional data structures and algorithms.
F# interactive sessions are ideal for developing and running disposable programs such as massaging data and interactive technical computing. The entire .NET environment is available from interactive sessions including dynamic GUIs built with WPF, e.g. for interactive graph plotting.
The first full product version of F# was released as part of Visual Studio 2010.
i m new to programming .should i learn c# or i can follow F# langauge please advice me
Because if you do not learn it, you are going to be reduced to writing low interest line of business applications.
Why? Because C#/VB written in a standard way is full of side effects and mutable stuff. Hence, standard C#/VB code cannot take advantage of multiple cores, vector processors, GPUs, etc. as easily as F# does.
Amanda Laucher hits the ball out of the park on this issue with her lang.net presentation. She speeds up production C# code by a factor of 100x by porting it to F#. The C# code was using less than 25% of the CPU of one core.
I'm new to F#,and Curried functions is really cool! Is partially applied function the same concept as Curried function?
This video is really good at explaining "why learn F#". http://channel9.msdn.com/pdc2008/TL11/
When I was watching it, most of the time I'm thinking C# has got that, more or less, with LINQ or PLINQ up to and including CPU parallelism, but then he showed IO parallelism and it was awesome. It is really easy to express IO parallelism in F#.