Eventually I want to write a good baseline library to use for my source generators -- simplifying finding definitions with attributes, mapping types to System.Type, adding some basic pattern matching for structures -- but haven't found a way to do it that's general enough while being very useful.
That isn't as cool as Aspire and AI features.
https://devblogs.microsoft.com/dotnet/introducing-c-source-g...
That said, for more complex results, you'd typically load a serialization on start.
I can see the value in this tool, but there must be a fairly limited niche which is too expensive to just have as static and run on start-up and cache, but not so large you'd prefer to just serialize, store and load.
It also needs to be something that is dynamic at compile time but not at runtime.
So it's very niche, but it's an interesting take on the concept, and it looks easier to use than the default source generators.
https://github.com/sebastienros/comptime/blob/main/test/Comp...
But you need to be sure you won’t want to change without compiling.
const x = comptime factorial(n);
Another limitation of the C# package is it only works with primitive types and collections. Zig comptime works on any arbitrary types.Alas many of the docs are offline now. But it had great quasiquotes, which let you write code that gets turned into AST that you can then process. Good macros. A programmable compiler pipeline. So much. Alas, obscured now. https://boo-language.github.io/