What is the minimal basis for Futhark?

What is the minimal basis for Futhark?

For example, consider this non-intrinsic replacement for :

This function is completely sequential and therefore has work O(n) and span O(n). In this post, I will investigate how to rewrite most of Futhark’s built-in array functions using just language constructs (like and ) and a small set of primitives, while maintaining the asymptotic performance as much as possible, and also trying to keep the actual run-time performance good. In most cases, the Futhark compiler is pretty good at rearranging array dimensions to ensure efficient access, but here we are treating a one-dimensional array as an irregular multi-dimensional array using complex index arithmetic, and the compiler will not be able to understand what is going on.

Source: futhark-lang.org