Leroy: Library Learning for Imperative Programming Languages
Abhiram Bellur, Razan Alghamdi, Kidus Workneh, Joseph Izraelevitz

TL;DR
Leroy extends library learning to imperative languages like Python, enabling code reuse and maintenance by extracting repetitive code structures into libraries, demonstrated with a 1.04x compression ratio.
Contribution
This work introduces Leroy, a novel approach that adapts library learning techniques to imperative languages, facilitating code reuse and modularization.
Findings
Achieves 1.04x code compression ratio
Prunes invalid abstractions effectively
Works on a subset of Python programs
Abstract
Library learning is the process of building a library of common functionalities from a given set of programs. Typically, this process is applied in the context of aiding program synthesis: concise functions can help the synthesizer produce modularized code that is smaller in size. Previous work has focused on functional Lisp-like languages, as their regularity makes them more amenable to extracting repetitive structures. Our work introduces Leroy, which extends existing library learning techniques to imperative higher-level programming languages, with the goal of facilitating reusability and ease of maintenance. Leroy wraps the existing Stitch framework for library learning and converts imperative programs into a Lisp-like format using the AST. Our solution uses Stitch to do a top-down, corpus-guided extraction of repetitive expressions. Further, we prune abstractions that cannot be…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsEducational Games and Gamification · Teaching and Learning Programming · Open Education and E-Learning
