Efficient Gradual Typing
Andre Kuhlenschmidt, Deyaaeldeen Almahallawi, Jeremy G. Siek

TL;DR
This paper introduces Grift, a compiler for gradual typing that uses ahead-of-time compilation and efficient coercions, achieving performance comparable to statically typed languages and eliminating slowdowns in partially typed code.
Contribution
The paper presents a novel ahead-of-time compilation approach for gradual typing with space-efficient coercions, improving performance and eliminating slowdowns.
Findings
Achieves OCaml-like performance on statically typed programs.
Reduces slowdown in partially typed code to between 0.42x and 2.36x of untyped Racket.
Eliminates overhead in statically typed code using monotonic references.
Abstract
Gradual typing combines static and dynamic typing in the same program. One would hope that the performance in a gradually typed language would range between that of a dynamically typed language and a statically typed language. Existing implementations of gradually typed languages have not achieved this goal due to overheads associated with runtime casts. Takikawa et al. (2016) report up to 100 slowdowns for partially typed programs. In this paper we present a compiler, named Grift, for evaluating implementation techniques for gradual typing. We take a straightforward but surprisingly unexplored implementation approach for gradual typing, that is, ahead-of-time compilation to native assembly code with carefully chosen runtime representations and space-efficient coercions. Our experiments show that this approach achieves performance on par with OCaml on statically typed programs…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Logic, programming, and type systems · Software Engineering Research
