📣 Help Shape the Future of UKRI's Gateway to Research (GtR)

We're improving UKRI's Gateway to Research and are seeking your input! Tell us what works, what doesn't, and how we can make GtR more user-friendly, impactful, and effective for the Research and Innovation community. Please send your feedback to gateway@ukri.org by 11 August 2025.

Hardware Acceleration of Functional Languages (HAFLANG)

Lead Research Organisation: Heriot-Watt University
Department Name: S of Mathematical and Computer Sciences

Abstract

The performance of programming language implementations until 10 years ago relied on increasing clock frequencies on uni-core CPUs. The last decade has seen the rise of the multi-core era adding processing elements to CPUs, to enable general purpose parallel computing.

Due to a single connection from multiple cores on a CPU to main memory, general purpose languages with parallelism support are finding the limits of general purpose CPU architectures that have been extended with parallelism. The fabric on which we compute has changed fundamentally.

Driven by the needs of AI, Big Data and energy efficiency, industry is moving away from general purpose CPUs to efficient special purpose hardware e.g. Google's Tensorflow Processing Unit (TPU) in 2016, Huawei's Neural Processing Unit (NPU) in smartphones, and Graphcore's Intelligent Processing Unit (IPU) in 2017. This reflects a wider shift to special purpose hardware to improve execution efficiency.

Functional languages are gaining widespread use in industry due to reduced development time, better maintainability, code correctness with assistance of static type checkers, and ease of deterministic parallelism. Functional language implementations overwhelmingly target general purpose CPUs, and hence have limited control over cache behaviour, sharing, prefetching and garbage collection locality. As such, they are reaching their performance limits due to the trade-off between parallelism and memory contention. This project takes the view that rather than using compiler optimisations to squeeze small incremental performance improvements from CPUs, special purpose hardware on programmable FPGAs may instead be able to provide a step change improvement by moving these non-deterministic inefficiencies into hardware.

Graph reduction is a functional execution model that offers intriguing opportunities for developing radically different processor architectures. Early ideas stem back to the 1980s, well before the age of advanced Field Programmable Gate Array (FPGA) technology of the last 5-10 years.

We believe that a bespoke FPGA memory hierarchy for functional languages could minimise memory traffic, thus avoiding the costs of cache misses and memory access latencies that quickly become the bottleneck for medium and large sized functional programs. We believe that lowering key runtime system components (prefetching, garbage collection, parallelism) to hardware, with a domain specific instruction set for graph reduction, will significantly reduce runtimes.

We aim to inspire the computer architecture community to extend this project by developing accurate cost models for functional languages that target special purpose functional language hardware.

Our HAFLANG project will target the Xilinx Alveo U280 accelerator board, a state-of-the-art UltraScale+ FPGA-based platform as a research vehicle for developing the FPU. The HAFLANG compilation framework will be designed to be extensible, and hence make the FPU processor a target for other languages in future.

By developing a hardware accelerator, we believe it is possible to engineer a processor that (1) will execute programs with twice the throughput compared with GHC compiled Haskell executing on conventional mid-tier 4-16 core x86/x86-64 CPUs, and (2) consumes four times less energy than by executing programming languages on CPUs.
 
Title Dataset for "Cloaca: A Concurrent Hardware Garbage Collector for Non-Strict Functional Languages" 
Description This dataset provides the sources for the Heron (including the Cloaca GC), its testing, and scripts used to generate the paper's results. Where possible, each directory comes with a README guide and a nix environment to assist reproducibility. 
Type Of Material Database/Collection of data 
Year Produced 2024 
Provided To Others? Yes  
Impact The dataset includes the hardware implementation of the Cloaca garbage collector for others to use and reproduce the results. 
URL https://researchportal.hw.ac.uk/en/datasets/68b8a67f-2684-47fa-bcec-1f97dcb98446
 
Title Dataset for results in "Heron: Modern Hardware Graph Reduction" 
Description Dataset results for our Implementation of Functional Languages (IFL) 2023 paper "Heron: Modern Hardware Graph Reduction" 
Type Of Material Database/Collection of data 
Year Produced 2024 
Provided To Others? Yes  
Impact The results of the IFL 2023 paper are in this repository. 
URL https://doi.org/10.17861/b9ab6ca4-a86c-4bf0-b6f3-e462129b6ebb
 
Title Dataset for the Heron Core in "Heron: Modern Hardware Graph Reduction" 
Description The software source code for the Heron architecture presented in our accepted IFL 2023 paper. 
Type Of Material Database/Collection of data 
Year Produced 2024 
Provided To Others? Yes  
Impact The Clash description of the Heron processor is available as open source software. 
URL https://doi.org/10.17861/f4fab5ef-ae98-4300-8328-ea59e47ff8c6
 
Title Source code for the Heron Core in "Heron: Modern Hardware Graph Reduction" and garbage collector "Cloaca: A Concurrent Hardware Garbage Collector for Non-Strict Functional Languages" 
Description The Clash description of the Heron processor is available as open source software. The software source code for the Heron architecture presented in our accepted IFL 2023 paper and the hardware-based garbage collector our accepted Haskell 2024 paper. The DOI points to the IFL 2023 implementation. The GitHub repository contains both the IFL 2023 and Haskell 2024 implementations. 
Type Of Technology Software 
Year Produced 2023 
Open Source License? Yes  
Impact Presented at IFL 2023 and our HAFDAL 2024 workshop. The software was released at the end of 2023, so we hope that potential external impact will be realised over the next year or two. 
URL https://doi.org/10.17861/f4fab5ef-ae98-4300-8328-ea59e47ff8c6
 
Description Blog posts with informal dissemination of early ideas and results 
Form Of Engagement Activity A broadcast e.g. TV/radio/film/podcast (other than news/press)
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact The postdoc wrote three blog posts on the project's website in March 2023. These describe, with accessible language, the early ideas and preliminary results for this project.

https://haflang.github.io/posts/2023-03-07-memo_01.html

https://haflang.github.io/posts/2023-03-08-memo_02.html

https://haflang.github.io/posts/2023-03-13-memo_03.html
Year(s) Of Engagement Activity 2023
URL https://haflang.github.io/posts/2023-03-07-memo_01.html
 
Description International workshop 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact The PI (Rob Stewart) and the PDRA (Craig Ramsay) chaired a workshop in Edinburgh. It brought together 8 speakers from the UK, Europe and America, who share research interests on computer architectures for high level programming languages. It was co-located with HPCA, PPoPP, CGO and CC. The talks were recorded and uploaded to YouTube to widen the potential impact of our workshop.
Year(s) Of Engagement Activity 2024
URL https://haflang.github.io/workshops/hafdal24.html
 
Description Invited research seminar at AMD Research Labs - "A Hello From HAFLANG: Hardware Acceleration of Functional Languages" 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach Regional
Primary Audience Industry/Business
Results and Impact Research presentation to AMD/Xilinx project partners about the Heron processor design and initial results using AMD/XIlinx FPGA hardware.
Year(s) Of Engagement Activity 2023
URL https://haflang.github.io/
 
Description Invited research seminar at Heriot-Watt University - "HAFLANG's Foundation for Hardware Graph Reduction" 
Form Of Engagement Activity A formal working group, expert panel or dialogue
Part Of Official Scheme? No
Geographic Reach Local
Primary Audience Professional Practitioners
Results and Impact 15 people within the Heriot-Watt's Dependable Systems Group attended the talk.
Year(s) Of Engagement Activity 2023
URL https://haflang.github.io
 
Description Invited research seminar at University of Glasgow - "Introducing the HAFLANG Project: Hardware Acceleration of Functional Languages" 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach Regional
Primary Audience Other audiences
Results and Impact The project's postdoc gave a research seminar in the computer science department at the University of Glasgow. Title " Introducing the HAFLANG Project: Hardware Acceleration of Functional LANGuages". There were 20 people in the room, and 15 people online at this hybrid event.
Year(s) Of Engagement Activity 2022
URL https://www.dcs.gla.ac.uk/plug/
 
Description Invited research seminar at University of Gothenburg - "Introducing the HAFLANG Project: Hardware Acceleration of Functional Languages" 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact The Co-I (Craig Ramsay) presented the Heron and Cloaca technologies (IFL'23 and Haskell'24) to the The Functional Programming research group at the University of Gothenburg.
Year(s) Of Engagement Activity 2024
 
Description Invited research seminar at the University of Edinburgh - "HAFLANG's Foundation for the Hardware Acceleration of Functional Languages" 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach Local
Primary Audience Professional Practitioners
Results and Impact About 20 academic members of staff at the School of Engineering, University of Edinburgh, attended this talk.
Year(s) Of Engagement Activity 2023
URL https://haflang.github.io/
 
Description Web page on functional architectures history 
Form Of Engagement Activity Engagement focused website, blog or social media channel
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Robert Stewart (PI) curated an interactive web-based history of functional language architectures in June 2023. As of March 2024, the page has received 2512 views.
Year(s) Of Engagement Activity 2023
URL https://haflang.github.io/history.html