4 comments

  • smcnc34 minutes ago
    I think Zig really shines here: <a href="https:&#x2F;&#x2F;ziglang.org&#x2F;documentation&#x2F;master&#x2F;#comptime" rel="nofollow">https:&#x2F;&#x2F;ziglang.org&#x2F;documentation&#x2F;master&#x2F;#comptime</a>
  • CharlieDigital3 hours ago
    C# meta programming game is strong. Source generators are :chefs_kiss:
  • mfro3 hours ago
    This seems like the kind of feature that should be built into MSBuild.
    • eterm2 hours ago
      It&#x27;s a lot less ergonomic but there are source generators in C# :<p><a href="https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;dotnet&#x2F;introducing-c-source-generators&#x2F;" rel="nofollow">https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;dotnet&#x2F;introducing-c-source-g...</a><p>That said, for more complex results, you&#x27;d typically load a serialization on start.<p>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&#x27;d prefer to just serialize, store and load.<p>It also needs to be something that is dynamic at compile time but not at runtime.<p>So it&#x27;s very niche, but it&#x27;s an interesting take on the concept, and it looks easier to use than the default source generators.
      • richardw1 hour ago
        Not terribly niche. All config that isn’t environment-specific and is used in inner loops or at startup. It’s even got a test for serialised values so can be used to speed your case up:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;sebastienros&#x2F;comptime&#x2F;blob&#x2F;main&#x2F;test&#x2F;Comptime.Tests&#x2F;CSharpSerializerTests.cs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sebastienros&#x2F;comptime&#x2F;blob&#x2F;main&#x2F;test&#x2F;Comp...</a><p>But you need to be sure you won’t want to change without compiling.
      • piskov2 hours ago
        Also t4 templates before that for at least a decade
  • mgaunard3 hours ago
    So it&#x27;s like C++ consteval?