POPL '90 Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
POPL '90 Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Dynamic typing in a statically typed language
ACM Transactions on Programming Languages and Systems (TOPLAS)
PLDI '91 Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation
Practical experience with an application extractor for Java
Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Towards partially evaluating reflection in Java
PEPM '00 Proceedings of the 2000 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
A framework for interprocedural optimization in the presence of dynamic class loading
PLDI '00 Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation
Dynamic optimistic interprocedural analysis: a framework and an application
OOPSLA '01 Proceedings of the 16th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Static Checking of Dynamically Generated Queries in Database Applications
Proceedings of the 26th International Conference on Software Engineering
Tracking bad apples: reporting the origin of null and undefined value errors
Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems and applications
RPython: a step towards reconciling dynamically and statically typed OO languages
Proceedings of the 2007 symposium on Dynamic languages
Improved Static Resolution of Dynamic Class Loading in Java
SCAM '07 Proceedings of the Seventh IEEE International Working Conference on Source Code Analysis and Manipulation
The design and implementation of typed scheme
Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
The ruby programming language
ECOOP '07 Proceedings of the 21st European conference on ECOOP 2007: Object-Oriented Programming
Static type inference for Ruby
Proceedings of the 2009 ACM symposium on Applied Computing
Staged information flow for javascript
Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation
Programming Ruby 1.9: The Pragmatic Programmers' Guide
Programming Ruby 1.9: The Pragmatic Programmers' Guide
The ruby intermediate language
DLS '09 Proceedings of the 5th symposium on Dynamic languages
Precise analysis of string expressions
SAS'03 Proceedings of the 10th international conference on Static analysis
Towards a type system for analyzing javascript programs
ESOP'05 Proceedings of the 14th European conference on Programming Languages and Systems
Towards type inference for javascript
ECOOP'05 Proceedings of the 19th European conference on Object-Oriented Programming
Tests to the left of me, types to the right: how not to get stuck in the middle of a ruby execution
Proceedings for the 1st workshop on Script to Program Evolution
The ruby intermediate language
DLS '09 Proceedings of the 5th symposium on Dynamic languages
Optimizing dynamic dispatch with fine-grained state tracking
Proceedings of the 6th symposium on Dynamic languages
Dynamic inference of static types for ruby
Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Konoha: implementing a static scripting language with dynamic behaviors
Workshop on Self-Sustaining Systems
Proceedings of the 2011 ACM Symposium on Applied Computing
Taming reflection: Aiding static analysis in the presence of reflection and custom class loaders
Proceedings of the 33rd International Conference on Software Engineering
Always-available static and dynamic feedback
Proceedings of the 33rd International Conference on Software Engineering
Pragmatic reuse in web application development
Proceedings of the 33rd International Conference on Software Engineering
Polymorphic type inference for scripting languages with object extensions
Proceedings of the 7th symposium on Dynamic languages
Application optimization when using gradual typing
Proceedings of the 6th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems
The ins and outs of gradual type inference
POPL '12 Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Remedying the eval that men do
Proceedings of the 2012 International Symposium on Software Testing and Analysis
Eval begone!: semi-automated removal of eval from javascript programs
Proceedings of the ACM international conference on Object oriented programming systems languages and applications
Proceedings of the ACM international conference on Object oriented programming systems languages and applications
Proceedings of the 34th ACM SIGPLAN conference on Programming language design and implementation
Proceedings of the 28th Annual ACM Symposium on Applied Computing
An empirical study of PHP feature usage: a static analysis perspective
Proceedings of the 2013 International Symposium on Software Testing and Analysis
Fissile type analysis: modular checking of almost everywhere invariants
Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
Hi-index | 0.00 |
Many popular scripting languages such as Ruby, Python, and Perl include highly dynamic language constructs, such as an eval method that evaluates a string as program text. While these constructs allow terse and expressive code, they have traditionally obstructed static analysis. In this paper we present PRuby, an extension to Diamondback Ruby (DRuby), a static type inference system for Ruby. PRuby augments DRuby with a novel dynamic analysis and transformation that allows us to precisely type uses of highly dynamic constructs. PRuby's analysis proceeds in three steps. First, we use run-time instrumentation to gather per-application profiles of dynamic feature usage. Next, we replace dynamic features with statically analyzable alternatives based on the profile. We also add instrumentation to safely handle cases when subsequent runs do not match the profile. Finally, we run DRuby's static type inference on the transformed code to enforce type safety. We used PRuby to gather profiles for a benchmark suite of sample Ruby programs. We found that dynamic features are pervasive throughout the benchmarks and the libraries they include, but that most uses of these features are highly constrained and hence can be effectively profiled. Using the profiles to guide type inference, we found that DRuby can generally statically type our benchmarks modulo some refactoring, and we discovered several previously unknown type errors. These results suggest that profiling and transformation is a lightweight but highly effective approach to bring static typing to highly dynamic languages.