TL;DR: Practical applications of defunctionalization are studied and new connections between seemingly unrelated higher-order and first-order specifications and between their correctness proofs are uncovered.
Abstract: Reynolds's defunctionalization technique is a whole-program transformation from higher-order to first-order functional programs. We study practical applications of this transformation and uncover new connections between seemingly unrelated higher-order and first-order specifications and between their correctness proofs. Defunctionalization therefore appearsboth as a springboard for rev ealing new connections and as a bridge for transferring existing results between the first-order world and the higher-order world.
TL;DR: The ability to spray-process ECPs from aqueous media is expected to minimize environmental impact and processing costs, hence promoting the commercial viability of this fast-developing technology suitable for portable display applications.
Abstract: www.MaterialsViews.com C O M M U A Side-Chain Defunctionalization Approach Yields a Polymer Electrochrome Spray-Processable from Water N IC By Pierre M. Beaujuge , Chad M. Amb , and John R. Reynolds * A IO N When compared to their inorganic counterparts (e.g., MoO 3 , NiO x ), non-emissive organic electrochromics offer the potential for cost-effective solution processing over large-area and mechanically deformable surfaces. The ability to print discrete electrochromic pixels would pave the path to combining colors in portable display applications, such as information tags and electronic paper. [ 1–4 ] While a number of important design principles have been developed over the years to produce π conjugated electrochromic polymers (ECPs) with varying color states and redox switching properties, [ 3 ] only a limited number of these electrochromes have shown printor spray-processability from conventional organic solvents. [ 1 , 5–8 ] Attempts to print or spray thin fi lms of neutral state ECPs from aqueous solvents have not been reported, likely due to a combination of solubility and fi lm-forming challenges in polar media with relatively low vapor pressure. To date, only poly(3,4-ethylenedioxythiophene) (PEDOT), solution-cast in its heavily doped form PEDOT:PSS (polystyrene sulfonate), has been effectively processed from aqueous solutions. [ 9–12 ] Here, we report on the use of a sidechain defunctionalization approach in producing the fi rst water spray-processable π -conjugated polymer electrochrome. The ability to spray-process ECPs from aqueous media is expected to minimize environmental impact and processing costs, hence promoting the commercial viability of this fast-developing technology suitable for fl exible display applications. [ 3 , 4 , 13 ]
TL;DR: Experimental results over a range of benchmarks including large real-world programs such as the compiler itself and the ML-Kit indicate that the compile-time cost of flow analysis and closure conversion is extremely small, and that the dispatches and coercions inserted by the algorithm are dynamically infrequent.
Abstract: This paper presents a new closure conversion algorithm for simply-typed languages. We have have implemented the algorithm as part of MLton, a whole-program compiler for Standard ML (SML). MLton first applies all functors and eliminates polymorphism by code duplication to produce a simply-typed program. MLton then performs closure conversion to produce a first-order, simply-typed program. In contrast to typical functional language implementations, MLton performs most optimizations on the first-order language, after closure conversion. There are two notable contributions of our work:
1. The translation uses a general flow-analysis framework which includes OCFA. The types in the target language fully capture the results of the analysis. MLton uses the analysis to insert coercions to translate between different representations of a closure to preserve type correctness of the target language program.
2. The translation is practical. Experimental results over a range of benchmarks including large real-world programs such as the compiler itself and the ML-Kit [25] indicate that the compile-time cost of flow analysis and closure conversion is extremely small, and that the dispatches and coercions inserted by the algorithm are dynamically infrequent.
TL;DR: This article deconstructs the SECD machine into a lambda-interpreter, i.e., an evaluation function, and it is reconstructed into a variety of SECD-like machines.
Abstract: Landin's SECD machine was the first abstract machine for the lambda-calculus viewed as a programming language. Both theoretically as a model of computation and practically as an idealized implementation, it has set the tone for the subsequent development of abstract machines for functional programming languages. However, and even though variants of the SECD machine have been presented, derived, and invented, the precise rationale for its architecture and modus operandi has remained elusive. In this article, we deconstruct the SECD machine into a lambda-interpreter, i.e., an evaluation function, and we reconstruct lambda-interpreters into a variety of SECD-like machines. The deconstruction and reconstructions are transformational: they are based on equational reasoning and on a combination of simple program transformations--mainly closure conversion, transformation into continuation-passing style, and defunctionalization. The evaluation function underlying the SECD machine provides a precise rationale for its architecture: it is an environment-based eval-apply evaluator with a callee-save strategy for the environment, a data stack of intermediate results, and a control delimiter. Each of the components of the SECD machine (stack, environment, control, and dump) is therefore rationalized and so are its transitions. The deconstruction and reconstruction method also applies to other abstract machines and other evaluation functions. It makes it possible to systematically extract the denotational content of an abstract machine in the form of a compositional evaluation function, and the (small-step) operational content of an evaluation function in the form of an abstract machine.
TL;DR: This article derives a lazy abstract machine from an ordinary call-by-need evaluator that threads a heap of updatable cells, using closure conversion, transformation into continuation-passing style, and defunctionalization of continuations.
Abstract: We bridge the gap between compositional evaluators and abstract machines for the lambda-calculus, using closure conversion, transformation into continuation-passing style, and defunctionalization of continuations. This article is a followup of our article at PPDP 2003, where we consider call by name and call by value. Here, however, we consider call by need. We derive a lazy abstract machine from an ordinary call-by-need evaluator that threads a heap of updatable cells. In this resulting abstract machine, the continuation fragment for updating a heap cell naturally appears as an `update marker', an implementation technique that was invented for the Three Instruction Machine and subsequently used to construct lazy variants of Krivine's abstract machine. Tuning the evaluator leads to other implementation techniques such as unboxed values. The correctness of the resulting abstract machines is a corollary of the correctness of the original evaluators and of the program transformations used in the derivation.