5 ms·
I know very little Zig, but I agree with the post, that comptime seems simple, obvious and powerful. It is interesting that it bears some surface level similar
by agbell 5y ago
I know very little Zig, but I agree with the post, that comptime seems simple, obvious and powerful.
It is interesting that it bears some surface level similarities to type constructors in languages with higher kinded types.
- naasking 5y agoYes, and in principle you can generalize the type language into a full language with lambdas and such (type constructor is a lambda(ground type)->ground type), though you typically want it to be strongly normalizing so you know that the compiler will eventually halt. Then you don't need kinds, kind polymorphism, sorts, etc., you just have a dependently typed language with types and universes.
- agbell 5y agoYeah, functions returning types based on computations in Zig can look a lot like Idris if you squint