Remix.run Logo
foltik 3 hours ago

It’s one specific low-level abstraction, which is well defined: the primitive building blocks a higher level abstraction is built on and oblivious to.

Zig’s comptime is the primitive. Sum types, generics, etc. are things you can build on top.

The original example is the type-level equivalent of looking at:

  int foo() {
    return 4;
  }
and saying “why do I need all this function and return ceremony when I can just write the number 4 verbatim?”