Computer Science Colloquium


Dynamic, Recursive, Heterogeneous Types in Statically-Typed Languages

Richard Saunders
Rincon Research

Date: Monday September 13, 2021
Time: 2:30pm MDT
Room: Zoom https://zoom.us/j/92386679162, Meeting ID 923 8667 9162, tel. +13126266799,,92386679162#
            A large-screen showing will be held in Speare Hall room 19 for the CSE 585 class

   Abstract:

Today's modern software projects are written in many different languages: Python, C++, Perl, Java, Javascript, Lua, Unicon, C... All co-exist within a complex environment implementing different components of a system. This proliferation of languages causes dynamically-typed language concepts to infiltrate statically-typed languages. One important idea that seems ubiquitous across dynamic languages is the dynamic, recursive, heterogeneous dictionary: the Python dict, Perl hash, Javascript object, Lua table, and Icon/Unicon table are all realizations of this abstraction. JSON and, to a lesser extent, XML are language-agnostic versions of the dynamic dictionary. Statically typed languages (like C++ and Java) historically have trouble expressing and dealing with dynamic dictionaries without clumsy libraries. This paper explores how to represent dictionaries in C++ by introducing a simple, novel solution for dealing with dynamic constructs by embracing unique statictyping features of the C++ language: type-inference, user-defined conversions, type selection, and overloading. Taken all together, these static features paradoxically make dynamic dictionaries much easier to manipulate from C++, approaching the ease of dynamic dictionary manipulation in dynamic languages. Note that these techniques do not require special reflection facilities/libraries.

Bio:

Rich Saunders is a senior member of the technical staff at Rincon Research Corporation, where he works as a software engineer and computer scientist. In his free time, he is a guitarist and board game designer. He holds a BS in Computer Science from University of New Mexico and an MS in Computer Science from the University of Arizona.