Predicting Variable Types in Dynamically Typed Programming Languages

01/16/2019
by   Abhinav Jangda, et al.
0

Dynamic Programming Languages are quite popular because they increase the programmer's productivity. However, the absence of types in the source code makes the program written in these languages difficult to understand and virtual machines that execute these programs cannot produced optimized code. To overcome this challenge, we develop a technique to predict types of all identifiers including variables, and function return types. We propose the first implementation of 2^nd order Inside Outside Recursive Neural Networks with two variants (i) Child-Sum Tree-LSTMs and (ii) N-ary RNNs that can handle large number of tree branching. We predict the types of all the identifiers given the Abstract Syntax Tree by performing just two passes over the tree, bottom-up and top-down, keeping both the content and context representation for all the nodes of the tree. This allows these representations to interact by combining different paths from the parent, siblings and children which is crucial for predicting types. Our best model achieves 44.33% across 21 classes and top-3 accuracy of 71.5% on our gathered Python data set from popular Python benchmarks.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/26/2018

A General Path-Based Representation for Predicting Program Properties

Predicting program properties such as names or expression types has a wi...
research
08/02/2018

Debugging Native Extensions of Dynamic Languages

Many dynamic programming languages such as Ruby and Python enable develo...
research
03/21/2021

Language-Agnostic Representation Learning of Source Code from Structure and Context

Source code (Context) and its parsed abstract syntax tree (AST; Structur...
research
10/27/2019

TreeCaps: Tree-Structured Capsule Networks for Program Source Code Processing

Program comprehension is a fundamental task in software development and ...
research
07/27/2023

CodeLens: An Interactive Tool for Visualizing Code Representations

Representing source code in a generic input format is crucial to automat...
research
10/26/2018

AutoParallel: A Python module for automatic parallelization and distributed execution of affine loop nests

The last improvements in programming languages, programming models, and ...
research
01/24/2023

Bridging Swift Error Handling Model to C++

Error handling is the process of responding to and recovering from error...

Please sign up or login with your details

Forgot password? Click here to reset