OCTOBER 25 TO 29, 2009
In this paper we describe Ginger, a new language with first class support for literate programming. Literate programming is a philosophy that argues computer programs should be written as literature with human readability and understanding of paramount importance. While the intent of literate programming is to make understanding computer programs simpler, most literate programming systems are quite complex and consist of three different languages corresponding to 1) an implementation language, 2) a documentation language, and 3) a literate programming glue language. In Knuth's original implementation these were Pascal, TeX, and WEB respectively. Antithetical to the goals that literate programming espouses, this three language paradigm creates a truly challenging environment for new programmers. In this paper we reimagine literate programming as a core programming language feature and describe a novel system for literate programming based on G-expression transformations. We show that Ginger code can be used to naturally represent code, prose, and literate connections, which in turn unifies, simplifies and significantly extends the literate programming experience.
Objects model the world, and state is fundamental to a faithful modeling. Engineers use state machines to understand and reason about state transitions, but programming languages provide little support for reasoning about or implementing these state machines, causing software defects and lost productivity when objects are misused.
We propose Typestate-Oriented Programming as a natural extension to the object paradigm, where objects are modeled not just in terms of classes, but in terms of changing states. Each state may have its own representation and methods which may transition the object into a new state. A flow-sensitive, permission-based type system helps developers track which state objects are in. First-class typestates are a powerful abstraction that will help developers model and reuse objects more efficiently and correctly.
Visualization of a program typically entails low level views of the program execution state showing, for example,method invocations or relations amongst heap objects. In most cases, this would imply visualization of the executable program. However there is a certain genre of programs that analyze or transform other programs. These programs could be compilers, static bug detectors, test suite analyzers, model to model transformers etc. In such cases, very often, it helps to visualize what is happening to the input program rather than the analyzer program. It is for such programs that we describe a configurable, analysis framework. For ease of exposition, we call the analyzer program the manipulate program, and the input program the puppet program. To facilitate the visualization, we instrument the manipulate program to generate a dump as it analyzes the puppet program. Using the dump, we reconstruct the interprocedural control flow graph of the puppet program and then visualize the flow of the manipulate program over the puppet program. We use colors to highlight different events in the manipulate program. Using this scheme, we are able to (1) gain insight into the manipulate program; (2) collect useful information / statistics about the puppet program. We have implemented the visualizer in a tool called INSIGHT. We ran INSIGHT on a static debugging tool (the manipulate program) called XYLEM. XYLEM applies static analysis to find potential null pointer exceptions in a puppet program, as for example, the Apache Ant program. We report the insights gained by running XYLEM through INSIGHT on ANT and other puppet programs.
This paper suggests an approach to formal software system architecture specification based on behavior models. The behavior of the system is defined as a set of events (event trace) with two basic relations: precedence and inclusion. The structure of event trace is specified using event grammars and other constraints organized into schemas. The schema framework is amenable to stepwise architecture refinement up to executable design and implementation models, reuse, composition, visualization, and application of automated tools for consistency checks.