Gradualizing data structures: a promising and novel approach

In the article “Gradually Structured Data” by Éric Tanter, associate researcher at IMFD, Stefan Malewski, PhD student, and researcher Michael Greenberg from the Stevens Institute of Technology (USA), a form of gradualness is proposed that would allow reconciling dynamic and static data structures seamlessly. Recently accepted at the ACM’s OOPSLA 2021 conference, the research has been very well received for its novel approach to the problem: “Nobody had thought about this before; people have been working on gradual type systems for over 15 years, but the issue of data structuring had never been looked at as something that could be gradualized,” explains Tanter, faculty member of the Department of Computer Science at Universidad de Chile.

Data structures are the way chosen to organize data in a program. “It is not at the database level, but rather when you retrieve the data from a database within the program and map it to the structure. Just as in the database field, there is a trade-off between dynamic and static structures: the former are more flexible but more prone to errors during execution; while static ones are more rigid, provide greater control of checks at programming time, and ensure the absence of certain errors during execution,” explains the researcher. In the article, the application of gradualness—which has various applications and uses in type systems and verifiers—is proposed for this problem of how to structure data.

“Instead of saying: you have to decide -once and for all- whether you are going to opt for statically structured data or not, this will allow you to move between the two extremes” and thus combine properties of dynamic and static structures according to real needs, he adds. The researchers develop, formalize, and prototype a novel approach to gradually structuring data with algebraic data types: gradually structured data allows closing the gap between traditional algebraic data types and flexible data management mechanisms. “We illustrate the key ideas of gradual algebraic data types through the evolution of a concrete application, we formalize a functional language with gradually structured data, and establish its metatheory, including gradual guarantees,” Tanter states. Additionally, Stefan Malewski implemented a prototype available online to demonstrate the use of this novel mechanism, which was approved in OOPSLA’s artifact evaluation process.

OOPSLA 2021 is a prestigious ACM conference that seeks contributions in all aspects of programming languages and software engineering.