r/ProgrammingLanguages • u/Athas Futhark • Aug 05 '26
Finally adding recursive functions to Futhark
https://futhark-lang.org/blog/2026-08-05-recursion.html
65
Upvotes
r/ProgrammingLanguages • u/Athas Futhark • Aug 05 '26
21
u/TOMZ_EXTRA Aug 05 '26
a little typo seems to have sneaked in
5
u/matthieum Aug 05 '26
Would you have less data movement if you used masking instead?
That is, instead of partitioning the output, you'd produce a mask of the elements in the array which need to be recursed over, then invoke the flattened function with the mask and the array. No recombination would be necessary.
(And of course, the initial call to the flattened function would be invoked with a "full" mask)
9
u/Anthea_Likes Aug 05 '26
Futhark is such a great inspiration to me. Thank you for your work 😊
1
u/KittenPowerLord Aug 06 '26
> we do not plan to support actual tail call optimisation for reasons previously explained).
the link 404s, it should have .html instead of .md at the end
1
u/categorical-girl Aug 13 '26
In my mind, Futhark was mostly defined by its restrictions over, say, NESL. With the recent changes to allow recursion and non-uniform nested parallelism, how would you describe Futhark? NESL but with smarter compiler transformations?