41 research outputs found

    An EDSL approach to high performance Haskell programming

    Full text link
    This paper argues for a new methodology for writing high per-formance Haskell programs by using Embedded Domain Specific Languages. We exemplify the methodology by describing a complete li-brary, meta-repa, which is a reimplementation of parts of the repa library. The paper describes the implementation of meta-repa and contrasts it with the standard approach to writing high performance libraries. We conclude that even though the embedded language approach has an initial cost of defining the language and some syntactic overhead it gives a more tailored programming model, stronger performance guarantees, better control over optimizations, simpler implementation of fusion and inlining and allows for mov-ing type level programming down to value level programming in some cases. We also provide benchmarks showing that meta-repa is as fast, or faster, than repa. Furthermore, meta-repa also includes push arrays and we demonstrate their usefulness for writing certain high performance kernels such as FFT

    Fuzzy Set Abstraction

    Get PDF
    Program analysis plays a key part in improving modern software. Static (sound) analyses produce globally correct, but often pessimistic results while dynamic (complete) analyses yield highly precise results but with limited coverage. We present the Fuzzy set abstraction which generalizes previous work based on 3-valued logic. Our abstraction allows for hybrid analysis where static results are refined dynamically through the use of fuzzy control systems

    Reduced anthropogenic aerosol radiative forcing caused by biogenic new particle formation

    Get PDF
    The magnitude of aerosol radiative forcing caused by anthropogenic emissions depends on the baseline state of the atmosphere under pristine preindustrial conditions. Measurements show that particle formation in atmospheric conditions can occur solely from biogenic vapors. Here, we evaluate the potential effect of this source of particles on preindustrial cloud condensation nuclei (CCN) concentrations and aerosol-cloud radiative forcing over the industrial period. Model simulations show that the pure biogenic particle formation mechanism has a much larger relative effect on CCN concentrations in the preindustrial atmosphere than in the present atmosphere because of the lower aerosol concentrations. Consequently, preindustrial cloud albedo is increased more than under present day conditions, and therefore the cooling forcing of anthropogenic aerosols is reduced. The mechanism increases CCN concentrations by 20-100% over a large fraction of the preindustrial lower atmosphere, and the magnitude of annual global mean radiative forcing caused by changes of cloud albedo since 1750 is reduced by 0.22 W m-2 (27%) to -0.60 W m-2. Model uncertainties, relatively slow formation rates, and limited available ambient measurements make it difficult to establish the significance of a mechanism that has its dominant effect under preindustrial conditions. Our simulations predict more particle formation in the Amazon than is observed. However, the first observation of pure organic nucleation has now been reported for the free troposphere. Given the potentially significant effect on anthropogenic forcing, effort should be made to better understand such naturally driven aerosol processes

    Shortcut fusion for accumulating parameters & zip-like functions

    No full text
    We present an alternative approach to shortcut fusion based on the function unfoldr. Despite its simplicity the technique can remove intermediate lists in examples which are known to be difficult. We show that it can remove all lists from definitions involving zip-like functions and functions using accumulating parameters

    Scalable Program Analysis and topics in Programming Language Design and Transformation

    No full text
    The thesis covers a variety of topics in programming language technology, with the main emphasis on static program analysis. A program analysis is an automatic method, a program, which anwers a specific question about programs. Examples of questions could be "Will this program crash?" and "Will a certain part of the program ever be executed?" Program analyses answering questions such as these can beused to improve the efficiency and security of programs. A program analysis can never be exact. This means that there will always be apportunities to develop new and increasingly precise methods for program analysis. However these analyses can easily become very resource hungry, taking a lot of time and memory to compute.This thesis develops methods for scalable program analysis. As programs grow larger and more complex program analyses should still yield precise enough answers and be feasible to compute.Our contributions include a new constraint-based program analysis method, Constraint Abstractions, specifically targeted towards computing solutions to precise program analyses. The key technical contribution is an O(n^3) algorithm for program analyses which uses polymorphism and subtyping. A concrete case study is described: a Usage analysis which answers the question "Is a particular value used at most once?"We also present a comprehensive experimental exploration of the vast design space for program analyses in order to determine how program analysis features interact and impact precision.Beside program analysis this thesis covers two other topics: program transformation and programing language design. A new technique is introduced for fusing functions, thereby removing any intermediate data structure and improving the speed of programs. Last we show how regular expressions can be seamlessly added to the pattern matching facility found in functional programming languages

    Shortcut fusion for accumulating parameters & zip-like functions

    No full text
    We present an alternative approach to shortcut fusion based on the function unfoldr. Despite its simplicity the technique can remove intermediate lists in examples which are known to be difficult. We show that it can remove all lists from definitions involving zip-like functions and functions using accumulating parameters

    Defunctionalizing Push arrays

    No full text
    Recent work on embedded domain specific languages (EDSLs) for high performance array programming has given rise to a number of array representations. In Feldspar and Obsidian there are two different kinds of arrays, called Pull and Push arrays. Both Pull and Push arrays are deferred; they are methods of computing arrays, rather than elements stored in memory. The reason for having multiple array types is to obtain code that performs better. Pull and Push arrays provide this by guaranteeing that operations fuse automatically. It is also the case that some operations are easily implemented and perform well on Pull arrays, while for some operations, Push arrays provide better implementations. But do we really need to have more than one array representation? In this paper we derive a new array representation from Push arrays that have all the good qualities of Pull and Push arrays combined. This new array representation is obtained via defunctionalization of a Push array API. Copyright is held by the owner/author(s)

    Bridging Static and Dynamic Program Analysis using Fuzzy Logic

    No full text
    Static program analysis is used to summarize properties over all dynamic executions. In a unifying approach based on 3-valued logic properties are either assigned a definite value or unknown. But in summarizing a set of executions, a property is more accurately represented as being biased towards true, or towards false. Compilers use program analysis to determine benefit of an optimization. Since benefit (e.g., performance) is justified based on the common case understanding bias is essential in guiding the compiler. Furthermore, successful optimization also relies on understanding the quality of the information, i.e. the plausibility of the bias. If the quality of the static information is too low to form a decision we would like a mechanism that improves dynamically. We consider the problem of building such a reasoning framework and present the fuzzy data-flow analysis. Our approach generalize previous work that use 3-valued logic. We derive fuzzy extensions of data-flow analyses used by the lazy code motion optimization and unveil opportunities previous work would not detect due to limited expressiveness. Furthermore we show how the results of our analysis can be used in an adaptive classifier that improve as the application executes

    Combining deep and shallow embedding of domain-specific languages

    No full text
    We present a technique to combine deep and shallow embedding in the context of compiling embedded languages in order to provide the benefits of both techniques. When compiling embedded languages it is natural to use an abstract syntax tree to represent programs. This is known as a deep embedding and it is a rather cumbersome technique compared to other forms of embedding, typically leading to more code and being harder to extend. In shallow embeddings, language constructs are mapped directly to their semantics which yields more flexible and succinct implementations. But shallow embeddings are not well-suited for compiling embedded languages.Our technique uses a combination of deep and shallow embedding, which helps keeping the deep embedding small and makes extending the embedded language much easier. The technique also has some unexpected but welcome secondary effects. It provides fusion of functions to remove intermediate results for free without any additional effort. It also helps us to give the embedded language a more natural programming interface

    Simple and compositional reification of monadic embedded languages

    No full text
    When writing embedded domain specific languages in Haskell, it is often convenient to be able to make an instance of the Monad class to take advantage of the do-notation and the extensive monad libraries. Commonly it is desirable to compile such languages rather than just interpret them. This introduces the problem of monad reification, i.e. observing the structure of the monadic computation. We present a solution to the monad reification problem and illustrate it with a small robot control language. Monad reification is not new but the novelty of our approach is in its directness, simplicity and compositionality
    corecore