FlashFill and Programming by Example

FlashFill is a feature in Microsoft Excel that automatically transforms text based on examples a user types, and it grew out of the research paper “Automating String Processing in Spreadsheets using Input-Output Examples” by Sumit Gulwani, presented at the POPL programming-languages conference in January 2011. It is one of the most widely deployed examples of programming by example, where a user demonstrates a few input-output pairs and the system infers a program that generalizes the pattern.

Under the hood, Gulwani designed a small string-processing language supporting restricted regular expressions, conditionals, and loops, and an algorithm that searches that language for a program consistent with the examples the user provided. When a user starts typing the desired output for a column, FlashFill synthesizes such a program and fills the rest automatically. The paper later received the Most Influential POPL Paper Award, and the prototype even synthesized part of itself.

FlashFill matters because it put automatic program synthesis in front of hundreds of millions of ordinary spreadsheet users years before large language models, proving that end users could direct a computer to write code without knowing how to program. For businesses it remains a clear illustration of the value of inferring intent from examples, the same idea that underlies much of today’s AI assistance.