The F# programming language will become a major .NET language with its formal April debut in Visual Studio 2010, as it transitions from a Microsoft research project. F# has become a surprise hit among .NET developers, and it is being treated as a “first-class language” by Microsoft, serving as a test bed for ideas, said Larry O’Brien, an independent software architect and technology analyst who also writes the “Windows & .NET Watch” column for SD Times.
Pronounced as “F-sharp,” F# is a hybrid functional and object-oriented programming language that was created by researchers at Microsoft’s Cambridge, U.K. lab to demonstrate interoperability between different programming paradigms.
Some of its features include dynamic linking, preemptive multithreading and SMP machine support, and Unicode strings. It also is highly immutable—meaning that objects’ state cannot be modified once created—and has an implicit type system.
Because F# has an implicit type system, source code is smaller and the syntax is simpler, said Rick Minerich, a Microsoft MVP (Most Valuable Professional) and F# user group leader; he is also a software engineer at component maker Atalasoft.
“It is a stronger typed language than C#,” he explained. “C# makes no guarantees about things you are passing around. In F#, you deal with unexpected results sooner and more clearly.”
Microsoft has been using F# to build libraries for its software, including Microsoft Server Foundation, a set of algorithms that were tested in F# and then moved to C#, said Edgar Sánchez, a Microsoft regional director, an individual recognized by Microsoft’s Developer Platform evangelism group for technical expertise.
Libraries written in F# can extend languages like C# with its own capabilities, and a developer wouldn’t necessarily need to learn a new language or even know that they are using F#, explained Amanda Laucher, a developer with ThoughtWorks, a consulting and development company. “It doesn’t add complexity to the system, it just adds another DLL.”
However, O’Brien was sour on the prospect that mainstream developers would write libraries in one language and then use them in another. “It seems to me that people are either writing entire applications in F#, or [they] are very advanced ISVs who might do a component in F# that they sell or license for general use,” he said.