Hazel, a live functional programming environment featuring typed holes.

5 min read Original article ↗

Quick Summary

Hazel is a live functional programming environment that is able to typecheck, manipulate, and even run incomplete programs, i.e. programs with holes. There are no meaningless editor states.

Motivation

When programming, we spend a substantial amount of our time working with program text that is not yet a formally complete program, e.g. because there are blank spots, type errors or merge conflicts at various locations.

Conventional programming language definitions assign no formal meaning to structures like these, so we are left without live feedback about the behavior of even complete portions of the program. Moreover, program editors and other tools have no choice but to resort to complex and ad hoc heuristics to provide various useful language services (like code completion, type inspection, and code navigation) without gaps in service.

We are developing a more principled approach to working with incomplete programs, rooted in (contextual modal and gradual) type theory. We model incomplete programs as programs with holes, which (1) stand for parts of the program that are missing; and (2) serve as membranes around parts of the program that are erroneous or, in the collaborative setting, conflicted.

The following papers describes our research vision in more detail.

We have collected a YouTube playlist of Hazel-related talks. Recent demos of Hazel are available in recent talks (e.g. the talk at the Topos Institute).

We are first implementing these ideas into Hazel, a web-based programming environment for an Elm/ML-like functional programming language designed around typed-hole-driven development.

Uniquely, every incomplete program that you can construct using Hazel's language of edit actions is both statically and dynamically well-defined, i.e. it has a (possibly incomplete) type, and you can run it to produce a (possibly incomplete) result. Consequently, Hazel serves as an elegant platform for research on the future of programming (and programming education).

News and Publications

Nov 2026

POPL 2027 accepted Bidirectional Type Slicing, describing our work on explaining why an expression has the type it does by computing a minimal slice of the program that reproduces the queried type.

Oct 2026

OOPSLA 2026 published Interactive Data Analysis with Lively Typed Tables describing our work on extending Hazel into a tabular programming system for interactive data analysis, introducing a gradually typed table API, live typing, and rich probes.

Oct 2026

SPLASH-E 2026 published Proof Interfaces for Exploratory Mathematics, describing our work on extending the Hazel Prover, an equational reasoning interface in Hazel, with multiple levels of automation for students and experts alike, including proof export to Rocq.

Oct 2025

OOPSLA 2025 published Incremental Bidirectional Typing via Order Maintenance describing our work on incrementalizing bidirectional type checking by borrowing techniques from incremental browser layout systems. This paper was awarded a Distinguished Paper Award!

Oct 2025

OOPSLA 2025 published Syntactic Completions with Material Obligations describing our work on the theory and implementation of syntax error correction by repair with visually materialized obligations in the Tylr system. Check out the extended version of David's talk!

Oct 2025

PROPL 2025 published A FAIR Case for a Live Computational Commons describing our proposal for reorganizing scientific work around a large-scale live programming environment.

Oct 2025

HATRA 2025 published Decomposable Type Highlighting for Bidirectional Type and Cast Systems describing our collaborators' work on user interfaces for debugging static and dynamic type errors in Hazel.

Oct 2025

VL/HCC 2025 published Hazel Deriver: A Live Editor for Constructing Rule-Based Derivations describing our work on building an educational tool for constructing natural deduction style derivations.

Sep 2025

David Moon defended his PhD dissertation, Syntactic Completions with Material Obligations. Congratulations, Dr. Moon!

Jan 2025

POPL 2025 published Grove: A Bidirectionally Typed Structure Editor Calculus describing our work on reworking the foundations of collaborative editing around commutative edit actions.

Oct 2024

OOPSLA 2024 published Statically Contextualizing Large Language Models with Typed Holes describing our work on combining language servers with large language models to dramatically improve AI code completion performance.

Oct 2024

HATRA 2024 published Learner-Centered Design Criteria for Classroom Proof Assistants describing our goals for using Hazel for teaching and learning proof.

Oct 2024

Sep 2024

NSF awarded Cyrus and Jean-Baptiste Jeannin a grant on Customizing a Classroom Proof Assistant for Mathematical Computing and Engineering Courses. This will focus on turning Hazel into a classroom proof assistant.

Jan 2024

POPL 2024 published Total Type Error Localization and Recovery with Holes describing a principled approach to localizing errors in ill-typed programs. This paper was awarded a Distinguished Paper Award!

Jan 2024

PROPL 2024 accepted Toward a Live, Rich, Composable, and Collaborative Planetary Compute Engine describing our vision for tooling for the future of large-scale computational climate science.

Jan 2024

TFP 2024 published Polymorphism with Typed Holes, a paper describing our approach to explicitly implicit polymorphism in Hazel.

Oct 2023

OOPSLA 2023 published Live Pattern Matching with Typed Holes describing our work on reasoning about programs with pattern holes. This paper was awarded a Distinguished Paper Award!

Oct 2023

VL/HCC 2023 published Gradual Structure Editing with Obligations describing our work on natural keyboard-driven structure editing.

Jan 2023

Dec 2022

Sep 2022

Sep 2022

TyDe 2022 published tylr: A Tiny Tile-Based Structure Editor describing our ongoing work on natural keyboard-driven structure editing interfaces.

June 2021

Oct 2020

Aug 2020

Jan 2019

POPL 2019 published Live Functional Programming with Typed Holes which develops a rich operational semantics for expressions with typed holes.

Sep 2018

May 2018

NSF selected the research that Cyrus, Ravi and Matthew proposed for funding.

May 2017

Jan 2017

POPL 2017 published Hazelnut: A Bidirectionally Typed Structure Editor Calculus, which defines a calculus of edit actions that insert typed holes automatically.