287,688 research outputs found

    Non-linear Pattern Matching with Backtracking for Non-free Data Types

    Full text link
    Non-free data types are data types whose data have no canonical forms. For example, multisets are non-free data types because the multiset {a,b,b}\{a,b,b\} has two other equivalent but literally different forms {b,a,b}\{b,a,b\} and {b,b,a}\{b,b,a\}. Pattern matching is known to provide a handy tool set to treat such data types. Although many studies on pattern matching and implementations for practical programming languages have been proposed so far, we observe that none of these studies satisfy all the criteria of practical pattern matching, which are as follows: i) efficiency of the backtracking algorithm for non-linear patterns, ii) extensibility of matching process, and iii) polymorphism in patterns. This paper aims to design a new pattern-matching-oriented programming language that satisfies all the above three criteria. The proposed language features clean Scheme-like syntax and efficient and extensible pattern matching semantics. This programming language is especially useful for the processing of complex non-free data types that not only include multisets and sets but also graphs and symbolic mathematical expressions. We discuss the importance of our criteria of practical pattern matching and how our language design naturally arises from the criteria. The proposed language has been already implemented and open-sourced as the Egison programming language

    Exploring design patterns with the Java programming language

    Get PDF
    This project describes and discusses the concepts of design patterns giving a historical background as well as citing contributions to the software development field and current research efforts. In addition, the advantages and disadvantages of using design patterns and efforts to encourage design pattern usage in software organizations are discussed. Seven design patterns (Builder, Adapter, Composite, Template Method, Facade, Mediator and Strategy) were chosen as the basis for example concrete applications. The concrete applications are given in the form of design documentation, source code and executable software. The applications demonstrate the use of design patterns in developing object oriented software applications. The applications are implemented in the Java programming language. The Java programming language was used because it is a popular object oriented programming language. An aspect of its popularity comes from its ability to execute with Java enabled browsers on a variety of computing platforms. Noted researchers in the area of design patterns assert that design patterns are language independent, however, much of the implementation in the area of design patterns has been written in the C++ language. The contribution of this project lies in implementing selected design patterns in Java and noting experiences that support or refute the conjecture that design patterns are language independent

    Proactive Empirical Assessment of New Language Feature Adoption via Automated Refactoring: The Case of Java 8 Default Methods

    Full text link
    Programming languages and platforms improve over time, sometimes resulting in new language features that offer many benefits. However, despite these benefits, developers may not always be willing to adopt them in their projects for various reasons. In this paper, we describe an empirical study where we assess the adoption of a particular new language feature. Studying how developers use (or do not use) new language features is important in programming language research and engineering because it gives designers insight into the usability of the language to create meaning programs in that language. This knowledge, in turn, can drive future innovations in the area. Here, we explore Java 8 default methods, which allow interfaces to contain (instance) method implementations. Default methods can ease interface evolution, make certain ubiquitous design patterns redundant, and improve both modularity and maintainability. A focus of this work is to discover, through a scientific approach and a novel technique, situations where developers found these constructs useful and where they did not, and the reasons for each. Although several studies center around assessing new language features, to the best of our knowledge, this kind of construct has not been previously considered. Despite their benefits, we found that developers did not adopt default methods in all situations. Our study consisted of submitting pull requests introducing the language feature to 19 real-world, open source Java projects without altering original program semantics. This novel assessment technique is proactive in that the adoption was driven by an automatic refactoring approach rather than waiting for developers to discover and integrate the feature themselves. In this way, we set forth best practices and patterns of using the language feature effectively earlier rather than later and are able to possibly guide (near) future language evolution. We foresee this technique to be useful in assessing other new language features, design patterns, and other programming idioms

    Assessing design patterns for concurrency

    Get PDF
    Design patterns are language-independent software-engineering techniques for solving recurring problems within a particular problem-context. Despite their generality, they have been primarily adopted by, and for the most part developed within, the object-oriented community. As a result, some pattern definitions are sometimes expressed with objects-oriented machinery in mind such as classes and inheritance. We test the paradigm independence of these design patterns and investigate the viability of adopting existing patterns from the object-oriented paradigm to the message-passing concurrency setting. By porting these techniques to the new programming paradigm, we expect to inherit the benefits associated with these design patterns. We achieve these goals by implementing a suite of design patterns as reusable modules in Erlang, an industry-strength message-passing language for programming concurrent distributed systems.peer-reviewe

    Towards Automated Program Abstraction and Language Enrichment

    Get PDF
    This paper focuses on the presentation of a method for automated raise of programming language abstraction level. The base concept for the approach is a code pattern -- recurring structure in program code. In contrast to design patterns it has a specific representation at a code level and thus can be parameterized and replaced by a new language element. In the article two algorithms for automated recognition of patterns in samples of programs are described and examined. The paper also presents an approach for language extension based on the found patterns. It is based on an interactive communication with the programming environment, where recognized patterns are suggested to a programmer and can be injected into the language in a form of new elements. Conducted experiments are evaluated in regard to the future perspective and contributions

    Programming with heterogeneous structures: Manipulating XML data using bondi

    Full text link
    Manipulating semistructured data, such as XML, does not fit well within conventional programming languages. A typical manipulation requires finding all occurrences of a structure matching a structured search pattern, whose context may be different in different places, and both aspects cause difficulty. If a special-purpose query language is used to manipulate XML, an interface to a more general programming environment is required, and this interface typically creates runtime overhead for type conversion. However, adding XML manipulation to a general-purpose programming language has proven difficult because of problems associated with expressiveness and typing. We show an alternative approach that handles many kinds of patterns within an existing strongly-typed general-purpose programming language called bondi. The key ideas are to express complex search patterns as structures of simple patterns, pass these complex patterns as parameters to generic data-processing functions and traverse heterogeneous data structures by a generalized form of pattern matching. These ideas are made possible by the language's support for pattern calculus, whose typing on structures and patterns enables path and pattern polymorphism. With this approach, adding a new kind of pattern is just a matter of programming, not language design. Copyright © 2006, Australian Computer Society, Inc

    AIOCJ: A Choreographic Framework for Safe Adaptive Distributed Applications

    Get PDF
    We present AIOCJ, a framework for programming distributed adaptive applications. Applications are programmed using AIOC, a choreographic language suited for expressing patterns of interaction from a global point of view. AIOC allows the programmer to specify which parts of the application can be adapted. Adaptation takes place at runtime by means of rules, which can change during the execution to tackle possibly unforeseen adaptation needs. AIOCJ relies on a solid theory that ensures applications to be deadlock-free by construction also after adaptation. We describe the architecture of AIOCJ, the design of the AIOC language, and an empirical validation of the framework.Comment: Technical Repor
    corecore