Microsoft's F# Language: No. 12 With a Bullet

 
 
By Darryl K. Taft  |  Posted 2014-03-10
 
 
 

Microsoft's F# Language: No. 12 With a Bullet


The popularity of Microsoft’s F# programming is on the rise, so much so that it is close to cracking the top 10 of the most popular programming languages according to the TIOBE Programming Community index.

On the latest TIOBE index ranking, for March 2014, F# ranked at No. 12 on the list of most popular languages. That means F# has jumped 57 places over the last year. In March of 2013, F# was ranked 69 on the index.

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers worldwide, courses and third-party vendors. Popular search engines such as Google, Bing, Yahoo, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. The TIOBE index is not about the best programming language or the language in which most lines of code have been written.

Visual F# is a strongly typed, functional-first programming language for writing simple code to solve complex problems using Visual Studio and the .NET Framework. F# is designed to reduce the time-to-deployment and complexity of software components such as calculation engines and data-rich analytical services in the modern enterprise.

According to the F# Software Foundation, from the business perspective, “the primary role of F# is to reduce the time to deployment for analytical software components in the modern enterprise. Its interoperability with all .NET languages and libraries and its ability to tackle the complexity of components such as calculation engines and data-rich analytical services offer a compelling story for businesses.”

F# is a first-class language on a number of platforms including Mac and Linux, with tool support in Xamarin Studio, MonoDevelop, Emacs and others. Of course it is also a first-class language on Windows with Visual Studio, Xamarin Studio and Emacs, as well as on mobile devices and on the Web using HTML5.

Last year at its Xamarin Evolve conference, Xamarin announced support for the F# language as part of the Xamarin tools for iOS and Android app programming. In a blog post on that announcement, Don Syme, a principal researcher at Microsoft and creator of F#, said, “The announcement from Xamarin means you can now create iOS and Android applications using 100 percent F# code, or alternatively use the C#-F# pattern where front-end logic is in C# and some or all application components are in F#... Somewhat surprisingly, the announcement from Xamarin means F# now has one of the broadest cross-platform development stories amongst all functional-first languages.”

Moreover, in an interview on Microsoft’s Channel 9, Miguel de Icaza, co-founder and CTO of Xamarin, said he likes F# and attributes its popularity to “a lot of people that are looking at F# for building better code and programs with fewer errors.”

Microsoft's F# Language: Number 12 With a Bullet


De Icaza said he also believes the F# Foundation has increased the exposure and progression of the language, noting that it is “fantastic” that Microsoft open-sourced F#. The F# Foundation is “a very active group,” he said. “It is so nice to see F# get this kind of attention from the community. People are sending pull requests, people having discussions about the language, the future, the libraries, improvements to the tooling... So it is a fantastic community on the one hand. On the other one, I've always been fascinated by functional programming.”

De Icaza professed a fascination with F#. “What both LISP and F# have in common is that when you're writing in those languages, you tend to refactor so much more,” he said. “I don't know what it is in the language, but you always create these little, tiny functions. With C# and maybe Python and Ruby, you cannot just roll the functions. So you tend to make your functions more feature-full. While in F# you tend to see a pattern and you take it out” and repeat that process time after time, he said.

“So you make all of these little individual functions,” de Icaza added. “I don't know what it is or what happens in my brain, but when you're writing LISP or F#, you tend to do this thing where you extract all these idioms outside. So there's that element. Also, code is of course shorter. It's nice to write less code, to type less. And personally I'm fascinated with the pattern matching--the fact that F# helps you write better code by removing null from your vocabulary. It doesn't let you do it. We're so used to using null everywhere and F# just doesn't let you."

De Icaza, who hails from a family of scientists – his father is a physicist and his mother a biologist, said F# is a great language for scientists. “It's a language very well suited to scientific uses,” he said. “It turns out that finance people love it because you get less bugs. F# is another language that I love. And ever since the beginning of .NET, this idea that you could have multiple languages on the same VM was something that really spoke to me. Partly because of the work I had done on Linux with multiple language integration with the same APIs. So .NET was that thing for me. We are very happy about F#. And we're going to keep adding interesting languages that people like.”

In January, Microsoft released an update of its Visual F# tools. Visual F# Tools 3.1.1 is a small, quick-deploying package that can be used to update current editions of Visual Studio 2013, Microsoft’s F# team wrote in a blog post. The package updated the compiler and runtime, along with the IDE tooling. The F# language edition supported is F# 3.1. The update contained a small number of bug fixes compared to the baseline in Visual Studio 2013, Microsoft said.

Last November, Microsoft announced a code drop of the F# 3.1 compiler, library and tests. In a blog post on the drop, Syme said, “The Visual F# Tools team at Microsoft contributes to F# through enterprise-ready tooling in Visual Studio 2013. We recommend the Visual F# Tools as the best, most productive and highly stable route for functional-first programming in the Windows ecosystem.”

Microsoft's F# Language: Number 12 With a Bullet


Syme described functional-first programming as “a general-purpose programming technique represented by languages such as Clojure, Scala, Haskell, F#, OCaml and is particularly suited to analytical programming tasks such as calculation engines, data-science programming, ETL pipelines and general data-manipulation. While these problems can be solved using other programming paradigms, they are particularly amenable to functional-first programming. Functional-first programming uses functional programming as the initial paradigm for most purposes, but employs other techniques such as object-oriented programming and state manipulation as necessary.”

Meanwhile, developers in various industries are looking to F# to build apps for everything from financial systems to gaming.

“F# is becoming an increasingly important part of our server side infrastructure that supports our mobile and Web-based social games with millions of active users,” said a lead server engineer and developer at Gamesys in an interview on the .NET Rocks! podcast. “F# first came to prominence in our technology stack in the implementation of the rules engine for our social slots games which by now serve over 700,000 unique players and 150,000,000 requests per day at peaks of several thousand requests per second. The F# solution offers us an order of magnitude increase in productivity and allows one developer to perform the work that is performed by a team of dedicated developers on an existing Java-based solution, and is critical in supporting our agile approach and bi-weekly release cycles.”

Patrice Simard, a distinguished engineer at Microsoft, also spoke of his experience with F#.

“For a machine learning scientist, speed of experimentation is the critical factor to optimize,” Simard said in a testimonial on the F# Foundation Website. “Compiling is fast but loading large amounts of data in memory takes a long time. With F#’s REPL, you only need to load the data once and you can then code and explore in the interactive environment. Unlike C# and C++, F# was designed for this mode of interaction. It has the ease of use of Matlab or Python, both of which I have used extensively in the past. One problem with Matlab and Python is that they are not strongly typed. No compile-time type checking hurts speed of experimentation because of bugs, lack of reusability, high cost of refactoring, no IntelliSense, and slow execution. Switching to F# was liberating and exhilarating.”

And in responding to a query about F# on Stack Overflow, Simon Cousins, an F# software developer in the UK, said, “I have written an application to balance the national power generation schedule for a portfolio of power stations to a trading position for an energy company. The client and server components were in C# but the calculation engine was written in F#. The use of F# to address the complexity at the heart of this application clearly demonstrates a sweet spot for the language within enterprise software, namely algorithmically complex analysis of large data sets. My experience has been a very positive one.”

Rocket Fuel