2 ms·
It's not directly related, but this reminds me a bit of Zig's treatment of compile-time parameters [1], which seems somewhat more natural than generic parameter
by skybrian 8y ago
It's not directly related, but this reminds me a bit of Zig's treatment of compile-time parameters [1], which seems somewhat more natural than generic parameters in most languages.
Zig doesn't go all the way, though. Instead, a type parameter could be any combination of a compile-time and runtime parameter, depending how it's used.
I do wonder how that affects calling conventions, though? If have separate linking then we probably need to avoid changing the calling convention if a function is modified so that a parameter is used in a different way.
[1] https://andrewkelley.me/post/zig-programming-language-blurs-line-compile-time-run-time.html#compile-time-parameters https://andrewkelley.me/post/zig-programming-language-blurs-...