Part II
Panini Language and its Features
To recall from previous chapters, capsule-oriented programming and the Panini language is designed to help programmers deal with the challenges of concurrent program design. The value proposition of the programming paradigm and the programming language is twofold:
- to enable greater program modularity and in doing so automatically enable greater program concurrency, and
- improve reasoning about programs in the presence of concurrency.
In fact, Panini does not use explicit concurrency features. Instead, the programmer modularizes a program using capsules, which implicitly specify boundaries outside of which concurrency can occur. The Panini runtime will automatically enable concurrency in between the boundaries of capsules when safe to do so. We will now discuss each part of the programming language in more detail.
Panini introduces three main features to extend the Java language. A capsule declaration, in short capsule, that is designed as a mechanism for decomposing a program into its parts, a signature declaration that serves as an interface for capsules. A capsule declaration may optionally contain a design declaration that is a mechanism for composing instances of capsules to form a subsystem or even an entire program. These three features and their parts are described below as follows:
5.1 Syntax of Capsule Declaration
5.2 Capsule States
5.3 Capsule Initializer
5.4 Capsule Procedures
5.5 Autonomous Capsule Behavior
5.6 Capsule Procedure Calls
5.7 Shutdown and Exit Procedures
5.8 Example: Bank Account
5.9 Implicit concurrency
6 Design Declarations
6.1 Capsule Instance Declarations
6.2 Wiring Capsule Instances
6.3 Topology operators in design declarations
7 Signature Declarations
8 Capsule State Confinement
8.1 Confinement between Instances of a Capsule
8.2 Confinement Violation in Procedure Call
8.3 Confinement Violation in Return Statements
8.4 Resolving Confinement Violation