log in  |  register  |  feedback?  |  help  |  web accessibility
Smart Levels: Deferring Work in ML Type Inference, Correctly
Justus Croskery
Thursday, October 29, 2026, 12:30-1:30 pm
  • You are subscribed to this talk through .
  • You are watching this talk through .
  • You are subscribed to this talk. (unsubscribe, watch)
  • You are watching this talk. (unwatch, subscribe)
  • You are not subscribed to this talk. (watch, subscribe)
Abstract

Type inference is a critical part of the compiler for strongly typed languages like OCaml. The type inference engine manages competing priorities. On the one hand, its performance is crucial for LSP responsiveness. On the other, type safety relies on the correctness of type inference. OCaml's type inference includes many complex performance-related optimizations, and even more have been suggested. However, formalization efforts have been lagging behind. We examine the OCaml levels system, an implementation technique for generalization in which high-profile bugs have been found. We introduce Smart Levels, a type inference algorithm for a Hindley-Milner calculus that combines existing level optimizations in OCaml with a previously proposed scheme for deferred level updates. We formalize these optimizations and provide a roadmap to proving them correct.

This talk is organized by Segev