Collapsible Contracts: Fixing a Pathology of Gradual Typing
summary
Introduces collapsible contracts as a tree-structured replacement for opaque contract wrappers that merges new and existing contracts with a merge function that swaps client/server positions to preserve blame and drops duplicate flat checks. Implemented in Racket/Typed Racket, tested on 20 benchmarks covering about 7,000 partially typed configurations. Results show most programs unchanged, worst-case slowdowns around 1.1x, and pathological cases reduced from extreme slowdowns down to common-case overheads (speedups reported up to an order of tens of times).
AI-written summary · about
