Zoom. https://umd.zoom.us/j/93825468763?pwd=UXlYZmVkVndXb1owMkpYb2tOQjZFQT09
Title. Snek: Overloading Python Semantics via Virtualization
PDF. https://www.cs.purdue.edu/homes/rompf/papers/decker-preprint201907.pdf
Abstract. The Python language enjoys widespread adoption in a wide variety of domains spanning machine learning, scientific and high performance computing, and beyond. While implemented as libraries in Python, many Python frameworks aspire to be a domain-specific language (DSL), and often aim to bypass the Python interpreter. However, because Python’s inherent ability to overload built-in structures such as declarations, conditionals, or loops is limited, these frameworks are often constrained to a suboptimal, API-centric interface that replicates these built-ins with framework-specific semantics. Such an approach ultimately yields productivity losses for programmers, especially when switching between or mixing frameworks, as users must memorize an ever-expanding list of method calls for performing even simple tasks such as constructing control flow. Furthermore, API designers are forced to create new, substituting abstractions for traditional programming constructs, forcing a steep learning curve for users.
In this paper, we propose a structured methodology to allow DSL developers to use the whole of Python as a front-end, rather than creating equivalent APIs or relying on shims. Our methodology provides an extensive operator overloading and virtualization mechanism through the use of source code transformations, and enables powerful mechanisms like type-based multi-stage programming (which is popular in statically typed languages), without requiring explicit type information (e.g., via type annotations).
We implement this methodology in a system called Snek, which represents the first type-driven multi-stage programming framework for a dynamic language which does not require extra-linguistic mechanisms, and demonstrate the ability to quickly and easily provide new semantics for Python constructs.