Solving the Funarg Problem with Static Types
Caleb Helbling, F{\i}rat Aksoy

TL;DR
This paper introduces a static type-based extension to System F that enables stack allocation of closures, addressing the funarg problem in memory-constrained embedded systems like Arduino.
Contribution
It proposes a novel type system extension for the prenex fragment of System F that allows closures to be stack-allocated, reducing memory fragmentation in embedded environments.
Findings
Implemented in Juniper language for Arduino devices
Demonstrated effective stack allocation of closures
Compared with other solutions in programming languages
Abstract
The difficulty associated with storing closures in a stack-based environment is known as the funarg problem. The funarg problem was first identified with the development of Lisp in the 1970s and hasn't received much attention since then. The modern solution taken by most languages is to allocate closures on the heap, or to apply static analysis to determine when closures can be stack allocated. This is not a problem for most computing systems as there is an abundance of memory. However, embedded systems often have limited memory resources where heap allocation may cause memory fragmentation. We present a simple extension to the prenex fragment of System F that allows closures to be stack-allocated. We demonstrate a concrete implementation of this system in the Juniper functional reactive programming language, which is designed to run on extremely resource limited Arduino devices. We…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Security and Verification in Computing · Parallel Computing and Optimization Techniques
