UnitGenerator
csharplang


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 | - |
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
-
what do you find most frustrating about dotnet?
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
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
-
Why Tracebit is written in C#
Here's the language proposal for those that are interested.
https://github.com/dotnet/csharplang/issues/8928
-
The Untouched Goldmine of F#
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
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
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#
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
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?
https://github.com/dotnet/csharplang/blob/main/proposals/Typ...
-
Discriminated unions in 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
Type Unions for C#
-
Official proposal for Type Unions in C#
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?
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.

