Microsoft Announces F# 4.5 Preview

Recently, Microsoft has announced the new language version of F# called F# 4.5.
The F# 4.5 has been developed completely through an open request for comments (RFC) process, with significant contributions from the community, particularly in feature discussions and demonstrating use cases.
There are two RFCs that correspond with this release including;
  • F# 4.5 RFCs
  • FSharp.Core 4.5.0 RFCs
Salient features of new language version F# 4.5
  1. Versioning Alignment- The F# 4.5 language version is higher than F# 4.

  2. F# compilers deployed by Visual Studio- The F# compiler evolves more rapidly than the language, which is used to fix bugs or improve performance. F# 4.5 when installed with Visual Studio, helps in additional Visual Studio installations that will not pick this higher compiler SDK version.

  3. Span support- The F# 4.5 aligned with the new Span feature in .NET Core 2.1. which is comprised of a voidptr type, the NativePtr.ofVoidPtr and NativePtr.toVoidPtr functions in FSharp.Core has the ability to produce IsReadOnly structs, and have comprehensive safety checks that further helps in the prevention of unsoundness in the code.

  4. Safety rules for byrefs- There is the restriction of using the byrefs and byref-like structs because it has a let-bound value which cannot have its reference escape the scope, they cannot be an instance or static members of a class or normal struct, and they cannot be used as a generic type parameter.

  5. Bug fixes that are not backwards compatible- Because F# 4.5 will helps in coding the deals with consuming C# 7.x ref returns and performs.

  6. Implicit dereference of byref-like return values- This will helps in dereferenced in F# code which means that if you are attempting to translate C# code consuming a ref return into equivalent F# you will get back a pointer rather than a value.

  7. Disabling evil struct replacement on immutable structs- Evil struct replacement behavior is called a bug now which F# has a way to represent ReadOnly structs.
The company concluded by stating - “This preview is very, very stable. In fact, after extensive testing, we feel that it’s stable enough for us to consider it a proper release, but due to the timing of the .NET SDK and Visual Studio releases, we’re releasing it now as a preview. Soon, when Visual Studio 2017 update 15.8 and the corresponding .NET Core 2.1 SDK update release, we will declare F# 4.5 as fully released and it will be fully included in both places.”
To learn more, you can go through the official announcement.
If you want to enhance your knowledge on F# or you are willing to add something new to your skill set then you can follow the F# section on C# Corner.