Description #
Futhark is a high-performance, purely functional language designed for parallel programming on GPUs and multi-core CPUs.
History #
Futhark was developed at the University of Copenhagen to explore how functional programming can be optimized for data-parallel computation. Its name comes from the ancient runic alphabet “Futhark.”
Hello World Code #
entry main : []u8 = map u8.i32 (map i32.u8 [72,101,108,108,111,44,32,87,111,114,108,100,33])
How to Run #
Option 1: Online
Futhark Playground
Option 2: Local
- Install via Homebrew or from source:
brew install futhark
Compile and run:
futhark opencl hello.fut
./hello
Key Concepts #
- Pure functional language
- Explicit data-parallelism
- Compiles to GPU and multicore CPU code
- Strong static typing
- Array programming focus
- Higher-order functions
- Map/reduce/fold constructs
- Fusion optimization
- Real-time numeric performance
- Academic and research use
Try It Online #
https://futhark-lang.org/playground
Fun Facts #
- Futhark can outperform C in certain parallel benchmarks due to advanced loop fusion.
- It focuses entirely on numerical computation, not general-purpose use.
- Built to test the limits of optimizing pure functional code for hardware.