Skip to content

Latest commit

 

History

History

elab-stlc-abstract

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Abstract elaboration for STLC

The translation of a high level, user friendly surface language into a small, typed core language is a useful pattern for implementing typed programming languages. We call this elaboration because it fills in details that were otherwise implicit, and it is used in the implementations of languages such as GHC Haskell, Idris and Coq.

Unfortunately elaborators can get rather complicated because type checking, desugaring and error reporting are all fused together. This project explores a way to alleviate this burden on the elaborator by taking an LCF-inspired approach for the core language. Instead of type checking and constructing core terms within the elaborator, we instead move this behind trusted inference rules defined in the core (see Core.mli). Elaboration no longer needs to interact with core terms directly, and can instead focus on desugaring and error reporting (see Surface.ml).

Todo

  • Elaboration of lambda terms
  • Elaboration tests
  • Unification and metavariables
  • Collect multiple errors during elaboration

Resources

Presentations:

  • Robert Atkey, “An Algebraic Approach to Typechecking and Elaboration” (URL)
  • Andrej Bauer, “Derivations as computations”, ICFP’19 (Video) (URL) (Slides)
  • John Harrison, “The LCF Approach to Theorem Proving” (Slides)

Related projects: