The SJ Framework for Transport-Independent, Type-Safe, Object-Oriented Communications Programming

Raymond Hu (homepage), Nobuko Yoshida (homepage), Andi Bejleri (homepage), Kohei Honda (homepage)


Communications programming, involving complex message exchanges over multiple transports, is an omnipresent element in modern distributed applications. Existing engineering solutions however have considerable limitations: there is no portability across differing transports. Programming abstractions for communication are typically provided through low-level APIs, bound to specific transports or application domains, without offering either type or protocol safety. This paper proposes an extensible Java-based language and runtime framework which enables safe and efficient virtualisation of communications programming across heterogeneous transports. Application programmers describe communications in terms of high-level, structured sessions, without concern for underlying transport mechanisms. After type-checking, the compiler generates a transport-independent intermediate form, which can be efficiently executed by the runtime across different transports whilst ensuring communication safety. Through portable, abstract low-level communication instructions defined by the Abstract Transport, a new transport can quickly and seamlessly integrate with existing session services. A case for transport independence is made using concrete applications from widely different domains, including parallel algorithms, a Web-based application server, and Internet chat. The benchmark results show this framework imparts significant gains in portability, safety and productivity, as well as efficient utilisation of individual transports through type-directed optimisation.


Further details regarding implementation and benchmarks of parallel algorithms using SJ can be found here.

Detailed results from the benchmarks in Section 6 of the above paper.

To compile an SJ program, from the sessionj directory do e.g.

   bin/sessionjc tests/src/mypackage/ -d tests/classes/

and to run a compiled program, do

   bin/sessionj -cp tests/classes/ mypackage.MyProgram

Note: the SJ compiler currently accepts only Java 1.4, due to the version of Polyglot used.

Information and materials regarding the preceding SJ version can be found here.