What it says on the tin. We implemented this in a rather hacky way, without having to keep around stack information at runtime, by relying on the fact that the Futhark compiler currently performs aggressive inlining of all functions. This allows us to compute “stack traces” at compile time, and simply annotate every possible error location. We will have to improve this in the future, but it works well enough for now.

This is an exotic improvement that will become more important once we start performing more speculative parallelisation. For now, the main consequence is that the library implementation of radix sort can be mapped in parallel, which can be used to compute row medians .

We could previously define replicate as follows:

let replicate 't (n: i32) (x: t): *[n]t = i32.replicate n x

But we could only describe the type (in e.g. module types) as:

val replicate: 't: i32 -> t -> *[]t

because function types could not contain parameter names. With this change, we can give the more detailed type of replicate:

val replicate: 't: (n: i32) -> t -> *[n]t

This makes the generated documentation <https://futhark-lang.org/docs/futlib/array.html>_ slightly more readable.