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 for Converge360.

comments powered by Disqus

Featured

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

Subscribe on YouTube