The Foil: Capture-Avoiding Substitution With No Sharp Edges

10/10/2022
by   Dougal Maclaurin, et al.
0

Correctly manipulating program terms in a compiler is surprisingly difficult because of the need to avoid name capture. The rapier from "Secrets of the Glasgow Haskell Compiler inliner" is a cutting-edge technique for fast, stateless capture-avoiding substitution for expressions represented with explicit names. It is, however, a sharp tool: its invariants are tricky and need to be maintained throughout the whole compiler that uses it. We describe the foil, an elaboration of the rapier that uses Haskell's type system to enforce the rapier's invariants statically, preventing a class of hard-to-find bugs, but without adding any run-time overheads.

READ FULL TEXT
research
11/27/2020

Who is Debugging the Debuggers? Exposing Debug Information Bugs in Optimized Binaries

Despite the advancements in software testing, bugs still plague deployed...
research
05/02/2022

Giallar: Push-Button Verification for the Qiskit Quantum Compiler

This paper presents Giallar, a fully-automated verification toolkit for ...
research
02/14/2022

Practical Testing of a C99 Compiler Using Output Comparison

A simple technique is presented for testing a C99 compiler, by compariso...
research
02/25/2019

A Systematic Impact Study for Fuzzer-Found Compiler Bugs

Despite much recent interest in randomised testing (fuzzing) of compiler...
research
08/20/2018

Fungi: Typed incremental computation with names

Incremental computations attempt to exploit input similarities over time...
research
05/02/2022

Accelerating Verified-Compiler Development with a Verified Rewriting Engine

Compilers are a prime target for formal verification, since compiler bug...

Please sign up or login with your details

Forgot password? Click here to reset