Leroy: Library Learning for Imperative Programming Languages
summary
Leroy converts Python programs to a lisp-like AST and runs Stitch to extract repeated fragments, then prunes and patches candidates back into valid Python functions. On 122 test programs it prunes roughly 3,000 malformed or too-small abstractions, yields six usable abstractions applied about 2.5 call sites each, and achieves about 1.04x compression (≈4% size reduction). The pipeline detects macro-like fragments, fixes missing returns and parameters, and rejects call sites that break loop-updated variables.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 0:45Library Learning overview
- 3:43Extending Stitch to Python
- 5:31Lispifying Python for Stitch
- 6:12Filtering Stitch abstractions
- 8:24Augmenting abstractions to Python
- 9:28Validating abstraction call sites
- 10:54Evaluating Leroy on Python
- 12:41Future plans and limits
- 13:03Summary and discussion
- 13:23Q&A
- 13:46Supercompilation and abstractions
- 14:27Analysis time and scalability
- 15:50Imports and cycles
- 17:16Reusable abstractions
- 18:42Six abstractions details
- 19:26Closing remarks
related talks
19mPyDex: Repairing Bugs in Introductory Python Assignments using LLMs
28mAutomated transpilation of imperative to functional code using neural-guided program synthe
40mGenetic Programming in Clojure
25mInductive Synthesis of Structurally Recursive Functional Programs from Non-recur...
54mProgramming Language Design and Implementation for the Machine Learning Era: A Personal(…)
43mA Case Study of Natural Language Processing in Clojure
34mFinding and creating gambiarras with python ASTs
42mDeveloping the Wolfram Language Compiler
