|Title:||Workshop on Translating CSP-Based Languages to Common Programming Languages|
|Conference:||Communicating Process Architectures 2018|
Brian Vintera, Lawrence J. Dicksonb, James Dibleyc
(a) Niels Bohr Institute, University of Copenhagen
(b) Space Sciences Corporation
(c) Department of Computer Science, Rhodes University
Programming in CSP style has traditionally been done in occam, or languages such as csp_m for more formal verification. Occam has been in a frozen state for almost 30 years, though a runnable toolset is still available on transputer.net, and code can be targeted to Gavin Chase’s Transputer Emulator and to the Transterpreter. Getting to a setup where one may compile and run occam programs with the more recent KROC occam-Pi is non-trivial, and getting the compiled occam-Pi code to run on different platforms is even more work.
Alternatively to occam one may use one of the many library-based CSP approximations. However, these are typically not as easy to program as occam, and for portability may require large runtime environments. And both these and the occam-Pi approach lose a huge CSP and static occam advantage: the hardware-software equivalence that can use hardware channels (links) to program and run communicating independent devices in an extremely slim and understandable way.
One viable approach may be to implement a transpiler, where occam or related languages are translated rigorously into other, more common, languages that typically have highly maintained libraries on many platforms. This has been done for plain C, but languages like Go and Rust, which already have CSP-like primitives which have performed well in previous (CPA2017) projects, would be more attractive choices for such target languages.
The workshop will focus on Go, though not exclusively. It will motivate the problems, exhibit techniques for transforming near-CSP Go constructs into rigorously correct occam constructs, relate these to a complete lex/yacc grammar for the occam language, demonstrate a few applications that are not easily achievable with what is available today, and introduce ongoing work on producing transpilers, including the rigorous extension and porting of the link concept to drive more typical modern hardware communication such as block and network devices.