.pn 1
.HD
.bp
.SZ 10 13
.sp .25i
.(l C
\fBReport on the SR Programming Language\fR
.sp .25
\fBVersion 1.1\fR
.)l
.sp .25i
.sh 1 "Introduction"
.lp
SR is a language for writing distributed
programs ranging from small examples to distributed operating systems.
The main language constructs are resources and operations.
Resources encapsulate procedures or processes
and the variables they share;
operations support process interaction.
Both resources and processes are created dynamically.
SR provides a variety of mechanisms for invoking and servicing operations.
Consequently, all of local and remote procedure
call, dynamic process creation, asynchronous message
passing, multicast, and semaphores are supported.
In addition, the sequential and concurrent components
of the language have been carefully integrated.
The result is a language with a great deal of
expressive power, but one that is also quite easy
to learn and has a relatively efficient implementation.
.pp
This report defines Version 1.1 of SR.
As in Version 1.0, SR programs execute on top of UNIX on
one or more processors of the same type.
Version 1.1 contains numerous bug fixes and performance enhancements.
Also, the implementation has been ported to several new processor architectures.
Finally, the language and supporting tools have been extended in
several ways to include new functionality.
A full list of the changes from Version 1.0 to Version 1.1
is given in the document ``Release Notes for SR Version 1.1,''
which is typically stored online in the %doc subdirectory
of the directory in which the SR installation is mounted.
.pp
The presentation in this report is terse, but examples are given
throughout to illustrate the form and use of each construct.
Additional examples are given in References 4 and 5, although
SR has changed some since those papers were written.
Also, several complete programs are stored on-line, typically
in the %examples subdirectory of the directory
in which the SR installation is mounted.
.sh 2 "History and References"
.lp
The basic concepts of SR, resources and operations,
were first described in [1].
These were incorporated into
the initial version of SR, which is now called SR[[0]] [2].
Based on experience using SR[[0]], we undertook in 1985
to design a new version of the language.
The result of that redesign was described in [3].
A general discussion of what has changed and why,
as well as what has not changed and why not, appeared in [4].
After using and testing the language locally, we released
Version 1.0 of SR in March 1988.
An overview of that version of SR and its implementation,
as well as discussion of related work appeared in [5];
the reference manual appeared in [6].
.pp
In the past year, SR has been used at over 100 sites throughout
the world.
Feedback from users\(emand contributions from some of them\(emhave
led to this version of the language and implementation.
Several papers have also appeared reporting on experiences
using SR.
Reference [7] describes the use of SR to experiment with
different ways to structure network communications software.
Reference [8] reports on the performance of the tasking,
communication, and synchronization mechanisms in SR and compares
their performance to other languages.
Reference [9] shows how to program multiway rendezvous interactions in SR.
Finally, reference [10] describes the %srm tool for generating
makefiles for SR programs.
.sp .5
.SZ 9 12
.nr tp 10
.ip [1]
Andrews, G.R.  Synchronizing Resources.
\fIACM Trans. on Prog. Lang. and Systems 3\fR, 4
(Oct. 1981), 405-430.
.ip [2]
Andrews, G.R.  The distributed programming language SR.
\fISoftware\(emPractice and Experience 12\fR, 8
(Aug. 1982), 719-754.
.ip [3]
Andrews, G.R. and Olsson, R.A.
Report on the distributed programming language SR.
TR 85-23, Dept. of Computer Science,
The University of Arizona, November 1985.
.ip [4]
Andrews, G.R. and Olsson, R.A.
The evolution of the SR language.
\fIDistributed Computing 1\fR, 3 (July 1986), 133-149.
.ip [5]
Andrews, G.R., Olsson, R.A., Coffin, M.,
Elshoff, I., Nilsen, K., Purdin, T., and Townsend, G.
An overview of the SR language and implementation.
\fIACM Trans. on Prog. Lang. and Systems 10\fR, 1 (Jan. 1988), 51-86.
.ip [6]
Andrews, G.R. and Olsson, R.A.
Revised report on the SR programming language.
TR 87-27, Dept. of Computer Science,
The University of Arizona, November 1987.
.ip [7]
Atkins, M.S.
Experiments in SR with different upcall program structures.
\fIACM Trans. on Computer Systems 6\fR, 4 (Nov. 1988), 365-392.
.ip [8]
Atkins, M.S. and Olsson, R.A.
Performance of multitasking and synchronization mechanisms
in the programming language SR.
\fISoftware\(emPractice and Experience 18\fP, 9 (September 1988), 879-895.
.ip [9]
Coffin, M. and Olsson, R.A.
An SR approach to multiway rendezvous.
#Computer #Languages, to appear.
.ip [10]
Olsson, R.A. and Whitehead, G.R.
A simple technique for automatic recompilation
in modular programming languages.
\fISoftware\(emPractice and Experience\fP, to appear.
.SZ 10 13
.sh 2 "Vocabulary and Notation"
.lp
SR programs are constructed out of sequences of tokens.
Throughout this report, SR tokens are typeset
in @\*F@ font.
The different kinds of tokens and their attributes are:
.np
Identifiers are sequences of letters, digits, and underscores.
The first character must be a letter.
The case of letters is significant;
e.g., @Foo@ and @foo@ are different identifiers.
.np
Keywords are special identifiers whose meaning is fixed in the language.
They appear in the SR grammar as terminals.
The complete set of keywords is listed in Appendix 1.
.np
Literals are boolean values, integers, character strings,
user-defined enumeration literals, and pointer,
capability, and file constants.
The different literals are defined in Sec. 7.2.
.np
Operators and separators are special characters, double characters,
or keywords.
They are illustrated as they would be typed
in a source program.
.np
White space (blanks, tabs, and newlines) may occur between any two tokens.
It is ignored unless it is essential to separate two tokens,
such as a keyword followed by an identifier.
.np
Comments are introduced in two ways.
One-line comments begin with `@#@'
and end with the next newline character (or the end of file).
Bracketed comments begin with `@/*@' and
end with a corresponding occurrence of `@*/@.'
Bracketed comments may be nested,
but otherwise all characters within a comment
are ignored until the end of that comment is reached.
For example, `@#@' is ignored within a bracketed comment.
.pp
The syntax of SR programs is defined in this report
using a compact variant of BNF.
Non-terminals are identifiers set in roman type.
Terminals are represented by the actual token set in @\*F@ type.
The symbol `#' is used within productions to separate alternatives.
Superscript `o' attached to a symbol
indicates that it is optional.
Superscript `*' (`+') on a non-terminal indicates
that the non-terminal may be repeated zero (one) or more times.
Superscript `*' (`+')
on delimiters such as commas indicates that the
\fIpreceding\fR non-terminal may be repeated zero (one)
or more times, with multiple occurrences separated by the delimiter.
For example, the following productions define the syntax of
identifier lists:
.(b
identifier_list   ::=   identifier  @,@{{+}}
identifier   ::=   letter  identifier_symbol{{*}}
identifier_symbol   ::=   letter  #  digit  #  underscore
.)b
.pp
To help convey semantic information,
in several places in the grammar the non-terminals
`identifier' and `expression' are preceded by an adjective
indicating the kind of identifier or type of expression
that is required.
For example, `integer_expression' is used whenever
an expression must have type integer.
.pp
Semicolons do not appear in the SR grammar since their use is not required.
However, they may be used after any declaration or statement, as in C,
or as declaration and statement separators, as in Pascal.
The convention followed in examples in this report is to use semicolons
only to separate declarations or statements that appear on the same line.
