Looking into Zig
Zig looks overall interesting to me, but I don&#x27;t like that it reproduces one of the pains of C++ templates, i.e. their dynamic typing. What I mean is, C++ templates aren&#x27;t checked before being executed, and instead you get compilation errors (at c++ templates runtime) which mangle the use and definition of templates, e.g.<p><pre><code>  template&lt;typename T&gt;
  concept HasId =
  requires (T a) {
      T::kId; &#x2F;&#x2F; &quot;the expression T::kId is a valid expression that will compile&quot;
  };

  &#x2F;&#x2F; A and B are expected to be structs, where each has an associated integer constant kId and a field &quot;int value&quot;.
  template &lt;HasId A, HasId B&gt;
  int min_id(const A a, const B b) {
    if (A::kId &lt; B::kIs) {
        return a.value;
    } else {
        return b.value;
    }
  }

  struct A0 {
    static constexpr int kId = 1;
    int value;
  };

  struct A1 {
    static constexpr int kId = 2;
    int value;
  };

  &#x2F;&#x2F; etc.

  struct A180 {
    static constexpr int kId = 2;
    int value;
  };

  int main() {
      (void)min_id(A0(), A1());
      (void)min_id(A1(), A2());
      &#x2F;&#x2F; etc. ending with:
      (void)min_id(A179(), A180());
  }

</code></pre>
And now you get 180 errors about your typo (if not for max error number limits in the compiler), when really there is only one error in the definition of min_id. I used concepts to show that in the long tradition of C++, they&#x27;re an additional feature that doesn&#x27;t really help (quantity over quality of features).<p>Haskell solves that with typeclasses, Rust solves that with traits. What&#x27;s really important about these solutions is that when you write a function generic over a trait or a typeclass, you are limited to using what is defined in the trait&#x2F;typeclass. The trait&#x2F;typeclass function both as documentation and as something that gets you better compilation errors.<p>&quot;typename&quot; in C++ is basically &quot;any&quot;, but for values of template execution. Typeclasses&#x2F;traits on the other hand are a sort of types for those values (which we normally call &quot;types&quot;). And similarly, in Zig there is an &quot;any&quot; type for types, just like in C++ --- it&#x27;s called &quot;type&quot;, and AFAIK there is no way to constrain your types with types of types.