News for hackers. Stuff that matters.
Re:Zig's Comptime Is Bonkers Good by Quekid5 on Tuesday January 07, 2025 @05:08AM (#42621040)
You're not wrong, but is at the very least weird that a specialization doesn't conform to the concept that the general template does. Something which proper parametricity would have avoided -- if it were available.

(The Hysterical Raisins are understandable, esp. given that it wasn't even possible to specify Concepts in C++ until 2020...)

Re:Zig's Comptime Is Bonkers Good by HelloNurse on Tuesday January 07, 2025 @05:58AM (#42621269)
The point is exactly that the "concept" of what the template should do is informal and a careful, detailed specification in a far more expressive language than vintage C++ would be needed to elicit good compilation errors from something like vector<bool>.

Proper parametricity is only a starting point: types that specify alignment, equality and lifetimes would be needed to make it useful.