Microsoft’s F# programming language continues to catch on with developers and is gaining traction in the enterprise.
The language currently sits at No. 26 on the latest TIOBE Index of the most popular programming languages, ahead of other functional programming languages such as Erlang (36), Scheme (37), Scala (42), Haskell (46) and ML (48).
The F# language came out of Microsoft Research Cambridge in the U.K., designed by Microsoft researcher Don Syme. Microsoft began talking publicly about the project as early as 2003. An FAQ on the Microsoft Research site at the time said: “F# is an implementation of the core of the CAMLprogramming language for the .NET Framework, along with cross-language extensions. The aim is to have it work together seamlessly with C#, Visual Basic, SML.NET and other .NET programming languages.”
F# is meant to bridge the best of the functional, imperative, object-oriented and type-classed languages, Microsoft said at the time. And it stuck to that goal, eventually releasing F# as one of Microsoft’s core languages and open-sourcing it.
F# is a strongly typed, functional-first programming language for writing simple code to solve complex problems, the F# Software Foundation says. Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data.
Gene Belitski, an F# programmer and member of the F# Software Foundation, said to demonstrate that the language could be successful in enterprise environments, he promoted F# into the production environment at his former employer, Thomson Reuters, for delivering complex highly scalable back-end services. However, “As of now I’m experimenting with algorithmic trading based on a powerful combo of F# for implementing trading robots and R for quantitative modeling backing,” he said.
Microsoft recently released a release candidate of Visual Studio 2013, which contains a host of new features for F# developers, including F# 3.1 language updates and improved Visual F# tooling. Among the new features is “Send to F# Interactive,” which enables the same solution explorer context menus used to manage assembly references in F# projects to developers the option to send those references to their F# Interactive (FSI) session. This is often much simpler and faster than typing out a full #r command.
“F# as a language is both open source and available for cross-platform use through the work of the F# Software Foundation and other contributors,” Microsoft’s F# team said in a blog post earlier this summer. Language design and compiler implementation are two of Microsoft’s contributions to the language, as well as the Visual F# tooling and the Try F# site.
Microsoft said previous versions of the F# language have focused on major new features such as F# asynchronous programming (F# 1.1),F# units of measure (F# 2.0) and F# type providers (F# 3.0). However, the focus of version 3.1 of the F# language is to make incremental improvements to improve the software engineering qualities of the language and make it simpler to use in common situations.
Meanwhile, the Visual F# team has been doing a lot of work to allow the Visual F# tooling to be updated more frequently, and independently of Visual Studio. This is an important direction for many Visual Studio components and promises more flexibility in release and development cycles, while maintaining high quality levels, Microsoft said.
The F# team said discriminated union types are a powerful new feature of F# that makes programming with shaped data simple, accurate and robust. They also greatly reduce the number of classes needed to represent data in many common circumstances.
There also are new extensions to array slicing. F# supports slicing syntax for arrays and other multidimensional data structures. However, in previous versions of the language, slicing was restricted to slicing a shape of the same “dimension”—for example, slicing a 2D submatrix from a 2D matrix. In version 3.1, you can now slice 1D columns and 1D rows from 2D matrices, and likewise for other slicing operations, Microsoft said.
F# 3.1 introduces an additional type inference rule to improve F# type inference when using overloaded methods that take functions as arguments. These improvements are most noticeable when using theLINQ method overloads.
Also, Microsoft said Visual F# projects authored in Visual Studio 2012 can now be used in Visual Studio 2013 without requiring a project upgrade, and vice versa—if the project is using the F# 3.0 runtime components. For Visual Studio 2012 projects, a one-time upgrade is required to enable this feature, but that upgrade is backward-compatible and the project will still be usable in both Visual Studio 2012 and 2013. Moreover, project round-tripping was not supported for F# between Visual Studio 2010 and 2012, but it is now supported between Visual Studio 2012 and 2013.