0. Quick Links
-
SubScript-FLOPS2016
- Some New Directions for ACP Research
- SubScript White Paper
- A Java extension with support for dimensions
1. Declarative Programming with Algebra
Paper presented Functional and Logic Programming, FLOPS 2016, Kochi, Japan
Abstract
The Algebra of Communicating Processes (ACP) is a theory that views sequences and choices as mathematical operations: multiplication and addition. Based on these base constructs others are defined, such as parallel merge, interruption and disruption.
Conventional programming languages may be enriched with ACP features, to gain declarative expressiveness. We have done this in SubScript, an extension to the Scala language. SubScript has high level support for sequences, choices and iterations in a style similar to parser generator languages. It also offers parallel composition operations, such as and- and or- parallelism, and dataflow.
The declarative style is also present in the way various execution modes are supported. Conventional programming languages often require some boilerplate code to run things in the background, in the GUI thread, or as event handlers. SubScript supports the same execution modes, but with minimal boilerplate. It is also easy to compose programs from blocks having different execution modes.
This paper introduces ACP and SubScript; it briefly describes the current implementation, and gives several examples.
Download the PDF to read the complete paper: SubScript-FLOPS2016
2. Some New Directions for ACP Research
April 2015
This paper lists some new directions for research related to the Algebra of Communicating Processes (ACP). Most of these directions have been inspired by work on SubScript, an ACP based extension to the programming language Scala. SubScript applies several new ideas that build on ACP, but currently these lack formal treatment.
Some of these new ideas are rather fundamental. E.g. it appears that the theory of ACP may well apply to structures of any kind of items, rather than to just processes.
The aim of this list is to raise awareness of the research community about these new ideas; this could help both the research area and the programming language SubScript.
The paper is stored at Arxiv.org: Some New Directions for ACP Research
3. SUBSCRIPT: A WHITE PAPER
February 2011
SubScript is an extension to programming languages, aimed to ease developing interactive applications. Read this white paper to:
- understand the conceptual problem with the specification of control flow in currently used programming languages
- see that illustrated by an implementation of a simple application in Java
- see how easy the implementation is in SubScript
- find out the other benefits of SubScript
- learn about the technological and scientific developments leading to SubScript
As of this writing, SubScript has not been implemented, and the language definition is being finished. There is an implementation though of a predecessor language, named Scriptic, which shows the feasibility of the main SubScript constructs.
The conceptual gap
Our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed. For that reason we should do (as wise programmers aware of our limitations) our utmost to shorten the conceptual gap between the static program and the dynamic process, to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible.
These wise words are from the famous paper “Goto statement considered harmful” that Edsger Dijkstra wrote in 19681. In those days many programmers tended to use the “goto” statement, which too often obscured the control flow. The resulting programs were described as “spaghetti code”2. In the years after this paper, the use of goto statements decreased, also by improving choice and iteration constructs in programming languages. By 1980, “structured programming” had become widely accepted.
But spaghetti code returned, although this was not immediately recognized.
PDF of the complete paper: SubScript White Paper
4. A Java extension with support for dimensions
André van Delft did another old project that he would like to revive for Scala in the near future. In 1998 he developed an extension to Java with support for physical dimensions. This made it hard to make dimensional errors. E.g., the programmer would think in distances rather than feet, meters, kilometers and miles; these units are just constants of dimensional type Distance. And a distance could not be confused with a duration, etc. Before outputting a dimensioned variable the programmer would need to divide off an appropriate unit. This emphasizes that all I/O of dimensioned variables involves specific units, and thus the programmer would be reminded to check the units specified for the I/O. This work was published in June 1999 in the scientific journal Software: Practice and Experience, by Wiley:
A Java extension with support for dimensions
Imagine that a Lockheed engineer working on the Mars Climate Orbiter mission would have read this paper in July 1999. This then made him think about the issue of outputting dimensioned values relative to specified units. He suddenly realized that the software created by Lockheed was generating thrust instructions for the using Imperial measure pound-force (lbf), whereas NASA expects the instructions are for metric units. He raised this issue and the software problem was fixed in time. In September 1999 the space probe started orbiting around Mars.
But that is just imagination; unfortunately it did not happen. The Mars Climate Orbiter crashed due to a units-of-measurement bug.