250 research outputs found

    Supporting Separate Compilation in a Defunctionalizing Compiler

    Get PDF
    Defunctionalization is generally considered a whole-program transformation and thus incompatible with separate compilation. In this paper, we formalize a modular variant of defunctionalization which can support separate compilation. Our technique allows modules in a Haskell-like language to be separately defunctionalized and compiled, then linked together to generate an executable program. We provide a prototype implementation of our modular defunctionalization technique and we discuss the experiences of its application in a compiler from a large subset of Haskell to low-level C code, based on the intensional transformation

    Defunctionalization with Dependent Types

    Full text link
    The defunctionalization translation that eliminates higher-order functions from programs forms a key part of many compilers. However, defunctionalization for dependently-typed languages has not been formally studied. We present the first formally-specified defunctionalization translation for a dependently-typed language and establish key metatheoretical properties such as soundness and type preservation. The translation is suitable for incorporation into type-preserving compilers for dependently-typed language

    Refunctionalization at Work

    Get PDF
    We present the left inverse of Reynolds's defunctionalization and we show its relevance to programming and to programming languages. We propose two methods to transform a program that is almost in defunctionalized form into one that is actually in defunctionalized form, and we illustrate them with a recognizer for Dyck words and with Dijkstra's shunting-yard algorithm

    Refunctionalization at Work

    Get PDF
    We present the left inverse of Reynolds's defunctionalization and we show its relevance to programming and to programming languages. We present two methods to put a program that is almost in defunctionalized form into one that is actually in defunctionalized form, and we illustrate them with a recognizer for Dyck words and with Dijkstra's shunting-yard algorithm

    Exact Recursive Probabilistic Programming

    Full text link
    Recursive calls over recursive data are widely useful for generating probability distributions, and probabilistic programming allows computations over these distributions to be expressed in a modular and intuitive way. Exact inference is also useful, but unfortunately, existing probabilistic programming languages do not perform exact inference on recursive calls over recursive data, forcing programmers to code many applications manually. We introduce a probabilistic language in which a wide variety of recursion can be expressed naturally, and inference carried out exactly. For instance, probabilistic pushdown automata and their generalizations are easy to express, and polynomial-time parsing algorithms for them are derived automatically. We eliminate recursive data types using program transformations related to defunctionalization and refunctionalization. These transformations are assured correct by a linear type system, and a successful choice of transformations, if there is one, is guaranteed to be found by a greedy algorithm

    Topical capsaicin for pain management: therapeutic potential and mechanisms of action of the new high-concentration capsaicin 8% patch

    Get PDF
    Topical capsaicin formulations are used for pain management. Safety and modest efficacy of low-concentration capsaicin formulations, which require repeated daily self-administration, are supported by meta-analyses of numerous studies. A high-concentration capsaicin 8% patch (Qutenza™) was recently approved in the EU and USA. A single 60-min application in patients with neuropathic pain produced effective pain relief for up to 12 weeks. Advantages of the high-concentration capsaicin patch include longer duration of effect, patient compliance, and low risk for systemic effects or drug–drug interactions. The mechanism of action of topical capsaicin has been ascribed to depletion of substance P. However, experimental and clinical studies show that depletion of substance P from nociceptors is only a correlate of capsaicin treatment and has little, if any, causative role in pain relief. Rather, topical capsaicin acts in the skin to attenuate cutaneous hypersensitivity and reduce pain by a process best described as ‘defunctionalization’ of nociceptor fibres. Defunctionalization is due to a number of effects that include temporary loss of membrane potential, inability to transport neurotrophic factors leading to altered phenotype, and reversible retraction of epidermal and dermal nerve fibre terminals. Peripheral neuropathic hypersensitivity is mediated by diverse mechanisms, including altered expression of the capsaicin receptor TRPV1 or other key ion channels in affected or intact adjacent peripheral nociceptive nerve fibres, aberrant re-innervation, and collateral sprouting, all of which are defunctionalized by topical capsaicin. Evidence suggests that the utility of topical capsaicin may extend beyond painful peripheral neuropathies

    A Rational Deconstruction of Landin's SECD Machine

    Get PDF
    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
    corecore