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

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube