Futhark: A Pure, Functional Language For GPU Computing

Written by Michael Larabel in Programming on 15 February 2017 at 07:47 AM EST. 24 Comments
PROGRAMMING
Futhark was presented earlier this month at FOSDEM as a "purely functional array language" with its compiler able to "efficiently generate high-performance GPU code."

Futhark is a high-level, parallel-focused programming language that aims to compete with the performance of hand-written code targeting particular GPUs. Futhark hopes to be more portable across GPUs while tapping into the full GPU potential if you were writing finely-tuned code targeting a particular graphics processor. Futhark's compiler currently translates this code into OpenCL for GPU execution, but I'm told by one of the attendees at FOSDEM for this event, Futhark is also working on an approach to turn their code into pure-OpenGL for execution on GPUs without OpenCL, CUDA, or Vulkan.

Futhark appears like an interesting effort. Some details can be found via this FOSDEM event page while there are the PDF slides but not yet any video recording. Here is a basic look at Futhark's syntax with a factorial program:
fun fact (n: i32): i32 = reduce (*) 1 (map (1+) (iota n))

fun main (n: i32): i32 = fact n

Besides being able to convert Futhark into OpenCL, their compiler is also able to convert back into sequential C code for easy testing and validation. Those wanting to learn more can visit Futhark-Lang.org and the GitHub site.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week