Futhark Blog
futhark-lang.org · Company blog · on HN since 2016
The Futhark team writes about their purely functional array language that compiles to efficient GPU code.
What HN saysCommenters mention Futhark as an example of high-level functional constructs like map and reduce compiling to CPU or GPU code, with good documentation.
87HN people shared it
50linked it in comments
109stories submitted
1.7Kstory points
3 months agolast shared
2016people per year2026
Most-shared posts
- 1Futhark: High-performance purely functional array programming on the GPU47 people · 47 points · first shared 2016 · 1 comments on HN
- 2Futhark implements bounds checking on the GPU5 people · 9 points · first shared 2020 · discussion on HN
- 3Futhark as target language for an APL compiler5 people · 3 points · first shared 2016 · discussion on HN
- 4Fhpc16.pdf4 people · first shared 2016
- 5Performance4 people · first shared 2016
- 6Futhark – A small programming language that compiles to efficient GPU code3 people · 88 points · first shared 2016 · 15 comments on HN
- 7Why Not Tail Recursion?3 people · 3 points · first shared 2026 · discussion on HN
- 8Designing a Programming Language for the Desert2 people · 164 points · first shared 2018 · 25 comments on HN
- 9NumPy-style broadcasting in Futhark2 people · 135 points · first shared 2024 · 28 comments on HN
- 10Futhark 0.15.12 people · 74 points · first shared 2020 · 3 comments on HN
- 11Array short-circuiting2 people · 66 points · first shared 2022 · 12 comments on HN
- 12Supporting half-precision floats is annoying2 people · 65 points · first shared 2021 · 39 comments on HN
- 13The biggest semantic mess in Futhark2 people · 63 points · first shared 2025 · 8 comments on HN
- 14What it takes to add a new back end to Futhark2 people · 29 points · first shared 2025 · 1 comments on HN
- 15Higher-Order Parallel Programming2 people · 24 points · first shared 2020 · 1 comments on HN
What HN people wrote when they linked it
giovannibonetti · 2023-06-14
Functional programming can be a great way to handle parallel programming in a sane way. See the Futhark language [1], for example, that accepts high-level constructs like map and reduce, then converts them to the appropriate machine code, either on the CPU or the GPU.
[1] https://futhark-lang.org/
beyondCritics · 2023-03-06
There is also the embedded functional language futhark [0], which compiles numerical kernels to optimized c, ispc, opencl and cuda code. Parallelism is explicit using known constructs (map, reduce,...).
Documentation is excellent and there is also a SML style type system, hence you can rely on strong abstractions.
[0] https://futhark-lang.org/
shwestrick · 2022-01-14
A combination of both. This work targets multicore, but execution on the GPU is definitely possible. It's just a different line of research. I'd highly recommend taking a look at Futhark (https://futhark-lang.org/), which has a similar programming model (purely functional and parallel), but targets GPU. The compilation strategy is quite a bit different!
myco_logic · 2022-06-17
This looks really lovely, I look forward to following the maturation of Ante in the future. I've often thought that the niche of a general purpose low-level FP language was a promising space. The only other langs that fit in there are ATS[1], which is notoriously complex/difficult-to-learn, and Futhark[2], which is more GPGPU/scientific-computing specific.
We've got Rust, which is essentially a C-style lang that steals all kinds of goodies from the ML family; it's nice to see Ante as a kind of inverse to this: i.e. an ML style lang that borrows some of the nice bits from traditional imperative langs (and hopefully maintains their performance characteristics).
Looking through the language tour there already seem to be a plethora of very sensible/ergonomic design decisions here. The 'loop' and 'recur' keywords are a great feature, making a nice little functional nod towards while loops. As a long-time Haskell user the explicit currying initially turned me off, but after seeing a couple examples I can see how it's actually a very reasonable solution, and moreover the ability to curry out of order is really nice instead of having to use 'flip' or similar combinators (as a side note, the explicit currying reminds me a bit of APL's α and ω arguments in dfns, a feature I'd love to see pop up more). The paired tuples also seem like they'd be a pleasure to use; certainly a bit more flexible than tuples in other ML style langs. Making '.' the pipeline operator is also a smart bit of…
jaen · 2026-03-16
For similar languages / compilers in this area:
1. ISPC [1], the Intel® Implicit SPMD Program Compiler also compiles SIMD programs with branches and other control flow efficiently using predication/masking etc.
2. Futhark [2] compiles nice-looking functional programs into efficent parallel GPU/CPU code.
[1]: https://github.com/ispc/ispc
[2]: https://futhark-lang.org/
LargoLasskhyfv · 2025-07-07
I wondered why https://futhark-lang.org/ would have gone NIM?
cosmic_quanta · 2025-06-20
There's a niche out there where this kind of technology is appreciated. I can even appreciate the technical challenges in making an array language interpreter run fast!
However, unfortunately, the notation is so terse that I can't imagine spending the time to learn this. This looks write-only.
Is there an obvious reason to prefer a k-like language like Klong, over e.g. Futhark[0] or Accelerate[1]?
[0]: https://futhark-lang.org/
[1]: https://hackage.haskell.org/package/accelerate
oxavier · 2025-02-11
Not exactly the approach your describing, but Futhark[0] offers an alternative to CPU execution, it compiles to CUDA or OpenCL to run on GPU (or multi-threaded CPU).
[0] https://futhark-lang.org/
zfnmxt · 2024-07-01
Location: US & Europe
Remote: No preference
Willing to relocate: Yes
Technologies: Functional programming, type systems, language design, compilers, parallel programming languages, GPU programming, Haskell.
Résumé/CV: See https://rschenck.com
Email: See https://rschenck.com
I'm a soon-to-be-graduating PhD student at the University of Copenhagen looking for either an industry job or a postdoc. My PhD work has been on the functional array programming language Futhark (https://futhark-lang.org/), including work on the type system (sum types, rank polymorphism) and automatic differentiation. I'm broadly interested in all things type systems/functional programming/compilers/language design. I can work in both the US and the EU without a visa.
Athas · 2024-06-18
The best answer is that you probably don't want to use Futhark for that - it's a specialised, rather restricted language. There are ways to encode irregular arrays, but it's not even remotely as ergonomic as in other languages (it can be plenty fast, however). For a particularly simple example, see https://futhark-lang.org/examples/triangular.html
In the future, or in a future similar language, one might well imagine an ability to "box" arrays, like in APL, which would allow true "arrays of arrays" with no restrictions on sizes.
kaba0 · 2023-11-12
Not for mixed CPU/GPU, but there is the concept of a superoptimizer, that basically brute forces for the most optimal correct code. But it is not practical, besides using for very very short program snippets (and they are usually CPU-only, though there is nothing fundamental why it couldn’t utilize the GPU as well).
There is also https://futhark-lang.org/ , though I haven’t tried it, just heard about it.
nh2 · 2023-10-28
Futhark (https://futhark-lang.org) is an example of a functional language specifically designed for writing "normal" high-level functional code that compiles to parallel execution.
LaszloKv · 2023-09-29
You might want to look into Futhark https://futhark-lang.org/
Munksgaard · 2023-06-19
Shameless plug for Futhark[0], which you can use to write your computational kernels. The idea is to use functional constructs like map and reduce to express parallel code and let the compiler handle the generation of low-level OpenCL or CUDA.
Disclaimer: I've recently finished a PhD focused on memory optimizations in Futhark.
[0]: https://futhark-lang.org/
Edit: They do actually mention stuff like Julia and NumPy.
chowells · 2022-10-14
Eh. Most functional languages actually serialize operations pretty linearly in their default evaluation model, which is why they have explicit constructs for parallelism and concurrency.
There are some languages that are intended to parallelize implicitly, though. They tend to use keywords like "data-parallel" and "array language" to describe themselves. Futhark is a good example: https://futhark-lang.org/
rowanG077 · 2022-03-08
Probably possible, but you would really need some more concrete information.
For some easy experimentation with GPUs I would advise looking at Futhark. It's super easy to setup and get started.
https://futhark-lang.org/
servytor · 2021-12-16
I think Futhark[0] is close to that, no? Or what about Co-DFNS[1]?
[0]: https://futhark-lang.org/
[1]: https://github.com/Co-dfns/Co-dfns
rscho · 2021-05-21
https://futhark-lang.org/
Is the closest you'll get to that, I think. It took a whole team of big brains to make it, and the author stated it was highly non-trivial to make something like that.
cpach · 2021-04-13
In case anyone else wonders what Futhark means in this context – it’s a programming language: https://futhark-lang.org/
As someone who grew up in Sweden, Futhark to me is a runic alphabet :) https://en.wikipedia.org/wiki/Elder_Futhark
lalaithion · 2020-09-05
This exact view is why https://futhark-lang.org/ is exciting to me; it's currently designed mainly for GPUs, but a lower-level CPU bytecode could be a new backend for it if CPU developers ever decide to expose it.
127 · 2019-12-22
At this point Python/Numpy is really the array processing language I prefer to use. You can even use libraries like Cupy to switch the backend from BLAS/LAPACK to Nvidia CUDA libraries, which makes it lightning fast, often improving performance by 100x. And the requirement for arcane runes in Numpy is much less than APL or J.
Also the various libraries and functionalities that plug into Numpy is countless and extremely powerful.
There's also https://futhark-lang.org/ which might be an improvement in writing array processing kernels.
rusk · 2019-12-03
I wonder is this something that Futhark [0] could be used for?
[0] https://futhark-lang.org/
EDIT pleased to discover that the native `bpftrace` language is based on awk!
vbarrielle · 2019-08-18
There's a research language that supports compile-time checking of array dimensions: futhark [1]. It's an interesting language that compiles to CUDA or OpenCL. However it's probably not ready for production (not sure if there's even good linear algebra implementations yet). It does feature interesting optimizations to account for the possible size ranges of the arrays (the development blog is very instructive in that respect).
[1] https://futhark-lang.org/
PeCaN · 2018-07-12
In case anyone is wondering about why this project puts so much importance on things being inlineable, GPUs often don't support function calls or have an extremely shallow return stack.
In this way it reminds me of http://futhark-lang.org/ somewhat, though Futhark is explicitly targeted at producing extremely efficient GPU code.
bgongfu · 2018-05-28
No experience, and not APL; but [0] pops up on my radar now and then.
[0] https://futhark-lang.org/
Buttons840 · 2017-10-11
The Futhark language is the closest thing to "APL for the GPU" I'm aware of.
https://futhark-lang.org/
fulafel · 2016-08-24
There are some attempts, like http://futhark-lang.org/
One problem is that you have to codegen to meager intermediate languages that are fragmented & buggy (OpenCL or GLSL), or go proprietary with just one set of bugs and features (CUDA) but with much limited user base.
Also GPU software stacks are very crashy, have roots in the culture of testing all shaders for driver bugs before shipping in apps ("your game/app is buggy and poorly qa'd if user pc crashes") and only
recently has been slightly exposed to dynamic workloads by WebGL (which is only a OpenGL ES 2 subset, impls invest major engineering effort to work around driver bugs, and still had/has big crash problems).
fenollp · 2016-06-27
Makes me think of http://futhark-lang.org/ in terms of semantics.
adamnemecek · 2024-09-03
gilmi · 2023-04-28
You might be interested in https://futhark-lang.org