3 ms·
Sometimes, particularly in mathematical code, I want the focus to be more on the operators than the variables. I see this style all over the place on Shadertoy.
by itishappy 2y ago
Sometimes, particularly in mathematical code, I want the focus to be more on the operators than the variables. I see this style all over the place on Shadertoy.
# hyperbolic and contrived example in fake c
for (int i = 0; i < len(a) - 1; i++) {
s += a[i] ^ 2 + a[i+1] ^ 2;
}
# vs
for (int index = 0; index < len(array) - 1; index++) {
sum += array[index] ^ 2 + array[index + 1] ^ 2;
}
Arthur's style takes this way past my comfort levels, and it make sense he'd prefer array languages! Check out his Game of Life implementation:
a:{3=s-x&4=s:2(+-1+/':)/x}
https://web.archive.org/web/20220926225051/https://kparc.com/z/fun.k https://web.archive.org/web/20220926225051/https://kparc.com...
- deleted 2y ago[deleted]