News

Microsoft: 'We Are Finished with F# 5'

While highlighting new development work on Microsoft's F# programming language alongside the latest .NET 5 preview, the company announced that, except for one minor enhancement, "we are finished with F# 5!"

F# is the open source, cross-platform, functional-first counterpart for C#, used for complex computing use cases like interactive Big Data analytics and more, officially stewarded by the F# Software Foundation but created and driven by Microsoft.

Microsoft says features of F# include:

  • Lightweight syntax
  • Immutable by default
  • Type inference and automatic generalization
  • First-class functions
  • Powerful data types
  • Pattern matching
  • Async programming

That aforementioned minor enhancement is scheduled for an upcoming release candidate (RC), but otherwise further development will focus on bug fixes and addressing high-priority feedback from developers.

Here's a summary of how Microsoft described the latest updates on F# 5 alongside the recent .NET 5 Preview 8:

  • String interpolation: This highly requested feature allows for evaluation of a string literal containing one or more placeholders to be filled in later, or, as Microsoft said, "F# interpolated strings are fairly similar to C# or JavaScript interpolated strings, in that they let you write code in 'holes' inside of a string literal." This was missing for years because the $ symbol used for string interpolation was reserved.

    Although it had an initial design early on, "The design has undergone a lot of discussion over the years, but finally a breakthrough on how to best handle it was made by Yatao Li, who also supplied an initial implementation," explained Phillip Carter, program manager, .NET and Languages, in a blog post last week.

    • Support for nameof is now complete: Carter said, "nameof resolves the symbol it's being used for and produces a name that represents what it's called in F# source. This is useful in various scenarios, such as logging, and protects your logging against changes in source code."
    • Open type declarations: This new feature lets developers use open to expose static contents inside of any type. Carter said it's similar to Open Static Classes in C# and added, "Additionally, you can open F#-defined unions and records to expose their contents. This can be useful if you have a union defined in a module and want to access its cases, but don't want to open the entire module."
    • Overloads of custom keywords in computation expressions: Developers, especially library and framework authors, can improve the expressiveness of components they create by defining well-known members and forming a domain-specific language (DSL) for a domain being used. "We've enhanced computation expressions to allow for Applicative forms already," Carter said. "This time, Diego Esmerio and Ryan Riley contributed a design and implementation to allow for overloading custom keywords in computation expressions."
    • Interfaces can be implemented at different generic instantiations: This enhances interface functionality in F# by enabling developers to implement the same interface at different generic instantiations, said Carter, who credited Lukas Rieger for contributing an initial design and implementation.

    Going forward, in addition to addressing developer feedback and fixing bugs, Carter said the F# team will work to improve its engineering system in the F# development repository on GitHub, focusing on testing infrastructure to make it easier for contributors to work on the project.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events