Serenity: Library Based Python Code Analysis for Code Completion and Automated Machine Learning

01/05/2023
by   Wenting Zhao, et al.
6

Dynamically typed languages such as Python have become very popular. Among other strengths, Python's dynamic nature and its straightforward linking to native code have made it the de-facto language for many research areas such as Artificial Intelligence. This flexibility, however, makes static analysis very hard. While creating a sound, or a soundy, analysis for Python remains an open problem, we present in this work Serenity, a framework for static analysis of Python that turns out to be sufficient for some tasks. The Serenity framework exploits two basic mechanisms: (a) reliance on dynamic dispatch at the core of language translation, and (b) extreme abstraction of libraries, to generate an abstraction of the code. We demonstrate the efficiency and usefulness of Serenity's analysis in two applications: code completion and automated machine learning. In these two applications, we demonstrate that such analysis has a strong signal, and can be leveraged to establish state-of-the-art performance, comparable to neural models and dynamic analysis respectively.

READ FULL TEXT
research
05/10/2018

Ariadne: Analysis for Machine Learning Program

Machine learning has transformed domains like vision and translation, an...
research
06/11/2021

Toward Efficient Interactions between Python and Native Libraries

Python has become a popular programming language because of its excellen...
research
09/07/2021

Improving Dynamic Code Analysis by Code Abstraction

In this paper, our aim is to propose a model for code abstraction, based...
research
06/28/2022

Gradual Soundness: Lessons from Static Python

Context: Gradually-typed languages allow typed and untyped code to inter...
research
02/24/2022

Scalpel: The Python Static Analysis Framework

Despite being the most popular programming language, Python has not yet ...
research
05/15/2023

Transactional Python for Durable Machine Learning: Vision, Challenges, and Feasibility

In machine learning (ML), Python serves as a convenient abstraction for ...
research
08/30/2023

The Janus System: Multi-paradigm Programming in Prolog and Python

Python and Prolog express different programming paradigms, with differen...

Please sign up or login with your details

Forgot password? Click here to reset