Announcing the release of Visual F# Tools 3.1.2

We are happy to announce the availability of Visual F# Tools 3.1.2, the latest update to the Visual F# compiler and F# IDE tooling for Visual Studio.  You can download the installer package here.

Building upon Visual F# 3.1, and the first out-of-band update Visual F# Tools 3.1.1, Visual F# Tools 3.1.2 is a standalone, F#-only installer that packages the latest updates to the F# compiler, interactive, runtime, and Visual Studio integration.  The IDE updates apply to Visual Studio 2013 Pro+, Desktop Express, and Web Express.

A release by and for the F# community

To begin with, it’s worth noting that this is the first Visual F# Tools release since we expanded our open source efforts and began taking contributions, and therefore the first release to include direct contributions from the F# community! We would like to thank all of the developers who worked with us by opening bugs, sending pull requests, and participating in discussions.

Commits from the following community F# developers are included in Visual F# Tools 3.1.2: antofik, Don Syme, Jon Harrop, Robert Jeppesen, Steffen Forkmann, Vladimir Matveev, Will Smith, Xiang Zhang.

What’s new?

Expanded portable library support, including Windows Phone 8.1

We continue to expand .NET portable library support in Visual F#.  New in this release, developers will find F# project templates, along with compiler and runtime support, for two additional portable profiles:

  • Profile 78 (.NET Framework 4.5, Windows 8, Windows Phone Silverlight 8)
  • Profile 259 (.NET Framework 4.5, Silverlight 5, Windows 8, Windows Phone 8.1)

This is in addition to the two profiles previously supported – Profile 47 (.NET Framework 4.5, Silverlight 5, Windows 8) and Profile 7 (.NET Framework 4.5, Windows 8).

Issues with adding project references between C# and F# portable libraries have also been addressed in this release. Altogether, this means that for the first time you can add an F# portable library project directly to a Windows Phone 8.1 solution!

fsphone

 

Non-locking assembly references in FSI

F# developers love the quick-iteration development workflow enabled by F# Interactive – “edit-compile-test” is more or less distilled to “edit-test” – and tend to dislike anything that slows them down.

Oddly enough, one of the most common speed bumps in this loop is actually F# Interactive itself! Adding a #r assembly reference causes the referenced assembly to be locked on disk. If that assembly is part of your solution, and you want to rebuild it, make sure to restart FSI first!  If you don’t, your build will fail with the dreaded “The process cannot access the file 'bin\Debug\ClassLibrary1.dll' because it is being used by another process.”

Those errors should no longer be an issue. F# Interactive now supports non-locking #r references via shadow copy.

shadowcopy

This is a configurable behavior.  Non-locking references are enabled by default in the hosted Visual Studio F# Interactive, and configurable via the F# Interactive options dialog. On the command line, the default behavior for fsi.exe has not been changed, but you can easily enable the new behavior via the switch --shadowcopyreferences+

Support for Publish in web and Azure projects

If you are using F# for web development, perhaps utilizing one of the excellent community project templates that are available, you have likely noticed that the Visual Studio “Publish” action has not worked for F# projects in the past.  This long-standing issue has finally been addressed; you can now publish F# web and Azure projects directly from Visual Studio!

publish

Minor language changes

Improved *nix compatibility with #! in F# scripts

The F# compiler now allows for the shebang (#!) directive to exist at the beginning of F# source files, and will treat such a line as a comment.  This allows F# scripts to be compatible with the Unix convention whereby a script can indicate to the OS what interpreter to use by providing the path to that interpreter on the first line, following the #! directive.

shebang

This change does not affect how F# file associations are configured on Windows.

Compiler support for high-dimensional slicing

F# supports slicing syntax for working with arrays and other multi-dimensional data types, and developers can define custom slicing behavior for their own types by implementing appropriate overloads of the GetSlice and SetSlice methods.

In previous releases, the compiler enforced a limit of 4 slicing dimensions.  This limit has been lifted; developers are now free to define arbitrary-dimensional slicing semantics in their code.

slices

Spaces in active pattern case identifiers

There was previously a restriction preventing space characters from being used in active pattern case identifiers.  This restriction has been relaxed; space characters may now be used in ``  ``-escaped case identifiers.

patterns

And beyond

In addition to what’s mentioned here, Visual F# 3.1.2 also includes a number of bug fixes, a couple of performance improvements, and even some optimized code generation for struct processing. A full list of changes and bug fixes is in our Codeplex repo.

More Information

For more information about F# generally, please visit https://fsharp.org. If you are interested in contributing to the Visual F# Tools, please visit our open source home at https://visualfsharp.codeplex.com/