Corpse reviver: sound and efficient gradual typing via contract verification
نویسندگان
چکیده
Gradually typed programming languages permit the incremental addition of static types to untyped programs. To remain sound, insert run-time checks at boundaries between and code. Unfortunately, performance studies have shown that overhead these can be disastrously high, calling into question viability sound gradual typing. In this paper, we show by building on existing work soft contract verification, reduce or eliminate overhead. Our key insight is while code cannot trusted a type system, there no need consider only worst case when optimizing gradually program. Instead, statically analyze portions program prove almost all dynamic implied fail, eliminated compile time. analysis modular, applied any portion We evaluate approach dozen programs previously prohibitive overhead—with median 2.5× up 80.6× in case—and most cases, suffering 1.5× case.
منابع مشابه
Efficient Gradual Typing
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×...
متن کاملSpace-Efficient Gradual Typing
Gradual type systems offer a smooth continuum between static and dynamic typing by permitting the free mixture of typed and untyped code. The runtime systems for these languages—and other languages with hybrid type checking—typically enforce function types by dynamically generating function proxies. This approach can result in unbounded growth in the number of proxies, however, which drasticall...
متن کاملGradual Typing with Efficient Object Casts
Gradual type systems meld dynamic typing with optional static types, moderating between the two with statically inserted casts. Casting is the éminence grise of such systems — it enables swift detection of type errors in dynamic code without enforcing runtime checks throughout a program, and in combination with blame tracking it allows such errors to be traced to their origin. However, such cas...
متن کاملMonotonic References for Efficient Gradual Typing
Gradual typing enables both static and dynamic typing in the same program and makes it convenient to migrate code regions between the two typing disciplines. One goal of gradual typing is to provide all the benefits of static typing, such as efficiency, in statically-typed regions. However, this goal is elusive: the standard approach to mutable references imposes run-time overhead in statically...
متن کاملGradual typing for Smalltalk
Being able to combine static and dynamic typing within the same language has clear benefits in order to support the evolution of prototypes or scripts into mature robust programs. While being an emblematic dynamic object-oriented language, Smalltalk is lagging behind in this regard. We report on the design, implementation and application of Gradualtalk, a gradually-typed Smalltalk meant to enab...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Proceedings of the ACM on programming languages
سال: 2021
ISSN: ['2475-1421']
DOI: https://doi.org/10.1145/3434334