News for hackers. Stuff that matters.
Re:Interview with Zig language creator Andrew Kelley [video] by littlestymaar on Thursday August 27, 2020 @03:54PM (#24297905)
> But if you have generics and procedural macros, it turns out that you can do the work of both with a feature that's simpler than either.

Here I think we just have a different subjective perception of what simplicity is. I much prefer have two orthogonal systems which do their own business than having a single more powerful tool than do both (like having slices + references instead of the all powerful pointer)

Anecdotal note: more than 10 years ago, the Go team pitched why they didn't need generics nor macros, because code generation would solve both problems (+ others), and now they're on their way back to add generics to Go (with a lot of hassle).

Re:Interview with Zig language creator Andrew Kelley [video] by pron on Thursday August 27, 2020 @04:56PM (#24298572)
> I much prefer have two orthogonal systems which do their own business than having a single more powerful tool than do both (like having slices + references instead of the all powerful pointer)

OK, but that's not quite the situation. Here we're talking about languages that have, or will have, the single "more powerful" construct, and also the more specific, special case one, as two separate constructs, even though one of them would have sufficed.

Again, Zig has parameterized types, and very elegant and powerful ones -- they're functions that take some types as argument and return a type. It just doesn't have generics as a separate construct. Rather, it is a special case of a more general one (that Rust and C++ will also have).

Re:Interview with Zig language creator Andrew Kelley [video] by int_19h on Wednesday September 02, 2020 @07:08PM (#24359257)
Zig comptime functions that take and return structs consisting partially (or wholly!) of types reminds me of OCaml functors, and should perhaps be compared to them rather than generics.