Comptime – C# meta-programming with compile-time code generation and evaluation
1–10 of 71 posts
Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#2Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#3Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#4Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#5This seems like the kind of feature that should be built into MSBuild.
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.
Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#6This seems like the kind of feature that should be built into MSBuild.
It's a lot less ergonomic but there are source generators in C# : 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…
Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#7This seems like the kind of feature that should be built into MSBuild.
It's a lot less ergonomic but there are source generators in C# : 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…
https://github.com/sebastienros/comptime/blob/main/test/Comp...
But you need to be sure you won’t want to change without compiling.
Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#8Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#9Alas 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/
Re: Comptime – C# meta-programming with compile-time code generation and evaluation
#10Makes me think of Boo language; Boo was so good at metaprogramming and multi-phasr programming! A very fine .NET language that was so far ahead of the curve, with having the tools of that language be usable at runtime. 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…