The End of History? Using a Proof Assistant to Replace Language Design with Library Design

Functionality of software systems has exploded in part because of advances in programming-language support for packaging reusable functionality as libraries. Developers benefit from the uniformity that comes of exposing many interfaces in the same language, as opposed to stringing together hodgepodges of command-line tools. Domain-specific languages may be viewed as an evolution of the power of reusable interfaces, when those interfaces become so flexible as to deserve to be called programming languages. However, common approaches to domain-specific languages give up many of the hard-won advantages of library-building in a rich common language, and even the traditional approach poses significant challenges in learning new APIs. We suggest that instead of continuing to develop new domain-specific languages, our community should embrace library-based ecosystems within very expressive languages that mix programming and theorem proving. Our prototype framework Fiat, a library for the Coq proof assistant, turns languages into easily comprehensible libraries via the key idea of modularizing functionality and performance away from each other, the former via macros that desugar into higher-order logic and the latter via optimization scripts that derive efficient code from logical programs.

[1]  Georges Gonthier,et al.  Formal Proof—The Four- Color Theorem , 2008 .

[2]  Edsger W. Dijkstra,et al.  A constructive approach to the problem of program correctness , 1968 .

[3]  Douglas R. Smith,et al.  KIDS: A Semiautomatic Program Development System , 1990, IEEE Trans. Software Eng..

[4]  Stephen J. Westfold,et al.  Synthesis of Propositional Satisfiability Solvers , 2008 .

[5]  Ralf Steinbrüggen,et al.  Program Transformation Systems , 1983, CSUR.

[6]  K. Rustan M. Leino,et al.  Dafny: An Automatic Program Verifier for Functional Correctness , 2010, LPAR.

[7]  Jason Gross An extensible framework for synthesizing efficient, verified parsers , 2015 .

[8]  Peter Lammich,et al.  Applying Data Refinement for Monadic Programs to Hopcroft's Algorithm , 2012, ITP.

[9]  Arie van Deursen,et al.  Domain-specific languages: an annotated bibliography , 2000, SIGP.

[10]  Donald E. Knuth,et al.  Structured Programming with go to Statements , 1974, CSUR.

[11]  David R. Barstow Domain-Specific Automatic Programming , 1985, IEEE Transactions on Software Engineering.

[12]  Michael Hammer The design of usable programming languages , 1975, ACM '75.

[13]  Krzysztof Czarnecki,et al.  Object Grammars: Compositional & Bidirectional Mapping Between Text and Graphs , 2012, SLE 2012.

[14]  Michael D. Ernst,et al.  Fast synthesis of fast collections , 2016, PLDI.

[15]  Cyril Cohen,et al.  Refinements for Free! , 2013, CPP.

[16]  C. A. R. Hoare,et al.  Data Refinement Refined , 1986, ESOP.

[17]  Micha Sharir,et al.  Automatic data structure selection in SETL , 1979, POPL.

[18]  Armando Solar-Lezama,et al.  Programming by sketching for bit-streaming programs , 2005, PLDI '05.

[19]  Stephen N. Zilles,et al.  Programming with abstract data types , 1974, SIGPLAN Symposium on Very High Level Languages.

[20]  Armando Solar-Lezama,et al.  Deriving divide-and-conquer dynamic programming algorithms using solver-aided transformations , 2016, OOPSLA.

[21]  Adam Chlipala,et al.  The bedrock structured programming system: combining generative metaprogramming and hoare logic in an extensible program verifier , 2013, ICFP.

[22]  Allen Goldberg,et al.  DTRE - A Semi-Automatic Transformation System , 1991 .

[23]  Kunle Olukotun,et al.  Optimizing data structures in high-level programs: new directions for extensible compilers based on staging , 2013, POPL.

[24]  Jon Louis Bentley,et al.  Programming pearls: little languages , 1986, CACM.

[25]  Clément Pit-Claudel,et al.  Compilation Using Correct-by-Construction Program Synthesis , 2016 .

[26]  C. A. R. Hoare,et al.  Proof of correctness of data representations , 1972, Acta Informatica.

[27]  Dusko Pavlovic,et al.  Formal Derivation of Concurrent Garbage Collectors , 2010, MPC.

[28]  Adam Chlipala,et al.  Fiat: Deductive Synthesis of Abstract Data Types in a Proof Assistant , 2015, POPL.

[29]  Eelco Visser,et al.  The spoofax language workbench: rules for declarative specification of languages and IDEs , 2010, OOPSLA.

[30]  Sam Tobin-Hochstadt,et al.  Languages as libraries , 2011, PLDI '11.

[31]  Viktor Kuncak,et al.  Synthesis modulo recursive functions , 2013, OOPSLA.

[32]  Benjamin C. Pierce,et al.  Boomerang: resourceful lenses for string data , 2008, POPL '08.

[33]  Alexander Aiken,et al.  Data representation synthesis , 2011, PLDI '11.

[34]  Peter Lammich,et al.  Refinement to Imperative HOL , 2015, Journal of Automated Reasoning.

[35]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[36]  Ellis Horowitz,et al.  A survey of Application Generators , 1985, IEEE Software.

[37]  David Padua,et al.  Automatic derivation and implementation of signal processing algorithms , 2001, SIGS.

[38]  K. Rustan M. Leino,et al.  Program extrapolation with jennisys , 2012, OOPSLA '12.

[39]  Daan Leijen,et al.  Domain specific embedded compilers , 1999, DSL '99.