Gradual typing allows mixing static and dynamic typing in a single language, but partially typed programs can suffer unexpected performance degradation when type annotations are added naively. This research presents a technique to selectively choose a subset of type annotations—derived via type inference—to improve execution performance in gradually typed programs. The approach uses a lightweight, amortized method that selects annotations along data flows to minimize expensive runtime casts at typed/untyped boundaries. Evaluated on Reticulated Python, the technique outperforms using all inferred annotations and achieves comparable execution speed to existing approaches while maintaining more stable compilation times.

2m read timeFrom programming-journal.org
Post cover image
Table of contents
Abstract

Sort: