CC 2025
Sat 1 - Sun 2 March 2025

The dot is a highly valued piece of syntactic real estate. Programming languages use the dot for a range of programming constructs: In object-oriented languages, the dot is used for field and method access on classes and objects. In imperative languages, the dot is often used for field access on structs. And finally, in functional languages, the dot is often used for field access on records. In other languages, the dot is used to access the length of arrays and to index into tuples.

The dot is minimal yet aesthetically pleasing. More importantly, the dot is the great enabler of auto-completion. Programmers with a specific entity in mind (e.g., an object, struct, or record) can use the dot to trigger auto-completion to be presented with a list of operations available on the entity. This simple feature improves the programming experience and makes it easier to learn new APIs.

In this paper, we explore how to overload the dot to support various programming constructs within one language while supporting type inference. We present a principled approach to overloading based on type classes extended with associated types, associated effects, and compiler-generated type classes and instances. We implement the design in the Flix programming language and evaluate its impact on compiler performance and on the quality of error messages.