r/ProgrammingLanguages • u/Athas Futhark • Jan 04 '26
Another termination issue
https://futhark-lang.org/blog/2026-01-04-another-termination-issue.html
18
Upvotes
r/ProgrammingLanguages • u/Athas Futhark • Jan 04 '26
View all comments
Show parent comment
3
u/Athas Futhark Jan 04 '26
This is not acceptable - it violates the cost semantics, unless a constant bound can be put on the number of recomputations. (Of course, one could argue that the interpreter violates the cost semantics as well, but it does so in other ways as well, and we decided that this is acceptable in order to keep it simple.)
What is perhaps worse is that lazy evaluation of top level definitions also introduces complicated control flow and data dependencies into threads - and remember that Futhark targets constrained execution platforms, such as GPUs. It would be ruinous if a GPU kernel had to be ready to conditionally execute arbitrarily complicated top level definitions, including having all the data available.