The ability to look up the definition of a variable is an essential feature of modern programming tooling. Beyond the simple code browsing action of jumping to that definition, it is a preliminary for more advanced tasks like fetching documentation or refactoring. The operation of finding a definition requires deep knowledge of a language’s semantics to prevent finding erroneous positions in the presence of overlapping names, shadowed values, or complex features like module systems with includes and functor applications.
While imprecise results are tolerable for an \emph{interactive} “jump to definition” use case, where the user can immediately assess the relevance of the definition the tool shows him, they are less acceptable for wider use cases like finding all the usages of a definition: it is not obvious whether the list is complete or not.
We present recent additions to the OCaml compiler that assist tools in answering the origin question correctly and efficiently. Indeed OCaml is equipped with a full-featured module system that greatly complicates the search for definitions. To handle this complexity we designed a simple language whose terms are called Shapes. Shapes are an abstract representation of modules which allow us to track definitions through functor applications and other module-level operations.
Paper (shapes.pdf) | 354KiB |
Thu 15 SepDisplayed time zone: Belgrade, Bratislava, Budapest, Ljubljana, Prague change
14:00 - 15:30 | |||
14:00 20mTalk | Necro ML: Generating OCaml Interpreters ML Pre-print File Attached | ||
14:20 20mTalk | Module Shapes for Modern Tooling ML File Attached | ||
14:40 20mTalk | An OCaml use case for strong call-by-need reduction ML | ||
15:00 20mTalk | Do Mutable Variables Have Reference Types? ML Oleg Kiselyov Tohoku University, Japan Pre-print |