59 research outputs found

    Functional pearl: a SQL to C compiler in 500 lines of code

    Get PDF
    We present the design and implementation of a SQL query processor that outperforms existing database systems and is written in just about 500 lines of Scala code - a convincing case study that high-level functional programming can handily beat C for systems-level programming where the last drop of performance matters. The key enabler is a shift in perspective towards generative programming. The core of the query engine is an interpreter for relational algebra operations, written in Scala. Using the open-source LMS Framework (Lightweight Modular Staging), we turn this interpreter into a query compiler with very low effort. To do so, we capitalize on an old and widely known result from partial evaluation known as Futamura projections, which state that a program that can specialize an interpreter to any given input program is equivalent to a compiler. In this pearl, we discuss LMS programming patterns such as mixed-stage data structures (e.g. data records with static schema and dynamic field components) and techniques to generate low-level C code, including specialized data structures and data loading primitives

    AutoGraph: Imperative-style Coding with Graph-based Performance

    Get PDF
    There is a perceived trade-off between machine learning code that is easy to write, and machine learning code that is scalable or fast to execute. In machine learning, imperative style libraries like Autograd and PyTorch are easy to write, but suffer from high interpretive overhead and are not easily deployable in production or mobile settings. Graph-based libraries like TensorFlow and Theano benefit from whole-program optimization and can be deployed broadly, but make expressing complex models more cumbersome. We describe how the use of staged programming in Python, via source code transformation, offers a midpoint between these two library design patterns, capturing the benefits of both. A key insight is to delay all type-dependent decisions until runtime, via dynamic dispatch. We instantiate these principles in AutoGraph, a software system that improves the programming experience of the TensorFlow library, and demonstrate usability improvements with no loss in performance compared to native TensorFlow graphs. We also show that our system is backend agnostic, and demonstrate targeting an alternate IR with characteristics not found in TensorFlow graphs

    Shell model description of normal parity bands in odd-mass heavy deformed nuclei

    Get PDF
    The low-energy spectra and B(E2) electromagnetic transition strengths of 159Eu, 159Tb and 159Dy are described using the pseudo SU(3) model. Normal parity bands are built as linear combinations of SU(3) states, which are the direct product of SU(3) proton and neutron states with pseudo spin zero (for even number of nucleons) and pseudo spin 1/2 (for odd number of nucleons). Each of the many-particle states have a well-defined particle number and total angular momentum. The Hamiltonian includes spherical Nilsson single-particle energies, the quadrupole-quadrupole and pairing interactions, as well as three rotor terms which are diagonal in the SU(3) basis. The pseudo SU(3) model is shown to be a powerful tool to describe odd-mass heavy deformed nuclei.Comment: 11 pages, 2 figures, Accepted to be published in Phys. Rev.

    Everything old is new again: Quoted Domain Specific Languages

    Get PDF
    We describe a new approach to domain specific languages (DSLs), called Quoted DSLs (QDSLs), that resurrects two old ideas: quotation, from McCarthy's Lisp of 1960, and the subformula property, from Gentzen's natural deduction of 1935. Quoted terms allow the DSL to share the syntax and type system of the host language. Normalising quoted terms ensures the subformula property, which guarantees that one can use higher-order types in the source while guaranteeing first-order types in the target, and enables using types to guide fusion. We test our ideas by re-implementing Feldspar, which was originally implemented as an Embedded DSL (EDSL), as a QDSL; and we compare the QDSL and EDSL variants

    Type soundness proofs with definitional interpreters

    Get PDF
    While type soundness proofs are taught in every graduate PL class, the gap between realistic languages and what is accessible to formal proofs is large. In the case of Scala, it has been shown that its formal model, the Dependent Object Types (DOT) calculus, cannot simultaneously support key metatheoretic properties such as environment narrowing and subtyping transitivity, which are usually required for a type soundness proof. Moreover, Scala and many other realistic languages lack a general substitution property. The first contribution of this paper is to demonstrate how type soundness proofs for advanced, polymorphic, type systems can be carried out with an operational semantics based on high-level, definitional interpreters, implemented in Coq. We present the first mechanized soundness proofs in this style for System F<: and several extensions, including mutable references. Our proofs use only straightforward induction, which is significant, as the combination of big-step semantics, mutable references, and polymorphism is commonly believed to require coinductive proof techniques. The second main contribution of this paper is to show how DOT-like calculi emerge from straightforward generalizations of the operational aspects of F<:, exposing a rich design space of calculi with path-dependent types in between System F and DOT, which we dub the System D Square. By working directly on the target language, definitional interpreters can focus the design space and expose the invariants that actually matter at runtime. Looking at such runtime invariants is an exciting new avenue for type system design.This research was supported by NSF through awards 1553471 and 1564207

    Gratuitous Referrals: A Subset Of Visitor Search Activities And Decision Strategies At Destination For Travel-Related Services

    No full text
    The referral-seeking behavior of travelers at a given destination is undergoing greater scrutiny as businesses compete in increasingly competitive marketplaces. The phenomenon of at-destination venue search activity and decision processes utilized by visitors is predominantly an academic unknown. This study investigated a subset of the sources frequently utilized by visitors, referrals from local residents. The findings from two comparable studies indicate a broad section of the local community may be frequently relied upon for information as well as the venue decision for lodging, foodservice, and recreational and entertainment services at a destination. © 2005 by The Haworth Press, Inc. All rights reserved

    Consumers\u27 Perceptions Of Fairness And The Resultant Effect On Customer Satisfaction

    No full text
    This study investigated the effects of interactional, distributive, and procedural fairness on overall fairness and customer satisfaction and of overall fairness on customer satisfaction across a broad spectrum of service encounter outcomes within the service sector, not just in the context of a service failure. Nearly 50% of those encounters recalled represented hospitality and leisure businesses exclusively. The model tested here has been adapted from a larger theoretical model of the customer\u27s path to loyalty which is an adaptation of previous models of the service profit chain, customer satisfaction with service failure and recovery, and complaint handling relationships. This research provides practical information that can lead to a better understanding of customers\u27 evaluation methods and be used to guide the formation of improved service strategies that provide fairness, a key to satisfaction in hospitality, leisure and service sector affiliated businesses. © 2006 by The Haworth Press, Inc. All rights reserved

    The Nature Of Gratuitous Referrals In Tourism: Local Residents\u27 Perspective

    No full text
    Purpose - The purpose of this paper is to investigate the referral patterns of local residents who are frequently requested by visitors to the community to provide information and/or direct venue referrals for travel-related services. Also investigated, were the factors influencing the selection of a specific venue being referred. It is posited that visitors delay many travel decisions until they arrive at a destination and extensively utilize local experts in their decision strategy. Design/methodology/approach - The current study expands upon previous research on visitor decision strategies for travel-related services once that are at a destination by examining the referral activity of 180 residents in the metro-Orlando area, a destination that attracts more than 47 millions visitors each year. A standardized questionnaire was utilized to collect data in two distinct areas of the destination, a central tourism corridor and a bedroom community. Findings - In general, at-destination recommendations from locals were found to be highly sought by visitors, regardless of the occupation of the perceived local expert. In addition, although the weekly frequency of requests to a local expert was typically lower in the bedroom community in contrast to the tourism corridor, they still existed in significant enough numbers such that they should capture the attention of enterprises providing such services. At the least, a partial alignment of an enterprise\u27s promotional strategies and tactics to reach targeted visitor segments through locals becomes obvious. Overall, notable recommendation patterns were not uniform across type of service enterprise, and were highly evident for food and beverage and entertainment facilities, while recommendations for lodging facilities were found to be limited in this study. It was also determined that local residents were most influenced by organic factors compared to induced factors. Research limitations/implications - The results suggest that hospitality businesses should focus a portion of their marketing strategies and tactics towards the community in order to attain/drive positive word-of-mouth referrals. This implication is particularly relevant for restaurants and shopping venues. Finally, it is suggested that the most effective way for businesses to reach local residents is through direct contact and communication, rather than traditional advertising channels. Originality/value - The paper has both theoretical and practical value, and provides further confirmation that tourists delay/make many decisions post-arrival and that locals play an important role in travel-decision process. © Emerald Group Publishing Limited

    Destination Selection Criteria: Key Success Factors Evolve And Dominate

    No full text
    Billions of dollars are spent annually on events that span a variety of genres. Furthermore, different types of events demonstrate their own unique goals and objectives. Physical and operational requirements may change by organizational size, budgetary constraints, and internal business policies. The importance of event type in the choice of a host destination is of considerable interest. Previous studies pertaining to destination selection criteria have focused on specific destination characteristics without taking into consideration the various event types. The current study investigated similarities and differences in destination selection criteria based on event type. The results provide evidence that event planners assign different levels of importance to destination selection criteria based on event type. The study compares results to previous studies that utilized the same methodology and data analysis approach. Over time, it appears there may be melding of importance for multiple destination criteria as a result of industry and global standards. © 2008 Cognizant Comm. Corp
    corecore