SPLASH 2011
Fri 21 - Thu 27 October 2011 Portland, Oregon, United States

Using current software development techniques, code and designs are often unmaintainable from the point of inception. Code is brittle and hard to refactor, hard to press to new purposes, and hard to understand. Here we present a system aimed at creating a model for scalable development, addressing this and several other critical problems in software construction. Such an aim is far from new, and has resembled the aims of each generation of software methodologists over the last 50 years. It deserves comment why these aims have so signally failed to be achieved, and we will present arguments as to why the combination of techniques explained here could expect to lead to novel results.

Software products of today are notoriously unadaptable. An application which meets need A generally cannot be extended to meet apparently very similar need A’ without something resembling “software engineering”. Applications present users with a “take it or leave it” proposition - if the software doesn’t happen to meet a user’s needs or preferences, there’s no way to change it without writing more code, which is out of reach for most users. Indeed, software regularly fails to be easily adaptable to meet the needs of users with differing needs, such as in the case of accessibility. These “precarious values” - accessibility and usability with different devices, languages, and personal needs - are typically left until the end or ignored, and represent a significant expense in traditional approaches to software development. Often these needs are met by developing a largely unrelated version of the application, requiring maintenance of additional, separate code bases.

Our aim is to enable Inclusive Design [3], whose objective is to satisfy the needs and desires of the broadest range of users possible. Every designer sets out with this objective to a certain extent, but as well as limitations of intent, there are also strong limitations placed by the technology and economics of software development. Due to the poor scaling characteristics of current techniques, even meeting one set of relatively inflexible needs can be an expensive undertaking, especially over the long term.

To address these problems of adaptability, we present a model for software construction, together with a base library, Fluid Infusion, implemented in the JavaScript language. Fluid Infusion implements an Inversion of Control model, Infusion IoC, which features a notion of context as the basis for adaptability, resolved in a scope modelled in terms of a data structure, a component tree expressing the computation to be performed. In the Context-Oriented Programming community [7], this model of scoping is known as structural scoping. We will also work with a model of transparent state in which all modifiable state of interest to users is held in publicly visible locations, indexed by path strings. This model for state is isomorphic to that modeled by JSON [6], a well-known state model derived from, but not limited to, the JavaScript language. Instantiation in the model is handled by an Inversion of Control system extended from the model of similar system such as the Spring Framework or Pico first developed in the Java language.

We relate such systems to goal-directed resolution systems such as Prolog, and show that they have beneficial properties such as homoiconicity [2] which have not been seen in a strong or widespread form since the days of LISP. We exhibit some cases to show how the framework enables, through a simple declarative syntax, types of adaptation and composition that are hard or impossible using traditional models of polymorphism. We also relate Infusion IoC to other software methodologies such as Aspect-Oriented Programming and Context-Oriented Programming which have been found to greatly increase flexibility and expressiveness of designs. We conclude with some remarks on the applicability of the system to the parallelisation of irregular algorithms, and its relationship to upcoming developments in the ECMAScript 6 language specification.