279 research outputs found

    Purity in Erlang

    Get PDF
    Abstract. Motivated by a concrete goal, namely to extend Erlang with the ability to employ user-defined guards, we developed a parameterized static analysis tool called PURITY, that classifies functions as referentially transparent (i.e., sideeffect free with no dependency on the execution environment and never raising an exception), side-effect free with no dependencies but possibly raising exceptions, or side-effect free but with possible dependencies and possibly raising exceptions. We have applied PURITY on a large corpus of Erlang code bases and report experimental results showing the percentage of functions that the analysis definitely classifies in each category. Moreover, we discuss how our analysis has been incorporated on a development branch of the Erlang/OTP compiler in order to allow extending the language with user-defined guards

    How functional programming mattered

    Get PDF
    In 1989 when functional programming was still considered a niche topic, Hughes wrote a visionary paper arguing convincingly ‘why functional programming matters’. More than two decades have passed. Has functional programming really mattered? Our answer is a resounding ‘Yes!’. Functional programming is now at the forefront of a new generation of programming technologies, and enjoying increasing popularity and influence. In this paper, we review the impact of functional programming, focusing on how it has changed the way we may construct programs, the way we may verify programs, and fundamentally the way we may think about programs

    Calibration and performance of the photon sensor response of FACT -- The First G-APD Cherenkov telescope

    Full text link
    The First G-APD Cherenkov Telescope (FACT) is the first in-operation test of the performance of silicon photo detectors in Cherenkov Astronomy. For more than two years it is operated on La Palma, Canary Islands (Spain), for the purpose of long-term monitoring of astrophysical sources. For this, the performance of the photo detectors is crucial and therefore has been studied in great detail. Special care has been taken for their temperature and voltage dependence implementing a correction method to keep their properties stable. Several measurements have been carried out to monitor the performance. The measurements and their results are shown, demonstrating the stability of the gain below the percent level. The resulting stability of the whole system is discussed, nicely demonstrating that silicon photo detectors are perfectly suited for the usage in Cherenkov telescopes, especially for long-term monitoring purpose

    The role of concurrency in an evolutionary view of programming abstractions

    Full text link
    In this paper we examine how concurrency has been embodied in mainstream programming languages. In particular, we rely on the evolutionary talking borrowed from biology to discuss major historical landmarks and crucial concepts that shaped the development of programming languages. We examine the general development process, occasionally deepening into some language, trying to uncover evolutionary lineages related to specific programming traits. We mainly focus on concurrency, discussing the different abstraction levels involved in present-day concurrent programming and emphasizing the fact that they correspond to different levels of explanation. We then comment on the role of theoretical research on the quest for suitable programming abstractions, recalling the importance of changing the working framework and the way of looking every so often. This paper is not meant to be a survey of modern mainstream programming languages: it would be very incomplete in that sense. It aims instead at pointing out a number of remarks and connect them under an evolutionary perspective, in order to grasp a unifying, but not simplistic, view of the programming languages development process

    Hailstorm : A Statically-Typed, Purely Functional Language for IoT Applications

    Get PDF
    With the growing ubiquity of Internet of Things (IoT), more complex logic is being programmed on resource-constrained IoT devices, almost exclusively using the C programming language. While C provides low-level control over memory, it lacks a number of high-level programming abstractions such as higher-order functions, polymorphism, strong static typing, memory safety, and automatic memory management.We present Hailstorm, a statically-typed, purely functional programming language that attempts to address the above problem. It is a high-level programming language with a strict typing discipline. It supports features like higher-order functions, tail-recursion and automatic memory management, to program IoT devices in a declarative manner. Applications running on these devices tend to be heavily dominated by I/O. Hailstorm tracks side effects like I/O in its type system using resource types. This choice allowed us to explore the design of a purely functional standalone language, in an area where it is more common to embed a functional core in an imperative shell. The language borrows the combinators of arrowized FRP, but has discrete-time semantics. The design of the full set of combinators is work in progress, driven by examples. So far, we have evaluated Hailstorm by writing standard examples from the literature (earthquake detection, a railway crossing system and various other clocked systems), and also running examples on the GRiSP embedded systems board, through generation of Erlang

    Improving the Network Scalability of Erlang

    Get PDF
    As the number of cores grows in commodity architectures so does the likelihood of failures. A distributed actor model potentially facilitates the development of reliable and scalable software on these architectures. Key components include lightweight processes which ‘share nothing’ and hence can fail independently. Erlang is not only increasingly widely used, but the underlying actor model has been a beacon for programming language design, influencing for example Scala, Clojure and Cloud Haskell. While the Erlang distributed actor model is inherently scalable, we demonstrate that it is limited by some pragmatic factors. We address two network scalability issues here: globally registered process names must be updated on every node (virtual machine) in the system, and any Erlang nodes that communicate maintain an active connection. That is, there is a fully connected O(n2) network of n nodes. We present the design, implementation, and initial evaluation of a conservative extension of Erlang — Scalable Distributed (SD) Erlang. SD Erlang partitions the global namespace and connection network using s_groups. An s_group is a set of nodes with its own process namespace and with a fully connected network within the s_group, but only individual connections outside it. As a node may belong to more than one s_group it is possible to construct arbitrary connection topologies like trees or rings. We present an operational semantics for the s_group functions, and outline the validation of conformance between the implementation and the semantics using the QuickCheck automatic testing tool. Our preliminary evaluation in comparison with distributed Erlang shows that SD Erlang dramatically improves network scalability even if the number of global operations is tiny (0.01%). Moreover, even in the absence of global operations the reduced connection maintenance overheads mean that SD Erlang scales better beyond 80 nodes (1920 cores)

    Static Analysis for Divide-and-Conquer Pattern Discovery

    Get PDF
    Routines implementing divide-and-conquer algorithms are good candidates for parallelization. Their identifying property is that such a routine divides its input into "smaller" chunks, calls itself recursively on these smaller chunks, and combines the outputs into one. We set up conditions which characterize a wide range of d&c routine definitions. These conditions can be verified by static program analysis. This way d&c routines can be found automatically in existing program texts, and their parallelization based on semi-automatic refactoring can be facilitated. We work out the details in the context of the Erlang programming language

    A methodology for neural spatial interaction modelling

    Get PDF
    This paper presents a methodology for neural spatial interaction modelling. Particular emphasis is laid on design, estimation and performance issues in both cases, unconstrained and singly constrained spatial interaction. Families of classical neural network models, but also less classical ones such as product unit neural network models are considered. Some novel classes of product unit and summation unit models are presented for the case of origin or destination constrained spatial interaction flows. The models are based on a modular connectionist architecture that may be viewed as a linked collection of functionally independent neural modules with identical feedforward topologies, operating under supervised learning algorithms. Parameter estimation is viewed as Maximum Likelihood (ML) learning. The nonconvex nature of the loss function makes the Alopex procedure, a global search procedure, an attractive and appropriate optimising scheme for ML learning. A benchmark comparison against the classical gravity models illustrates the superiority of both, the unconstrained and the origin constrained, neural network model versions in terms of generalization performance measured by Kullback and Leibler`s information criterion. Hereby, the authors make use of the bootstrapping pairs approach to overcome the largely neglected problem of sensitivity to the specific splitting of the data into training, internal validation and testing data sets, and to get a better statistical picture of prediction variability of the models. Keywords: Neural spatial interaction models, origin constrained or destination constrained spatial interaction, product unit network, Alopex procedure, boostrapping, benchmark performance tests.

    Pure functional epidemics

    Get PDF
    Agent-Based Simulation (ABS) is a methodology in which a system is simulated in a bottom-up approach by modelling the micro interactions of its constituting parts, called agents, out of which the global system behaviour emerges. So far mainly object-oriented techniques and languages have been used in ABS. Using the SIR model of epidemiology, which simulates the spreading of an infectious disease through a population, we demonstrate how to use pure Functional Reactive Programming to implement ABS. With our approach we can guarantee the reproducibility of the simulation at compile time and rule out specific classes of run-time bugs, something that is not possible with traditional object-oriented languages. Also, we found that the representation in a purely functional format is conceptually quite elegant and opens the way to formally reason about ABS
    corecore