Official proposal for Type Unions in C#

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • csharplang

    The official repo for the design of the C# programming language

    Yeah I sometimes use them but they don’t cover all the cases. I’m waiting for roles/extensions to see if I can achieve a similar result.

    https://github.com/dotnet/csharplang/discussions/5496

  • InfluxDB

    Purpose built for real-time analytics at any scale. InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.

    InfluxDB logo
  • OneOf

    Easy to use F#-like ~discriminated~ unions for C# with exhaustive compile time matching

    It's possible to add DUs in C# today with some third party packages.

    - https://github.com/domn1995/dunet

    - https://github.com/mcintyre321/OneOf

    Quite good and ergonomic with the source generators removing a lot of the boilerplate.

    I have a practical example here using OneOf with .NET Channels: https://chrlschn.dev/blog/2024/07/csharp-discriminated-union...

  • ClosedTypeHierarchyDiagnosticSuppressor

    Suppresses exhaustiveness warnings for switching (switch statement or expression) on closed type hierarchies

    I'm currently using nested records with a private constructor in combination with the nuget package https://github.com/shuebner/ClosedTypeHierarchyDiagnosticSup... to make sure the switch types do not require a `_` case. This is essentially the desugared version of their "Union Classes" proposal. This already works very well. Still, I like this proposal because it would be nice if the nuget package would become unnecessary and the syntactic sugar is also nice to have.

  • I'm currently using nested records with a private constructor in combination with the nuget package https://github.com/shuebner/ClosedTypeHierarchyDiagnosticSup... to make sure the switch types do not require a `_` case. This is essentially the desugared version of their "Union Classes" proposal. This already works very well. Still, I like this proposal because it would be nice if the nuget package would become unnecessary and the syntactic sugar is also nice to have.

  • dunet

    C# discriminated union source generator

    It's possible to add DUs in C# today with some third party packages.

    - https://github.com/domn1995/dunet

    - https://github.com/mcintyre321/OneOf

    Quite good and ergonomic with the source generators removing a lot of the boilerplate.

    I have a practical example here using OneOf with .NET Channels: https://chrlschn.dev/blog/2024/07/csharp-discriminated-union...

  • garnet

    Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients.

    Java has been fine for infrastructure projects. There is so much out there that relies on things like elasticsearch, Kafka, or any aws service. Heck even the columnar dbs like pinot and Druid are most likely more used than clickhouse.

    C# is also fine for this, just way less popular. Recently ms put out https://github.com/microsoft/Garnet when the redis debacle happened.

    The Apache project has helped put out quite a few large infra projects, most of them in Java (I don’t know why this is but assume they have lots of resources to help with that, and also that people don’t like debugging memory crashes).

    Ms has just been not the greatest collaborators with their open source community. A lot of the time it seems like they want to do the initial foundation, then leave “drawing the rest of the owl” to the community, which ends with lots of partially functional things. GUI frameworks, f# tooling, drivers for commonly used critical infra. At the same time, people get upset when ms tries to build a better version of an existing open source project, so there’s no winning. They’ve just put themselves in such a poor spot.

  • openjdk

    Microsoft Build of OpenJDK (by microsoft)

    Ironically, given the past history that lead to .NET existence,

    https://devblogs.microsoft.com/java

    https://www.microsoft.com/openjdk

    https://code.visualstudio.com/docs/languages/java

    Because it turns out, making Java running on Azure, on those 60% Linux workloads, is lot of money.

    Also plenty of Azure, anything CNCF related, is mostly Go and Rust.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • CSharpRepl

    A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.

    I can’t speak to Rust but there have been plenty of C# repls in the past.

    https://fuqua.io/CSharpRepl/ For one

  • language

    Design of the Dart language

    Thanks, I appreciate the explanation a lot! I find losing the type hints because I am forced to type something as "dynamic" is a bummer, I hope exhaustive pattern matching solves this.

    Related issue https://github.com/dart-lang/language/issues/83

  • awesome-dotnet

    A collection of awesome .NET libraries, tools, frameworks and software

    You really should google before you make remarks...

    > No-one's writing a database server

    RavenDB, which can be run in a cluster, and uses less CPU (and I've read memory) than MongoDB itself.

    There's also a recent C# based redis drop-in replacement that outperforms redis.

    See more: https://github.com/quozd/awesome-dotnet?tab=readme-ov-file#d...

    As for identity, you sound really silly when you consider it is literally built-in to ASP .NET itself, and can be expanded upon to your hearts desire, plus there's no shortage of available identity management libraries in C#.

    As for source code repository, I'm not sure what you mean, but for years Microsoft hosted CodePlex which was essentially GitHub for C# projects. Visual Studio and C# projects are typically hosted on Git, I would be shocked if there's no web UI for git in C#, there's definitely plenty of applications for git in .NET

    I'm not even going to comment on business intelligence, now you're just being very lazy. You're telling me Microsoft has 0 BI tooling and SDKs? Come on.

    As for a linter, you are either trolling, or just blindly hate Microsoft for no rhyme or reason, there's more than enough linters, especially the best one of all, ReSharper, which is integrated into Rider which is a cross-platform IDE. There's also MonoDevelop, SharpDevelop, etc

    I literally spent a few weeks ago porting a .NET 3.5 app I hadn't touched in years, to .NET 8 from Ubuntu Linux, and got it running, in under 30 minutes in Project Rider.

  • sharpl

    a custom Lisp

    Why hello again :) I really appreciate your projects and noticed the web server one. With that said, I do have an ask - please prefer built-in containers unless you have to use custom ones, at least for now. You also do not need to define aliases for types accessible directly: `using Namespace.AnotherNamespace` is enough to access the types defined in the former. You don't need to re-define the alias for `AnotherNamespace` if it matches. When you have time, please look at sharpl PR which simplifies the implementation and makes it more compiler-friendly: https://github.com/codr7/sharpl/pull/2

  • core

    .NET news, announcements, release notes, and more! (by dotnet)

    All this means is Pop OS doesn’t have it published. What else now?

    https://github.com/dotnet/core/blob/main/linux.md#packages

  • dotnet

    Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK from source (by dotnet)

    The entirety of https://github.com/dotnet/dotnet (which is a VMR for full-source build of Roslyn, runtime and everything else that goes into runtime-only and SDK packages) is MIT, which is as permissive as it gets, save for CC0 or Unlicense.

    Quick search shows that SDK and runtime packages are available in the official feeds for

    Archlinux: https://archlinux.org/packages/?sort=&q=dotnet

    Fedora: https://packages.fedoraproject.org/pkgs/dotnet8.0/

    Ubuntu: https://pkgs.org/search/?q=dotnet

    I always wondered what is the motivation behind the negative comments like these on .NET submissions. Is this because .NET is mostly made by MS employees instead of Google (which is an AdTech company) or Oracle (which has a license trap JDK distribution)?

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • The Monad Invasion - Part 1: What's a Monad?

    4 projects | dev.to | 27 Feb 2024
  • Rolled my own Result<T,E> type that seems to work better than others.

    2 projects | /r/csharp | 1 Nov 2023
  • What's new in C# 12: overview

    4 projects | news.ycombinator.com | 20 Oct 2023
  • Migrating C# to Python with Claude 3.5 Sonnet.

    1 project | dev.to | 5 Sep 2024
  • Elsa-Core: A Powerful .NET Library for Building Workflows

    1 project | news.ycombinator.com | 3 Sep 2024

Did you konow that C# is
the 10th most popular programming language
based on number of metions?