Language embeddings that preserve staging and safety
Nordic Journal of Computing
LCSD '07 Proceedings of the 2007 Symposium on Library-Centric Software Design
Generic flow-sensitive optimizing transformations in C++ with concepts
Proceedings of the 2010 ACM Symposium on Applied Computing
SSDGP'06 Proceedings of the 2006 international conference on Datatype-generic programming
Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs
GPCE '10 Proceedings of the ninth international conference on Generative programming and component engineering
Language virtualization for heterogeneous parallel computing
Proceedings of the ACM international conference on Object oriented programming systems languages and applications
Multi-stage programming with functors and monads: Eliminating abstraction overhead from generic code
Science of Computer Programming
Green-Marl: a DSL for easy and efficient graph analysis
ASPLOS XVII Proceedings of the seventeenth international conference on Architectural Support for Programming Languages and Operating Systems
Multi-stage programming with functors and monads: eliminating abstraction overhead from generic code
GPCE'05 Proceedings of the 4th international conference on Generative Programming and Component Engineering
Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs
Communications of the ACM
Avalanche: a fine-grained flow graph model for irregular applications on distributed-memory systems
Proceedings of the 1st ACM SIGPLAN workshop on Functional high-performance computing
Synchronous digital circuits as functional programs
ACM Computing Surveys (CSUR)
Hi-index | 0.02 |
Universal programming languages are an old dream. There is the computability sense of Turing-universal; Landin and others have advocated syntactically universal languages, a path leading to extensible syntax, e.g., macros. A stronger kind of universality would reduce the need for domain-specific languages—they could be replaced by ‘active libraries’ providing and safety requirements. Experience suggests that much domain-specific optimization can be realized by staging, i.e., doing computations at compile time to produce an efficient run-time. Rudimentary computability arguments show that languages with a ‘Turing-complete kernel’ can be both stage-universal and safety-universal. But making this approach practical requires compilers that find optimal programs, and this is a hard problem. Guaranteed Optimization is a proof technique for constructing compilers that find optimal programs within a decidable approximation of program equivalence. This gives us compilers whose kernels possess intuitive closure properties akin to, but stronger than, languages with explicit staging, and can meet the ‘Turing-complete kernel’ requirement to be stage- and safety-universal. To show this technique is practical we demonstrate a prototype compiler that finds optimal programs in the presence of heap operations; the proof of this is tedious but automated. The proof ensures that any code ‘lying in the kernel’ is evaluated and erased at compile-time. This opens several interesting directions for active libraries. One is staging: we can synthesize fast implementation code at compile-time by putting code-generators in the kernel. To achieve domain-specific safety checking we propose ‘proof embeddings’ in which proofs are intermingled with code and the optimizer does double-duty as a theorem prover. Proofs lying in the kernel are checked and erased at compile-time, yielding code that is both fast and safe.