Solving the Funarg Problem with Static Types

08/17/2021
by   Caleb Helbling, et al.
0

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 also discuss other solutions present in other programming languages that solve the funarg problem but haven't been formally discussed in the literature.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/20/2019

QuB: A Resource Aware Functional Programming Language

Managing resources—file handles, database connections, etc.—is a hard pr...
research
02/11/2020

Modeling Programs Hierarchically with Stack-Augmented LSTM

Programming language modeling has attracted extensive attention in recen...
research
11/29/2019

Juniper: A Functional Reactive Programming Language for the Arduino

This paper presents the design and implementation of Juniper: a function...
research
09/06/2022

Jeopardy: An Invertible Functional Programming Language

Algorithms are ways of mapping problems to solutions. An algorithm is in...
research
06/16/2022

The Case for a Wholistic Serverless Programming Paradigm and Full Stack Automation for AI and Beyond – The Philosophy of Jaseci and Jac

In this work, the case is made for a wholistic top-down re-envisioning o...
research
08/30/2019

Declarative Programming for Microcontrollers – Datalog on Arduino

In this paper we describe an approach to programming microcontrollers ba...

Please sign up or login with your details

Forgot password? Click here to reset