M.Sc Thesis


M.Sc StudentPeled Matan
SubjectThapl - A Theatrical Programming Language
DepartmentDepartment of Computer Science
Supervisors ASSOCIATE PROF. Joseph Gil
ASSOCIATE PROF. David Lorenz
Full Thesis textFull thesis text - English Version


Abstract

This work explores an innovative approach to the declarative and imperative paradigms of programming languages. To demonstrate this approach, I developed a prototype domain-specific language inspired by the scripts of theatrical plays, hence dubbed Thapl. Thapl’s intended use is in the context of animation generation in “slide-show” presentations. There are two different ways to integrate animations in a presentation. The first is to embed an animation within a single slide, so that the animation starts when that slide starts and stops when continuing to the next slide, as if it were a video. The other is to present the animation as a series of slides, where each slide is static, like a flip book or a kinetoscope; Thapl embraces this latter approach. The theatrical play metaphor encompasses the concept of a classical theatrical play script (e.g., Shakespearean play), enumerating the “Dramatis Personæ,” scenery, text, and actions (e.g., “exit chased by a bear”). Thapl is practical for real-world uses such as slide-shows for academic courses (especially those that deal with algorithms or graphs), product presentations, and fiscal reviews.


Thapl expands the declarative and imperative paradigms by introducing a declarative vocabulary for describing actors and actions on those actors, as well as a behavior language with specialised constructs for describing sequential and concurrent actions. Although programming languages that create presentations and animations already exist, they either operate at unreasonably low levels of abstraction which are ill-suited for creating animations or are aimed at authoring other media types (e.g., films), and only support slide-show creation as an after-thought. Conversly, existing software tools for creating slide-shows are not designed for animations. Modifying an existing animation is hard, and for solutions that utilize binary formats, fundamental software-engineering tools such as source control and diff are impractical.


This work argues for the application of ideas from the declarative programming paradigm in order to focus on specifying behavior, which enables presentation authors to create maintainable presentations. Using Thapl, the programmer describes the animation in a structured way, declaring relations between events. It is then the compiler’s job to sort out the details, e.g., enumerating slides and the duration of each part of the animation. This concept can also be applied to other domains in which the main concern is specifying behavior over time.