Formalizations of programming languages typically adopt the substitution model from the lambda calculus. However, substitution creates notorious complications for reasoning and implementation. Furthermore, it is disconnected from practical implementations, which normally adopt environments and closures.
In this paper we advocate for formalizing programming languages using a novel style of small-step environment-based semantics, which avoids substitution and is closer to implementations. We present a call-by-value statically typed calculus, called λE, using our small-step environment semantics. With our alternative environment semantics programming language constructs for first-class environments arise naturally, without creating significant additional complexity. Therefore, λE also adopts first-class environments, adding expressive power that is not available in conventional lambda calculi. λE is a conservative extension of the call-by-value Simply Typed Lambda Calculus (STLC), and employs de Bruijn indices for its formalization, which fit naturally with the environment-based semantics. Reasoning about λE is simple, and in many cases simpler than reasoning about the traditional STLC. We show an abstract machine that implements the semantics of λE, and has an easy correctness proof. We also extend λE with references. We show that λE can model a simple form of first-class modules, and suggest using first-class environments as an alternative to objects for modelling capabilities. All technical results are formalized in the Coq proof assistant. In summary, our work shows that the small-step environment semantics that we adopt has three main and orthogonal benefits: 1) it simplifies the notorious binding problem in formalizations and proof assistants; 2) it is closer to implementations; and 3) additional expressive power is obtained from first-class environments almost for free.
Fri 25 OctDisplayed time zone: Pacific Time (US & Canada) change
13:50 - 15:30 | Novel Programming Concepts and ParadigmsOOPSLA 2024 at IBR West Chair(s): Tobias Wrigstad Uppsala University | ||
13:50 20mTalk | A Case for First-Class Environments OOPSLA 2024 DOI | ||
14:10 20mTalk | Deriving Dependently-Typed OOP from First PrinciplesOOPSLA 2024 Distinguished Artifact Award OOPSLA 2024 David Binder University of Tübingen, Ingo Skupin University of Tübingen, Tim Süberkrüb Aleph Alpha, Klaus Ostermann University of Tübingen DOI | ||
14:30 20mTalk | Multiverse Notebook: Shifting Data Scientists to Time Travelers OOPSLA 2024 DOI | ||
14:50 20mTalk | The Ultimate Conditional SyntaxOOPSLA 2024 Distinguished Paper Award OOPSLA 2024 Luyu Cheng Hong Kong University of Science and Technology, Lionel Parreaux HKUST (The Hong Kong University of Science and Technology) DOI | ||
15:10 20mTalk | Unifying Static and Dynamic Intermediate Languages for Accelerator Generators OOPSLA 2024 Caleb Kim Massachusetts Institute of Technology (MIT), Pai Li Cornell University, USA, Anshuman Mohan Cornell University, Andrew Butt Cornell University, Adrian Sampson Cornell University, Rachit Nigam Massachusetts Institute of Technology DOI |