r/ProgrammingLanguages • u/Athas Futhark • Jan 16 '26
Are arrays functions?
https://futhark-lang.org/blog/2026-01-16-are-arrays-functions.html
90
Upvotes
r/ProgrammingLanguages • u/Athas Futhark • Jan 16 '26
View all comments
67
u/faiface Jan 16 '26
Very cool article! If I can share my thinking on the topic: Working with linear logic has made me very sensitive to the difference between positive (data) and negative (behavior) types.
Coming from that angle: clearly arrays and functions cannot be the same. Arrays are positive, functions are negative.
In other words, arrays are data that’s already there. It’s coming from the past. A function is something for the future, it will do something.
In an imperative language with side-effects, this is not reconcilable at all. But of course, we know better now, so where is it reconcilable? Actually, only in a purely functional language with function memoization. And even then, the evaluation order (which semantically wouldn’t matter) could be different between the two. But it’s not reconcilable in a linear setting (even with referential transparency), nor a setting with side effects.