Dynamic Languages

Improvement of dynamic languages

We are working on providing early type error detection and better runtime performance to dynamically typed programs. Particularly, we use Python as the example dynamic language, but the outcome of our research could also be applied to other object oriented dynamic languages.

stypy is a tool to detect type errors in Python programs with no type annotations. stypy translates each Python program into Python code that type-checks the original program. The generated code replaces each variable with a type variable, evaluating expression types instead of their values. The generated type checker detects type errors in different tricky Python idioms, and ensures termination. stypy in a preliminary stage.

Eventually, we also plan to use stypy to optimize Python programs. Type information will be used to generate code that does not perform dynamic type checking. We have evaluated how type specialization techniques are used to optimize Python programs. We plan to perform these kind of optimizations statically.

We are also doing research on providing better runtime adaptability to statically typed programming languages. We instrument Java classes to use the invokedynamic opcode with the Jindy library. This library has been previously used to optimize the implementation of dynamic languages. At runtime, method invocation and field access operations are changed to consider structural intercessive operations. Method implementations are replaced with the Java agents instrument package. This project is in a preliminary stage (no work has been published yet).