Just-in-Time Static Type Checking for Dynamic Languages
Brianna M. Ren, Jeffrey S. Foster

TL;DR
Hummingbird introduces just-in-time static type checking for Ruby, enabling thorough static analysis even with complex metaprogramming, while maintaining reasonable performance overhead.
Contribution
It presents a novel approach combining dynamic method signature collection with static type checking at runtime, formalized and proven sound.
Findings
Successfully typechecked six real-world Ruby apps including Rails
Detected and fixed hidden type errors in Rails app versions
Achieved reasonable performance overhead for dynamic code analysis
Abstract
Dynamic languages such as Ruby, Python, and JavaScript have many compelling benefits, but the lack of static types means subtle errors can remain latent in code for a long time. While many researchers have developed various systems to bring some of the benefits of static types to dynamic languages, prior approaches have trouble dealing with metaprogramming, which generates code as the program executes. In this paper, we propose Hummingbird, a new system that uses a novel technique, just-in-time static type checking, to type check Ruby code even in the presence of metaprogramming. In Hummingbird, method type signatures are gathered dynamically at run-time, as those methods are created. When a method is called, Hummingbird statically type checks the method body against current type signatures. Thus, Hummingbird provides thorough static checks on a per-method basis, while also allowing…
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Software Engineering Research · Advanced Malware Detection Techniques
