23 ms·
"In which people who have never used a language with compile-time expressions try Zig and think it's novel" Not knocking Zig, I think it's swell, but it wasn't
by gavinray 4y ago
"In which people who have never used a language with compile-time expressions try Zig and think it's novel"
Not knocking Zig, I think it's swell, but it wasn't near the first language with this feature. D comes to mind, and C++ has it now with "constexpr" and "consteval".
- anonymoushn 4y agoI've ported a small Zig program to C++ and spent a long time and a lot of lines of code on the stuff that comptime can do which C++ cannot.
- gavinray 4y agoI'd be curious for examples. In a weird spot where I'm decently familiar with C++, D, and Zig and it would make for good blogpost material to compare comptime implementations for the same thing across languages IMO.
- WalterBright 4y agoI've posted some examples here for D.
- socialdemocrat 4y agoThe purpose was to pick interesting features to talk about and select one language for each feature which is a good exponent for that features. For instance I used Smalltalk to cover image based development: https://erikexplores.substack.com/p/what-makes-smalltalk-unique https://erikexplores.substack.com/p/what-makes-smalltalk-uni... Yet Smalltalk was not the first language supporting image based development. I would pick Julia to talk about multiple dispatch. Likewise Zig is picked not because it is the first doing comptime but because that is a central feature of Zig and it is a language which really puts emphasis on it.