498 research outputs found
Views, Program Transformations, and the Evolutivity Problem in a Functional Language
We report on an experience to support multiple views of programs to solve the
tyranny of the dominant decomposition in a functional setting. We consider two
possible architectures in Haskell for the classical example of the expression
problem. We show how the Haskell Refactorer can be used to transform one view
into the other, and the other way back. That transformation is automated and we
discuss how the Haskell Refactorer has been adapted to be able to support this
automated transformation. Finally, we compare our implementation of views with
some of the literature.Comment: 19 page
Dynamically typed languages
Dynamically typed languages such as Python and Ruby have experienced a rapid grown in popularity in recent times. However, there is much confusion as to what makes these languages interesting relative to statically typed languages, and little knowledge of their rich history. In this chapter I explore the general topic of dynamically typed languages, how they differ from statically typed languages, their history, and their defining features
Trustworthy Refactoring via Decomposition and Schemes: A Complex Case Study
Widely used complex code refactoring tools lack a solid reasoning about the
correctness of the transformations they implement, whilst interest in proven
correct refactoring is ever increasing as only formal verification can provide
true confidence in applying tool-automated refactoring to industrial-scale
code. By using our strategic rewriting based refactoring specification
language, we present the decomposition of a complex transformation into smaller
steps that can be expressed as instances of refactoring schemes, then we
demonstrate the semi-automatic formal verification of the components based on a
theoretical understanding of the semantics of the programming language. The
extensible and verifiable refactoring definitions can be executed in our
interpreter built on top of a static analyser framework.Comment: In Proceedings VPT 2017, arXiv:1708.0688
MELT - a Translated Domain Specific Language Embedded in the GCC Compiler
The GCC free compiler is a very large software, compiling source in several
languages for many targets on various systems. It can be extended by plugins,
which may take advantage of its power to provide extra specific functionality
(warnings, optimizations, source refactoring or navigation) by processing
various GCC internal representations (Gimple, Tree, ...). Writing plugins in C
is a complex and time-consuming task, but customizing GCC by using an existing
scripting language inside is impractical. We describe MELT, a specific
Lisp-like DSL which fits well into existing GCC technology and offers
high-level features (functional, object or reflexive programming, pattern
matching). MELT is translated to C fitted for GCC internals and provides
various features to facilitate this. This work shows that even huge, legacy,
software can be a posteriori extended by specifically tailored and translated
high-level DSLs.Comment: In Proceedings DSL 2011, arXiv:1109.032
Refactoring Erlang programs
This paper presents the model, the design principles and the prototype of a refactoring toolset for Erlang programs. With this toolset one can incrementally carry out programmer-guided meaning-preserving program transformations. Erlang is a mostly dynamically typed language, and many of its semantical rules are also dynamic. Therefore the main challenge in this research is to ensure the safety of (the statically performed) refactoring steps. The paper analyses the language constructs of Erlang with respect to refactoring.
A novelty of the presented approach is that programs are represented, stored and manipulated in a relational database. This feature makes it possible to express refactoring steps in a fairly compact and comprehensible way.
The proposed software development environment with the integrated refactoring tool provides multiple editing modes. These editing modes support changes ranging from fully controlled (allowing only meaning-preserving transformations) to uncontrolled (editing program text freely). Transformations are performed more safely and efficiently in an editing mode with higher control
Refactoring pattern matching
Defining functions by pattern matching over the arguments is advantageous for understanding and reasoning, but it tends to expose the implementation of a datatype. Significant effort has been invested in tackling this loss of modularity; however, decoupling patterns from concrete representations while maintaining soundness of reasoning has been a challenge. Inspired by the development of invertible programming, we propose an approach to program refactoring based on a right-invertible language rinv—every function has a right (or pre-) inverse. We show how this new design is able to permit a smooth incremental transition from programs with algebraic datatypes and pattern matching, to ones with proper encapsulation, while maintaining simple and sound reasoning
- …