Paul Krill
Editor at Large

Microsoft upgrades its F# functional language

news analysis
Nov 14, 20143 mins

Preview of F# 4.0 features runtime, compiler, and language enhancements

The F# team at Microsoft is offering a pre-release of the 4.0 version of the language, featuring core runtime and compiler improvements.

The object-oriented F# is Microsoft’s entry into the burgeoning landscape of functional languages, which also features Scala, Clojure, and now even Java. Microsoft released F# code under open source license four years ago.

F# 4.0, detailed this week, has a core runtime that has been enhanced with normalized collections modules and better async stack traces.

“In F# 4.0, the collections API has been fully normalized across Array, List, and Seq,” the team said. “There are now dedicated, optimized implementations of all common operations for each type, and even a few brand-new functions.  This represents the addition of a whopping 94 APIs in total.”

With async stack improvements, exceptions occurring in async code now have stack traces preserved in a more user-friendly way, the team said. Also, internal tables of optimized hash-comparison implementations used by F# code have been improved, for performance gains when processing primitive types such as int and string.

Modified compiler settings, meanwhile, offer better performance by 10 percent. “Not a language feature, but surely of interest to F# language developers, is a change to the GC mode used by the F# compiler,” the team said in a blog post. “fsc.exe now uses GCLatencyMode.Batch, which gives a noticeable improvement in overall throughput, something that any F# developer will welcome.”

Language improvements include treating constructors as first-class functions, in which they get the same treatment as other .Net methods. Version 4.0 also features simplified use of mutable values and support for high-dimensional arrays.

“The .Net framework supports up to 32-dimensional arrays, but in the past F# only supported use of up to rank-4 arrays,” the team said. “Not only were arrays of rank 5+ not possible to create and manipulate from F# code, the compiler could sometimes fail to consume external libraries which relied on high-dimensional arrays. This is now fixed.  Although there is not yet support for creating and manipulating high-rank arrays, the compiler will now properly handle these types up to rank-32.”

The F# team also noted that the newly announced Visual Studio Community Edition supports F# and extensions such as Visual F# Power Tools. F# tools are included in the Visual Studio 2015 Preview download. The Visual Studio F# 4.0 Tools Preview is available for download.

Microsoft’s latest tooling strategy, rolled out this week, also features the open-sourcing of the server-side .Net stack and plans for Visual Studio 2015.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author