BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Announces Pre-release of F# 4.0 in Visual Studio 2015 Preview

Microsoft Announces Pre-release of F# 4.0 in Visual Studio 2015 Preview

Microsoft announced a pre-release of F# 4.0 for Visual Studio 2015 Preview which can be installed through a Visual Studio update package.

The update brings new language capabilities, such as:

  • Constructors as first-class functions: constructors can now be passed around and composed with other functions.
  • Simplified use of mutable values: the mutable can now be used for both stack-based and heap-based or closure-captured mutable values, getting rid of the need to use the special ref syntax for heap and closure mutable values.
  • Support for high-dimensional arrays: F# gets in sync with the .NET framework ability to handle up to 32-dimensional arrays.
  • Support for static parameters to provided methods: F# type providers now supports the specification of static parameters on provided methods. Previously, developers had to declare multiple top-level types to handle distinct parameters; now, they can use a single type declaration along with parameterized methods.
  • Slicing syntax support for F# lists: lists nows supports the usual slicing syntax used also for arrays.
  • Simplified usage of units of measure with printf-family functions: the printf family of functions accepts seamlessly arguments including measure information.

Furthermore, the update also includes several enhancements to the FSharp.core runtime:

  • Normalized collections modules: the three most frequently used collection types in F# code, Array, List, and Seq, now offer a uniform API, which accounts for the addition of 94 methods. The new methods will spare developers having to convert a collection object from one type to another to use a missing method in the original type.
  • Faster generic comparison: F# 4.0 provides performance improvements of up to 5x when comparing primitive types such as int, string, and so on.
  • Better async stack traces: stack traces for exceptions occurring in async code have been improved so the top frame should always point to the exception origin.

Finally, the GC mode used by the F# compiler has been tweaked a bit to provide "upwards to 10% better compile performance."

Interestingly, the F# 4.0 preview update has applied 90 pull requests coming from 32 developers after Microsoft enabled community contribution in April 2014.

The announcement stirred some reactions in the developers' community, hinting at the usefulness of normalized collection APIs, list slicing, and other changes in daily programmers' life; others pointed to the need for Microsoft to start presenting F# as a 1st class citizen of .NET land in order for it to be more widely adopted.

The 4.0 release is just a preview, with more features still under development for the final release both regarding the language and the tooling, Microsoft clarified.

Rate this Article

Adoption
Style

BT