News

Build Developer Conference: What's New with C# and F#

Microsoft provided updates on its flagship .NET-centric programming languages, C# and F#, during this week's online Build developer conference.

C#
Mads Torgersen, C# lead designer on the .NET team, penned a blog post announcing that C# 9.0 is taking shape, though there is no release date or official preview. Some developers have speculated it would come with .NET 5, shipping this November, but that might not be likely as the COVID-19 pandemic has already delayed some features of the unifying, "just one .NET going forward" .NET 5 effort. A GitHub page says a C# 9.0 candidate is due by Jan. 1, 2090, so developers probably shouldn't hold their breath.

Whenever it does come, Torgersen detailed a slew of new features, with the dev team focusing on "supporting terse and immutable representation of data shapes."

Some of the goodies outlined in his huge post include:

  • Init-only properties
    • Init accessors and readonly fields
  • Records
    • With-expressions
    • Value-based equality
    • Data members
    • Positional records
    • Records and mutation
    • With-expressions and inheritance
    • Value-based equality and inheritance
  • Top-level programs
  • Improved pattern matching
    • Simple type patterns
    • Relational patterns
    • Logical patterns
  • Improved target typing
    • Target-typed new expressions
    • Target typed ?? and ?:
  • Covariant returns
C# 9.0 Features
[Click on image for larger view.] C# 9.0 Features (source: Microsoft).

These features are further detailed on the language's GitHub site, as illustrated in the graphic above.

Other GitHub resources for C# include:

But perhaps the best way to digest the impact and developer feelings about the above features is to read the dozens of comments appended to the May 20 post.

F#
Phillip Carter program manager for .NET and Languages, authored his own post on F# 5 and its tools. The language came out in a preview in March, with a focus on interactive analytics.

Carter detailed some minor additions, as the dev team has been focusing on stabilizing preview features introduced since the last preview release (there was no mention in either post if the COVID-19 pandemic, as mentioned earlier, had delayed possible, more extensive previews that Microsoft might have hoped to unveil for C# or F# during the Build event).

"This release introduces only one new language feature," Carter said. "However, the other features we've shipped so far have been further stabilized. There are a few more features in the pipeline that we're considering before we call F# 5 feature complete, and we'll post updates when they're available."

In discussing "default interface member interop," Carter described how C# 8 introduced the ability to define interfaces with default implementations. Now, he said these can be consumed through the standard method of implementing an interface.

"This will let F# developers safely take advantage of packages or other components written in C# that use this feature and expect callers to support it," he said. "We currently don't support generating default implementations, though. If you'd like to do that, please search for or file a suggestion in the F# language suggestions repository."

Carter also detailed compiler performance improvements and tooling improvements in Visual Studio 2019 Update 16.6, which was unveiled during Build this week.

"The compiler wasn't the only thing that got faster in this release. We've been focusing on improving the performance and reliability of the Visual Studio tools for F# throughout the Visual Studio 2019 lifecycle, and this release is no different! Starting with Visual Studio 2019 Update 16.6, features like Find All References and Rename should run considerably faster and show results much sooner when scanning a large codebase," he said.

In announcing the March preview, Carter provided these resources for more information on development of the language:

In this week's post he said the dev team is now focusing on:

  • Continuing inclusion of language features when their design and implementations are stable
  • Continuing to improve the tooling performance for larger F# codebases
  • Making F# in Jupyter and Visual Studio Code Notebooks the best language for data science and analytical work (more on this in future updates!)
  • Continuing to incorporate OSS contributions and strive to include them into releases as soon as possible

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events