| Title: |
Gradual Typing and Evolutionary Programming Gradual typing |
| Authors: |
Aseem Rastogi; Avik Chaudhuri; Basil Hosmer |
| Contributors: |
The Pennsylvania State University CiteSeerX Archives |
| Source: |
http://www.cs.umd.edu/~aseem/grad_ti.pdf. |
| Collection: |
CiteSeerX |
| Subject Terms: |
Categories and Subject Descriptors D.3.4 [Programming Languages; Processors—Optimization; F.3.2 [Logics and Meaning of Programs; Semantics of Programming Languages—Program analysis; F.3.3 [Logics and Meaning of Programs; Studies of Program Constructs—Type structure General Terms Algorithms; Languages; Performance; Theory Keywords Gradual typing; Type inference; ActionScript |
| Description: |
Gradual typing lets programmers evolve their dynamically typed programs by gradually adding explicit type annotations, which confer benefits like improved performance and fewer run-time failures. However, we argue that such evolution often requires a giant leap, and that type inference can offer a crucial missing step. If omitted type annotations are interpreted as unknown types, rather than the dynamic type, then static types can often be inferred, thereby removing unnecessary assumptions of the dynamic type. The remaining assumptions of the dynamic type may then be removed by either reasoning outside the static type system, or restructuring the code. We present a type inference algorithm that can improve the performance of existing gradually typed programs without introducing any new run-time failures. To account for dynamic typing, types that flow in to an unknown type are treated in a fundamentally different manner than types that flow out. Furthermore, in the interests of backward-compatibility, an escape analysis is conducted to decide which types are safe to infer. We have implemented our algorithm for ActionScript, and evaluated it on the SunSpider and V8 benchmark suites. We demonstrate that our algorithm can improve the performance of unannotated programs as well as recover most of the type annotations in annotated programs. |
| Document Type: |
text |
| File Description: |
application/pdf |
| Language: |
English |
| Relation: |
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.367.6364; http://www.cs.umd.edu/~aseem/grad_ti.pdf |
| Availability: |
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.367.6364; http://www.cs.umd.edu/~aseem/grad_ti.pdf |
| Rights: |
Metadata may be used without restrictions as long as the oai identifier remains attached to it. |
| Accession Number: |
edsbas.2904689D |
| Database: |
BASE |