Roslyn
csharp-source-generators
Our great sponsors
Roslyn | csharp-source-generators | |
---|---|---|
157 | 9 | |
18,499 | 1,874 | |
0.8% | - | |
10.0 | 7.7 | |
about 13 hours ago | 7 days ago | |
C# | ||
MIT License | Creative Commons Zero v1.0 Universal |
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.
Roslyn
-
The Performance Impact of C++'s `final` Keyword
.NET is a little smarter about switch code generation these days: https://github.com/dotnet/roslyn/pull/66081
-
Generating C# code programmatically
Recently, while creating some experimental C# source code generators (xafero/csharp-generators), I was just concatenating strings together. Like you do, you know, if things have to go very quickly. If you have a simple use case, use a formatted multi-line string or some template library like scriban. But I searched for a way to generate more and more complicated logic easily - like for example, adding raw SQL handler methods to my pre-generated DBSet-like classes for my ADO.NET experiment. You could now say: Use Roslyn and that's really fine if you look everything up in a website like SharpLab, which shows immediately the syntax tree of our C# code.
- Still No REPL for .NET Core in Visual Studio
-
Roslyn VS Metalama.Compiler - a user suggested alternative
2 projects | 7 Dec 2023
- Por debaixo do capô: async/await e as mágicas do compilador csharp
-
Use Case Driven Development with Low-Code
At runtime, the Case C# expressions are embedded into a function and dynamically compiled into an assembly using the Roslyn C# compiler. Then the function that contains the expression is called (e.g. CaseAvailableFunction.Availablle()). At runtime, the function provides various methods to access stored case values as well as the current input data.
- Interceptors
- Tentative C# 12 feature list · dotnet/roslyn · Discussion #69074
- Do you guys think this programmer is right about dotnet?
csharp-source-generators
- Any type providers implemented in C# using source generators
-
Custom intellisense error or warning feedback?
I don't know of anything out of the box that would emit errors/warnings for a case like that, but if it was something you were dealing with often enough you could certainly write your own analyzer if one doesn't already exist.
-
Embedded source generation?
List of source generators: https://github.com/amis92/csharp-source-generators
-
What are the hardest topics in C#/.NET you would like to know more/better?
I also couldn't find many info in docs nor more advanced tutorials, but this list of source generators helped me as an inspiration.
-
Why is no-one using Roslyn token-based code generation with Source Generators?
I'm planning to rewrite all of our company's old T4-based codegen tools into Source Generators. I've been looking at how other Source Generators are implemented and what surprised me is that everyone seems to assemble the output code manually as text with string builders or at best some simple templating engine (eg. Scriban). I expected that I would see a lot of projects assembling their output code from Roslyn tokens and then using Roslyn's formatter to produce the actual code that can be emitted into the output file(s), like this article demonstrates. No-one seem to be doing that though. Why?
-
Source generator library
Start from here: C# Source Generators
-
Getting into source generators in .Net
Look here under 'Tips & Tricks'
-
The C# Source Generators revolution
Source generators colletion
-
HttpClientGenerator is a tool that uses the Roslyn code generator feature to write boilerplate HttpClient code for you.
Add it to this list https://github.com/amis92/csharp-source-generators
What are some alternatives?
Mono-basic - Visual Basic Compiler and Runtime
dotnet - .NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
MSBuild - The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
ResXFileCodeGenerator - VocaDb.ResXFileCodeGenerator is a C# source generator to generate strongly-typed resource classes for looking up localized strings.
F# - Please file issues or pull requests here: https://github.com/dotnet/fsharp
stronginject - compile time dependency injection for .NET
ClojureCLR - A port of Clojure to the CLR, part of the Clojure project
NullGuard - Adds null argument checks to an assembly
Bridge.NET - :spades: C# to JavaScript compiler. Write modern mobile and web apps in C#. Run anywhere with Bridge.NET.
HttpClientCodeGenerator - HttpClientGenerator is a tool that uses the Roslyn code generator feature to write boilerplate HttpClient code for you.
Roslyn-linq-rewrite - Compiles C# code by first rewriting the syntax trees of LINQ expressions using plain procedural code, minimizing allocations and dynamic dispatch.
dotnet-options-generator - Generate and register IOptions from appsettings.json at compile-time with source generators.