Papers for

programming language developers

Papers whose findings have a practical use for this group, as judged from the abstract. Open a paper to read what it means in practice.

Guarded recursion support embedded in Lean for safer programming

Garlene: Guarded Recursion in Lean

Abstract: Extending the recursion principles of a formal system is an enticing but dangerous endeavour with a well-documented history of leading to consistency bugs. Nakano's guarded recursion is an elegant, type-based approach to soundly extend type theory with a powerful recursion principle. This makes guarded recursion useful for many applications, from programming with infinite structures such as streams to reasoning about advanced programming language features using synthetic guarded domain theory. Sadly, guarded recursion is not directly supported by any major interactive theorem prover, which leaves users of guarded recursion with unmechanised pen-and-paper proofs or mechanisations that depend on unmaintained theorem provers. In this paper, we present an implementation of guarded recursion as an embedded language in Lean consisting of a simply-typed lambda calculus for definitions and a higher-order logic for reasoning. Using Lean's excellent support for metaprogramming, our language allows users to write guarded recursive definitions in an intuitive syntax and to prove properties about them using a dedicated proof mode. We give our language a presheaf model, which we use to prove the soundness of our language and to allow users to export guarded recursive definitions and their theorems into standard Lean developments. To demonstrate the usefulness of our language, we present several case studies for programming and reasoning with guarded recursion.

Mon 21 SeptLogic in Computer ScienceProgramming Languages
The gist
Extending recursion rules in formal systems can cause serious errors, but a technique called guarded recursion helps prevent these problems. The authors created a tool inside the Lean theorem prover that allows writing and reasoning about guarded recursive definitions more safely. They built a special model to prove their tool works correctly and let users move their guarded recursion work into standard Lean code. This makes it easier to work with infinite structures and advanced programming concepts in Lean.
Open 2609.24345v1

Monadic interpreter and checker keep type effects separate in haskell

A monadic interpreter and type-and-effect checker

Abstract: We present a concrete implementation in Haskell of a monadic framework that includes both a small-step interpreter and a type-and-effect checker for the corresponding language. Our approach separates the language syntax from the semantics of its effects. This design allows the interpreter to remain parametric over the underlying monad, while the static checker approximates effects independently of their concrete implementation. The theoretical foundation of this framework-applied to a call-by-value lambda calculus with generic effects represented by operations that produce monadic values and are managed through handlers-was introduced in previous work, where the focus was on proving the soundness of the approach. In contrast, the present work leverages Haskell's support for modular programming and monads to demonstrate that the framework is practically implementable and usable. We illustrate the approach with examples using the monad of exceptions and the one of nondeterminism and expressions both with and without handlers.

Mon 7 SeptProgramming Languages
The gist
Programs often have side effects like errors or running multiple options, and it's useful to keep track of these effects when running or analyzing code. The authors show how to build a small-step interpreter and a type-and-effect checker using Haskell that cleanly separates the syntax of a language from how these effects work. This allows different kinds of effects to be plugged in without changing the core interpreter, and a checker can estimate effects without depending on their exact details. Their work demonstrates that a previously theoretical framework can be implemented practically in Haskell and used with examples like exceptions and nondeterminism.
Open 2609.07667v1