Grace
Grace copied to clipboard
Make use of Source Generators
A new feature called Source Generators is being developed by Microsoft, to be part of .NET 5 some time in the future. This is a way to implement reflection but during compilation of the assembly instead of during runtime. This should in theory have great performance and usability gains. Source Generators are implemented very similarly to Roslyn Analyzers.
Please have a look if this could be a candidate for Grace: https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/
Hi @silkfire
I've actually seen that and it looks very interesting but it's really only going to have performance benefits at startup time. Actual locate times aren't going to improve.
The big reason I find this interesting is the use case for mobile where you have concerns about compiling code, this would completely alleviate those concerns.
I'm keeping an eye on it but I'm hesitant to say this is a complete game changer for DI containers. I am however looking to use it in another project where I do IL emit.
Hi @ipjohnson Native AOT doesn't work with reflection, I think source generator for Grace would be awesome, and may be it will be the first DI that provide this feature