UnitGenerator VS csharplang

Compare UnitGenerator vs csharplang and see what are their differences.

UnitGenerator

C# Source Generator to create value-object, inspired by units of measure. (by Cysharp)

csharplang

The official repo for the design of the C# programming language (by dotnet)
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
Nutrient – The #1 PDF SDK Library, trusted by 10K+ developers
Other PDF SDKs promise a lot - then break. Laggy scrolling, poor mobile UX, tons of bugs, and lack of support cost you endless frustrations. Nutrient’s SDK handles billion-page workloads - so you don’t have to debug PDFs. Used by ~1 billion end users in more than 150 different countries.
www.nutrient.io
featured
UnitGenerator csharplang
2 279
355 11,837
1.4% 0.9%
5.5 9.8
2 months ago 5 days ago
C# C#
MIT License -
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

UnitGenerator

Posts with mentions or reviews of UnitGenerator. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-20.
  • what do you find most frustrating about dotnet?
    8 projects | /r/dotnet | 20 Jun 2023
    You either have to do it manually or use a code generator (there are nugets for that, for example: https://github.com/Cysharp/UnitGenerator), but you absolutely can.
  • .NET 7 Preview 5 - Generic Math
    3 projects | /r/csharp | 9 Jun 2022
    You might wanna take a look at https://github.com/Cysharp/UnitGenerator we've used it on some of our systems at work and works pretty well overall as Value Objects.

csharplang

Posts with mentions or reviews of csharplang. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-01-31.
  • Why Tracebit is written in C#
    6 projects | news.ycombinator.com | 31 Jan 2025
    Here's the language proposal for those that are interested.

    https://github.com/dotnet/csharplang/issues/8928

  • The Untouched Goldmine of F#
    1 project | news.ycombinator.com | 16 Jan 2025
    C# has a much awaited and active proposal to add DUs to C# so I suspect C# will also support this once live (and continue its legacy of plucking great features from F#).

    https://github.com/dotnet/csharplang/blob/main/proposals/Typ...

  • The Monad Invasion - Part 3: Railway-Oriented Programming
    2 projects | dev.to | 15 Nov 2024
    We cannot blame Monads or ROP for this issue - it is a language limitation. In comparison, this is where a language like F# shines, as it allows us to define a discriminated union type that can carry multiple types of failures. Still, hope is possible - discriminated unions will eventually come to C#.
  • Sets, Types and Type Checking
    2 projects | news.ycombinator.com | 31 Oct 2024
    disjoint union vs union.

    Scala3 is the only programming language to implement both AFAIK.

    C# has a proposal to add both unions and disjoint unions: https://github.com/dotnet/csharplang/blob/main/proposals/Typ...

    OCaml has polymorphic variants which are open disjoint unions.

    Kotlin is looking to add union types for errors: https://youtrack.jetbrains.com/issue/KT-68296/Union-Types-fo...

    I believe Java's checked exceptions behave somewhat like union types.

  • A comparison of Rust's borrow checker to the one in C#
    14 projects | news.ycombinator.com | 30 Oct 2024
    There is a runtime (not C#) feature that has been added that is relevant to the article: ref fields in structs. Before these, only certain runtime-blessed types like Span could contain refs directly.

    In case anyone is interested, here is the spec about refs in structs and other lifetime features mentioned in the article:

    https://github.com/dotnet/csharplang/blob/main/proposals/csh...

    And here is the big list of ways .NET differs from the publish ECMA spec. Some of these differences represent new runtime features.

    https://github.com/dotnet/runtime/blob/main/docs/design/spec...

  • Net 9.0 LINQ Performance Improvements
    16 projects | news.ycombinator.com | 18 Oct 2024
    7 years ago: https://github.com/dotnet/csharplang/issues/1060

    3 years ago: https://github.com/dotnet/csharplang/blob/main/meetings/2021...

    I've given up submitting to csharplang now. It seemed like a positive when it was first open-sourced, but the proposals/issues are often just circular discussions that go nowhere. It doesn't feel (at least from the outside) that any proposal by a non-MS employee would make it thru the process unless MS needed it themselves. Which is what I was alluding to in my original post.

    I may well be wrong and maybe some proposals have made it through, but it feels like an illusion of community collaboration rather than actual community collaboration imho.

  • Why is F# code so robust and reliable?
    3 projects | news.ycombinator.com | 24 Sep 2024
    https://github.com/dotnet/csharplang/blob/main/proposals/Typ...
  • Discriminated unions in 2024
    4 projects | dev.to | 18 Sep 2024
    This means we rely on switch expressions rather than a Match function with lambdas for each case. Unfortunately, unlike lambdas, switch expressions don't allow blocks of code. However, we can emulate them like this:
  • .NET Digest #3
    2 projects | dev.to | 4 Sep 2024
    Type Unions for C#
  • Official proposal for Type Unions in C#
    16 projects | news.ycombinator.com | 7 Aug 2024
    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

What are some alternatives?

When comparing UnitGenerator and csharplang you can also consider the following projects:

vscode-csharp - Official C# support for Visual Studio Code

SharpLab - .NET language playground

UploadStream - high performance file upload streaming for dotnet

runtimelab - This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.

StronglyTypedId - A Rosyln-powered generator for strongly-typed IDs

dotnet-script - Run C# scripts from the .NET CLI.

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
Nutrient – The #1 PDF SDK Library, trusted by 10K+ developers
Other PDF SDKs promise a lot - then break. Laggy scrolling, poor mobile UX, tons of bugs, and lack of support cost you endless frustrations. Nutrient’s SDK handles billion-page workloads - so you don’t have to debug PDFs. Used by ~1 billion end users in more than 150 different countries.
www.nutrient.io
featured

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