Analysis of paradigm use in multiparadigm language programs
Denise Suzanne Westbrook · 1998
In the context of programming languages, a programming paradigm defines a distinctive model for solving problems. When a programming language provides linguistic support for more than one paradigm, it can be called a multiparadigm language (MPL). In using an MPL to solve a problem, the available paradigms may be combined in different ways, depending on the particular language and how the programmer perceives a solution, thus making the program more paradigmatically complex than one written in a single paradigm language. In this dissertation, we use the multiparadigm language GED, which supports the imperative, functional, logic, and object-oriented paradigms, as a basis for examining paradigm use in MPL programs. We define a model for representing paradigm use in an MPL program as identified by the features (and deviations from those features) of the imperative, functional, logic, and object-oriented paradigms. This model, called a paradigmatic map, is an abstract syntax tree where each node represents some language construct annotated with a paradigm representing the paradigmatic effect at that point. The association of paradigms to language constructs as they occur in a program was formalized with a paradigm inference system consisting of inference rules for GED constructs. From a paradigmatic map of a program, differences between paradigm use can be observed. We define a paradigm transition as a change in paradigm use either between adjacent sibling nodes in a paradigmatic map (peer transition) or from child nodes to their parent (abstraction transition). A software tool, GPA (GED Paradigm Analyzer), was developed that produces a paradigmatic map and captures paradigm transition information from a GED program. GPA was used on student programs to assess how well students stayed within a single paradigm when instructed to do so and to observe differences in paradigm use when all paradigms were made available. Through this work, a system for analyzing paradigm use in MPL programs has been defined, implemented, and applied. While our work is based on the language GED, we believe it can be adapted to other multiparadigm and non-imperative languages to gain information on how and why different paradigms are used by programmers.