The first paper describes a technology for automating string transformations such as converting “FirstName
LastName” to “LastName FirstName.”
This technology was released as the
Flash Fill feature in Microsoft Excel
( https://youtu.be/w-k9WjRJvIY). The
paper motivates the design of an expressive DSL (domain-specific language) that is also restricted enough
to allow for efficient search. The inspiration came from studying spreadsheet help forums, wherein end users
solicited help for string transformations, while describing their intent
using examples. The paper describes
a domain-specific search algorithm
that achieves real-time efficiency,
breaking from the previous community tradition of reducing the search
problem to querying an off-the-shelf
general-purpose constraint solver.
The latter, while allowing quicker
prototyping, lacks the effectiveness of
a custom solution.

The paper also gives first-class
treatment to dealing with ambiguity,
instead of requiring a larger number
of examples, thus improving usabil-ity and trust. The search algorithm
returns a huge set of programs (
represented succinctly) that satisfy the
examples, and a ranking function
that prefers small programs with few
constants is used to guess an intended program.

The success of Flash Fill inspireda wave of interest in both academiaand industry for developing PBE tech-nologies for other domains, includ-ing number/date transformations,tabular data extraction from log files/Web pages/JSON documents, and re-formatting tables. With data scien-planations of computations—mustbe replaced, but it is too soon to saywhich approaches will come to domi-nate. Industry has led in the designand particularly in the populariza-tion of large-scale tracing systems inreaction to a practical need: under-standing the causes of user-perceivedlatency for online services. As thesesystems become common infrastruc-ture, we will find that this use case isonly the tip of the iceberg. The abilityto ask and answer rich “why” ques-tions about distributed executionswill continue to engender new re-search that improves the consistency,predictability, and fault tolerance ofmassive-scale systems.

Peter Alvaro is an assistant professor of computer
science at UC Santa Cruz, where he leads the Disorderly
Labs research group ( disorderlylabs.github.io).

ProgrammingBy ExamplesBy Sumit Gulwani

Programming by examples (PBE) is the task of
synthesizing or searching
for a program from an underlying program space that satisfies a given set of
input-output examples.

A key challenge in PBE is to develop
an efficient search algorithm that can
discover a program that is consistent
with the examples. Various search techniques have been developed, including
deductive methods, use of constraint
(SAT/SMT) solvers, smart heuristics
for enumerative search, and stochastic search. Another key challenge in
PBE is to deal with the ambiguity in
intent specification, since there are
many programs that satisfy the given
examples but not the user’s intent.
Ranking techniques are used to predict
an intended program from within the
set of programs consistent with the examples. Interaction techniques are used
in a refinement loop to converge to an
intended program.

PBE has varied applications. It allows end users, 99% of whom are non-programmers, to create small scripts
for automating repetitive tasks from
examples. It facilitates software development activities, including program refactoring, superoptimization,
and test-driven development. The following sample of recently published

A key challengein programmingby example is todevelop an efficientsearch algorithmthat can discovera program that isconsistent with theexamples.