2,508 research outputs found

    A Case Study in Refactoring Functional Programs

    Get PDF
    Refactoring is the process of redesigning existing code without changing its functionality. Refactoring has recently come to prominence in the OO community. In this paper we explore the prospects for refactoring functional programs. Our paper centres on the case study of refactoring a 400 line Haskell program written by one of our students. The case study illustrates the type and variety of program manipulations involved in refactoring. Similarly to other program transformations, refactorings are based on program equivalences, and thus ultimately on language semantics. In the context of functional languages, refactorings can be based on existing theory and program analyses. However, the use of program transformations for program restructuring emphasises a different kind of transformation from the more traditional derivation or optimisation: characteristically, they often require wholesale changes to a collection of modules, and although they are best controlled by programmers, their application may require nontrivial semantic analyses. The paper also explores the background to refactoring, provides a taxonomy for describing refactorings and draws some conclusions about refactoring for functional programs

    Refactoring Functional Programs

    Get PDF
    Refactoring is the process of redesigning existing code without changing its functionality. Refactoring has recently come to prominence in the OO community. In this paper we explore the prospects for refactoring functional programs. Our paper centres on the case study of refactoring a 400 line Haskell program written by one of our students. The case study illustrates the type and variety of program manipulations involved in refactoring. Similarly to other program transformations, refactorings are based on program equivalences, and thus ultimately on language semantics. In the context of functional languages, refactorings can be based on existing theory and program analyses. However, the use of program transformations for program restructuring emphasises a different kind of transformation from the more traditional derivation or optimisation: characteristically, they often require wholesale changes to a collection of modules, and although they are best controlled by programmers, their application may require nontrivial semantic analyses. The paper also explores the background to refactoring, provides a taxonomy for describing refactorings and draws some conclusions about refactoring for functional programs

    Programming Languages for Scientific Computing

    Full text link
    Scientific computation is a discipline that combines numerical analysis, physical understanding, algorithm development, and structured programming. Several yottacycles per year on the world's largest computers are spent simulating problems as diverse as weather prediction, the properties of material composites, the behavior of biomolecules in solution, and the quantum nature of chemical compounds. This article is intended to review specfic languages features and their use in computational science. We will review the strengths and weaknesses of different programming styles, with examples taken from widely used scientific codes.Comment: 21 page

    Revisiting Ad-hoc Polymorphism

    Get PDF
    Ad-hoc polymorphism is a type of polymorphism where different function definitions can be given the same name. Programming languages utilize constructs like Type classes and Object classes to provide a mechanism for implementing ad-hoc polymorphism. System O, by Odersky, Wadler, and Wehr is a language which defines a dynamic semantics that supports ad-hoc polymorphism. It also describes static type checking for its programs and a transformation to the Hindley/Milner system. In this study, we present extensions to System O by defining constructs that make the language more practical to use. We utilize the dynamic semantics to define the ability to express type classes. We define additional optimizations on the transform that aim to reduce redundant function calls at run-time and simplify the generated code. Finally, we implement an interpreter for this programming language in Clojure, and provide several examples of programs utilizing ad-hoc polymorphism with the constructs we have defined

    The Role of Sonification as a Code Navigation Aid: Improving Programming Structure Readability and Understandability For Non-Visual Users

    Get PDF
    Integrated Development Environments (IDEs) play an important role in the workflow of many software developers, e.g. providing syntactic highlighting or other navigation aids to support the creation of lengthy codebases. Unfortunately, such complex visual information is difficult to convey with current screen-reader technologies, thereby creating barriers for programmers who are blind, who are nevertheless using IDEs. This dissertation is focused on utilizing audio-based techniques to assist non-visual programmers when navigating through large amounts of code. Recently, audio generation techniques have seen major improvements in their capabilities to covey visually-based information to both sighted and non-visual users – making them a potential candidate for providing useful information, especially in places where information is visually structured. However, there is little known about the usability of such techniques in software development. Therefore, we investigated whether audio-based techniques capable of providing useful information about the code structure to assist non-visual programmers. The major contributions in this dissertation are split into two major parts: The first part of this dissertation explains our prior work that investigates the major challenges in software development faced by non-visual programmers, specifically code navigation difficulties. It also discusses areas of improvement where additional features could be developed in order to make the programming environment more accessible to non-visual programmers. The second part of this dissertation focuses on studies aimed to evaluate the usability and efficacy of audio-based techniques for conveying the structure of the programming codebase, which was suggested by the stakeholders in Part I. Specifically, we investigated various sound effects, audio parameters, and different interaction techniques to determine whether these techniques could provide adequate support to assist non-visual programmers when navigating through lengthy codebases. In Part II, we discussed the methodological aspects of evaluating the above-mentioned techniques with the stakeholders and examine these techniques using an audio-based prototype that was designed to control audio timing, locations, and methods of interaction. A set of design guidelines are provided based on the evaluation described previously to suggest including an auditory-based feedback system in the programming environment in efforts to improve code structure readability and understandability for assisting non-visual programmers

    XESS: The XML expert system shell

    Get PDF
    The XML Expert System Shell (XESS) was designed to alleviate some of the difficulties associated with translating a knowledge base from one expert system to another. The major goal of XESS is to allow programmers to model an expert system, complete with traditional facts and rules, in an XML-based language that leverages the universally understood terms used when teaching artificial intelligence to students. XML, the extensible markup language, is a text-based standard for information interchange between disparate systems1; it was originally designed to represent data in an easily parsable, human readable format2. While some extensions of the XML specification, particularly the Simple Object Access Protocol (SOAP), have long since abandoned human readability, the core XML specification is still used frequently to produce documents that can easily be exchanged between computational platforms and created or understood by human beings. The XESS-XML language inherits all of the usability of XML; it can be edited by hand in any text editor, is human readable, and can be parsed using XML parsers commonly available in any modern programming language. The XML Schema specification provides a mechanism for explicitly defining the content of an XML document so that a document can be validated3,4,5. XML schemas specify the make-up of an XML document in exacting detail6, using a pseudo-object-oriented syntax to specify exactly which entities are allowed in the document, the attributes of those entities, where they are allowed in the document, and how often they may occur. The XESS-XML language is defined as a fully extensible XML Schema, which can be used to validate any knowledge base written in the language. The Schema provides entities for common facts (e.g. predictes, structs) and a robust syntax for expressing rules in an if-then-else format, as well as the actions that should be taken in the event that a rule is fired. Additionally, because XML schemas are fully extensible, the XESS schema may be extended to add additional functionality such as support for fuzzy logic, new clause types, or new actions to be taken when rules are fired. In addition to the XML language, XESS also includes an object oriented interpreter specification that defines a robust set of language independent APIs for interacting with the expert system. This interpreter specification is meant to set expectations, both for XESS developers and users, as to the features provided by the XESS API regardless of the language in which the interpreter has been implemented. As part of the specification, the XESS API also provides object oriented definitions for XESS plug-ins; a plug-in is capable of translating from an XESS document to the native language of a specific expert system shell in a generic way (i.e. not specific to any one rule set) and back again. This allows users to express custom expert system shells in the XESS-XML language, parse them using an XESS interpreter written in any language, and translate them to a specific expert system shell through the use of an XESS plug-in without needing to learn the specific expert system shell language or rewriting the knowledge base once for each shell tested

    Usability issues and design principles for visual programming languages

    Get PDF
    This thesis was submitted for the degree of Doctor of Philosophy and awarded by Brunel University.Despite two decades of empirical studies focusing on programmers and the problems with programming, usability of textual programming languages is still hard to achieve. Its younger relation, visual programming languages (VPLs) also share the same problem of poor usability. This research explores and investigates the usability issues relating to VPLs in order to suggest a set of design principles that emphasise usability. The approach adopted focuses on issues arising from the interaction and communication between the human (programmers), the computer (user interface), and the program. Being exploratory in nature, this PhD reviews the literature as a starting point for stimulating and developing research questions and hypotheses that experimental studies were conducted to investigate. However, the literature alone cannot provide a fully comprehensive list of possible usability problems in VPLs so that design principles can be confidently recommended. A commercial VPL was, therefore, holistically evaluated and a comprehensive list of usability problems was obtained from the research. Six empirical studies employing both quantitative and qualitative methodology were undertaken as dictated by the nature of the research. Five of these were controlled experiments and one was qualitative-naturalistic. The experiments studied the effect of a programming paradigm and of representation of program flow on novices' performances. The results indicated superiority of control-flow programs in relation to data-flow programs; a control-flow preference among novices; and in addition that directional representation does not affect performance while traversal direction does - due to cognitive demands imposed upon programmers. Results of the qualitative study included a list of 145 usability problems and these were further categorised into ten problem areas. These findings were integrated with other analytical work based upon the review of the literature in a structured fashion to form a checklist and a set of design principles for VPLs that are empirically grounded and evaluated against existing research in the literature. Furthermore, an extended framework for Cognitive Dimensions of Notations is also discussed and proposed as an evaluation method for diagrammatic VPLs on the basis of the qualitative study. The above consists of the major findings and deliverables of this research. Nevertheless, there are several other findings identified on the basis of the substantial amount of data obtained in the series of experiments carried out, which have made a novel contribution to knowledge in the fields of Human-Computer Interaction, Psychology of Programming, and Visual Programming Languages

    Search-based composed refactorings

    Get PDF
    Refactorings are commonly applied to source code to improve itsstructure and maintainability. Integrated development environments(IDEs) such as Eclipse or NetBeans offer refactoring support for variousprogramming languages. Usually, the developer makes a particularselection in the source code, and chooses to apply one of the refactorings,which is then executed (with suitable pre-condition checks) by the IDE.Here, we study how we can reuse two existing refactorings toimplement a more complex refactoring, and use heuristics to derivesuitable input arguments for the new refactoring. We show that ourcombination of the Extract Method and Move Method refactoring canautomatically improve the code quality on a large Java code base
    • …
    corecore