<s>
S-algol	B-Language
(	O
St	O
Andrews	O
Algol	B-Language
)	O
is	O
a	O
computer	O
programming	O
language	O
derivative	O
of	O
ALGOL	B-Language
60	I-Language
developed	O
at	O
the	O
University	O
of	O
St	O
Andrews	O
in	O
1979	O
by	O
Ron	O
Morrison	O
and	O
Tony	O
Davie	O
.	O
</s>
<s>
The	O
language	O
is	O
a	O
modification	O
of	O
ALGOL	B-Language
to	O
contain	O
orthogonal	O
data	O
types	O
that	O
Morrison	O
created	O
for	O
his	O
PhD	O
thesis	O
.	O
</s>
<s>
Morrison	O
would	O
go	O
on	O
to	O
become	O
professor	O
at	O
the	O
university	O
and	O
head	O
of	O
the	O
department	B-General_Concept
of	I-General_Concept
computer	I-General_Concept
science	I-General_Concept
.	O
</s>
<s>
The	O
S-algol	B-Language
language	O
was	O
used	O
for	O
teaching	O
at	O
the	O
university	O
at	O
an	O
undergraduate	O
level	O
until	O
1999	O
.	O
</s>
<s>
The	O
computer	B-General_Concept
science	I-General_Concept
text	O
Recursive	B-Application
Descent	I-Application
Compiling	B-Language
describes	O
a	O
recursive	B-Application
descent	I-Application
compiler	I-Application
for	O
S-algol	B-Language
,	O
implemented	O
in	O
S-algol	B-Language
.	O
</s>
<s>
PS-algol	B-Language
is	O
a	O
persistent	B-Application
derivative	O
of	O
S-algol	B-Language
.	O
</s>
<s>
It	O
supports	O
database	O
ability	O
by	O
providing	O
for	O
longevity	O
of	O
data	O
in	O
the	O
form	O
of	O
a	O
persistent	B-Application
heap	O
that	O
survives	O
termination	O
of	O
PS-algol	B-Language
programs	O
.	O
</s>
<s>
Ron	O
Morrison	O
's	O
1979	O
PhD	O
thesis	O
,	O
On	O
the	O
Development	O
of	O
Algol	B-Language
,	O
describes	O
the	O
design	O
and	O
implementation	O
of	O
the	O
S-algol	B-Language
language	O
.	O
</s>
<s>
The	O
technical	O
report	O
defining	O
the	O
language	O
,	O
The	O
S-algol	B-Language
Reference	O
Manual	O
(	O
1979	O
,	O
1988	O
)	O
,	O
thanks	O
several	O
people	O
for	O
their	O
help	O
,	O
including	O
David	O
Turner	O
for	O
discussions	O
on	O
language	O
design	O
around	O
1975	O
.	O
</s>
<s>
The	O
1981	O
computer	B-General_Concept
science	I-General_Concept
text	O
Recursive	B-Application
Descent	I-Application
Compiling	B-Language
describes	O
the	O
compiler	B-Language
implementation	O
and	O
bootstrapping	B-Application
process	O
,	O
and	O
the	O
1982	O
book	O
An	O
Introduction	O
to	O
Programming	O
with	O
S-algol	B-Language
uses	O
the	O
language	O
to	O
teach	O
computer	O
programming	O
.	O
</s>
<s>
The	O
first	O
S-algol	B-Language
implementation	O
was	O
on	O
a	O
PDP-11/40	B-Device
computer	O
running	O
the	O
Unix	B-Application
operating	I-Application
system	I-Application
.	O
</s>
<s>
Due	O
to	O
the	O
small	O
64	O
kilobyte	O
address	B-General_Concept
space	I-General_Concept
available	O
on	O
the	O
PDP-11	B-Device
,	O
an	O
interpreted	O
bytecode	O
implementation	O
was	O
chosen	O
.	O
</s>
<s>
A	O
single-pass	B-Language
,	O
recursive	B-Application
descent	I-Application
compiler	I-Application
written	O
in	O
S-algol	B-Language
translated	O
S-algol	B-Language
source	O
into	O
S-code	O
,	O
a	O
bytecode	O
for	O
a	O
stack-based	B-Application
abstract	I-Application
machine	I-Application
tailored	O
for	O
S-algol	B-Language
.	O
</s>
<s>
The	O
S-code	O
was	O
then	O
executed	O
by	O
an	O
interpreter	B-Application
.	O
</s>
<s>
The	O
S-algol	B-Language
implementation	O
had	O
many	O
similarities	O
with	O
work	O
on	O
earlier	O
Pascal	B-Application
compilers	B-Language
.	O
</s>
<s>
The	O
technique	O
of	O
using	O
a	O
recursive	B-Application
descent	I-Application
compiler	I-Application
to	O
produce	O
code	O
for	O
an	O
abstract	B-Application
machine	O
was	O
well	O
known	O
,	O
with	O
the	O
Pascal	B-Application
P	O
compiler	B-Language
being	O
a	O
famous	O
example	O
from	O
the	O
early	O
1970s	O
.	O
</s>
<s>
The	O
S-algol	B-Language
compiler	B-Language
was	O
written	O
using	O
the	O
stepwise	O
refinement	O
process	O
described	O
by	O
Urs	O
Amman	O
for	O
the	O
development	O
of	O
a	O
Pascal	B-Application
compiler	B-Language
and	O
championed	O
by	O
the	O
inventor	O
of	O
Pascal	B-Application
,	O
Niklaus	O
Wirth	O
.	O
</s>
<s>
Reflecting	O
the	O
memory	O
organization	O
of	O
the	O
PDP-11	B-Device
as	O
32K	O
16-bit	O
words	O
,	O
the	O
S-code	O
instruction	O
encoding	O
was	O
designed	O
so	O
that	O
each	O
bytecode	O
consisted	O
of	O
one	O
word	O
.	O
</s>
<s>
The	O
initial	O
bootstrap	B-Application
was	O
performed	O
by	O
writing	O
an	O
S-algol	B-Language
compiler	B-Language
in	O
Algol	B-Language
W	I-Language
on	O
the	O
IBM/360	B-Application
that	O
produced	O
S-code	O
,	O
and	O
using	O
it	O
to	O
compile	B-Language
the	O
compiler	B-Language
written	O
in	O
S-algol	B-Language
to	O
S-code	O
.	O
</s>
<s>
The	O
resulting	O
S-code	O
file	O
was	O
copied	O
to	O
the	O
PDP-11	B-Device
and	O
executed	O
on	O
an	O
S-code	O
interpreter	O
written	O
for	O
the	O
PDP-11	B-Device
,	O
making	O
it	O
self-hosting	O
.	O
</s>
<s>
The	O
self-hosted	O
S-algol	B-Language
compiler	B-Language
executed	O
approximately	O
7.7	O
million	O
S-code	O
instructions	O
to	O
compile	B-Language
itself	O
,	O
generating	O
an	O
output	O
file	O
of	O
about	O
ten	O
thousand	O
S-code	O
instructions	O
(	O
16-bit	O
words	O
)	O
.	O
</s>
<s>
An	O
S-code	O
interpreter	O
was	O
written	O
for	O
the	O
VAX	B-Device
computer	O
running	O
VMS	B-Operating_System
,	O
making	O
the	O
VAX	B-Device
the	O
first	O
S-algol	B-Language
port	O
.	O
</s>
<s>
S-algol	B-Language
was	O
also	O
ported	O
to	O
the	O
Zilog	B-General_Concept
Z80	I-General_Concept
microprocessor	O
running	O
CP/M	B-Application
,	O
including	O
raster	B-Algorithm
graphics	I-Algorithm
facilities	O
that	O
had	O
been	O
added	O
to	O
the	O
language	O
.	O
</s>
<s>
In	O
1983	O
,	O
S-algol	B-Language
was	O
used	O
as	O
the	O
basis	O
for	O
the	O
PS-algol	B-Language
system	O
,	O
used	O
for	O
research	O
in	O
persistence	B-Application
.	O
</s>
<s>
The	O
PS-algol	B-Language
S-code	O
interpreter	O
was	O
implemented	O
in	O
C	B-Language
,	O
and	O
the	O
S-code	O
language	O
was	O
extended	O
to	O
include	O
raster	B-Algorithm
graphics	I-Algorithm
.	O
</s>
<s>
The	O
PS-algol	B-Language
implementation	O
was	O
the	O
basis	O
for	O
S-algol	B-Language
ports	O
to	O
the	O
Macintosh	B-Device
and	O
Sun	B-Device
workstations	I-Device
,	O
featuring	O
a	O
compiler	B-Language
rewritten	O
in	O
C	B-Language
and	O
targeting	O
the	O
extended	O
S-code	O
.	O
</s>
<s>
S-algol	B-Language
was	O
the	O
basis	O
for	O
the	O
PS-algol	B-Language
research	O
in	O
1983	O
,	O
and	O
a	O
few	O
years	O
later	O
PS-algol	B-Language
became	O
the	O
starting	O
point	O
for	O
the	O
Napier88	B-Language
language	O
and	O
implementation	O
.	O
</s>
<s>
While	O
all	O
S-algol	B-Language
compilers	B-Language
produced	O
S-code	O
to	O
be	O
interpreted	O
,	O
a	O
later	O
Napier88	B-Language
implementation	O
experimented	O
with	O
generating	O
code	O
in	O
C	B-Language
and	O
compiling	B-Language
it	O
with	O
the	O
gcc	B-Application
compiler	I-Application
to	O
provide	O
a	O
native	B-Language
code	I-Language
implementation	O
.	O
</s>
<s>
An	O
S-algol	B-Language
program	O
is	O
a	O
sequence	O
of	O
declarations	O
and	O
clauses	O
.	O
</s>
<s>
The	O
compiler	B-Language
infers	O
the	O
data	O
type	O
of	O
the	O
declared	O
constant	O
or	O
variable	O
from	O
the	O
type	O
of	O
the	O
initial	O
value	O
,	O
so	O
the	O
type	O
is	O
not	O
stated	O
explicitly	O
.	O
</s>
<s>
Data	O
types	O
include	O
integer	O
,	O
real	B-Algorithm
,	O
boolean	O
,	O
string	O
,	O
pointer	O
(	O
to	O
a	O
structure	O
)	O
,	O
and	O
file	O
,	O
and	O
vectors	O
(	O
arrays	O
)	O
of	O
these	O
types	O
.	O
</s>
<s>
As	O
its	O
name	O
suggests	O
,	O
S-algol	B-Language
is	O
a	O
member	O
of	O
the	O
ALGOL	B-Language
family	I-Language
of	O
programming	O
languages	O
.	O
</s>
<s>
Morrison	O
identifies	O
five	O
traits	O
of	O
the	O
ALGOL	B-Language
family	I-Language
:	O
</s>
<s>
Abstraction	B-Application
facility	O
–	O
Provision	O
of	O
a	O
powerful	O
abstraction	B-Application
facility	O
to	O
shorten	O
and	O
clarify	O
programs	O
.	O
</s>
<s>
In	O
the	O
ALGOL	B-Language
family	I-Language
this	O
is	O
offered	O
by	O
procedures	O
with	O
parameters	O
.	O
</s>
<s>
Compile-time	O
type	O
checking	O
–	O
Types	O
can	O
be	O
checked	O
by	O
a	O
static	O
analysis	O
of	O
the	O
program	O
.	O
</s>
<s>
In	O
the	O
ALGOL	B-Language
family	I-Language
this	O
is	O
effected	O
by	O
the	O
assignment	O
statement	O
.	O
</s>
<s>
S-algol	B-Language
was	O
designed	O
to	O
differ	O
from	O
prior	O
members	O
of	O
the	O
ALGOL	B-Language
family	I-Language
by	O
being	O
designed	O
according	O
to	O
semantic	O
principles	O
to	O
provide	O
power	O
through	O
simplicity	O
,	O
and	O
simplicity	O
through	O
greater	O
generality	O
.	O
</s>
<s>
Morrison	O
describes	O
three	O
semantic	O
principles	O
that	O
guided	O
the	O
design	O
of	O
S-algol	B-Language
:	O
</s>
<s>
This	O
principle	O
was	O
examined	O
by	O
R	O
.	O
D	O
.	O
Tennent	O
in	O
conjunction	O
with	O
Pascal	B-Application
,	O
and	O
has	O
its	O
roots	O
in	O
work	O
by	O
Peter	O
Landin	O
and	O
Christopher	O
Strachey	O
.	O
</s>
<s>
Principle	O
of	O
abstraction	B-Application
–	O
It	O
should	O
be	O
possible	O
to	O
abstract	B-Application
over	O
all	O
meaningful	O
semantic	O
categories	O
in	O
the	O
language	O
.	O
</s>
<s>
Examples	O
include	O
the	O
function	O
,	O
which	O
is	O
an	O
abstraction	B-Application
over	O
expressions	O
,	O
and	O
the	O
procedure	O
,	O
an	O
abstraction	B-Application
over	O
statements	O
.	O
</s>
<s>
Conceptual	O
store	O
–	O
The	O
key	O
design	O
decisions	O
concerning	O
the	O
store	O
(	O
memory	B-General_Concept
management	I-General_Concept
)	O
include	O
how	O
the	O
store	O
is	O
used	O
,	O
its	O
relationship	O
to	O
data	O
types	O
,	O
implementation	O
of	O
pointers	O
,	O
and	O
protection	O
(	O
constant	O
locations	O
that	O
ca	O
n't	O
be	O
updated	O
)	O
.	O
</s>
<s>
Morrison	O
's	O
thesis	O
explains	O
how	O
the	O
design	O
principles	O
were	O
applied	O
in	O
S-algol	B-Language
.	O
</s>
<s>
The	O
basic	O
or	O
primitive	O
data	O
types	O
in	O
S-algol	B-Language
are	O
integer	O
,	O
real	B-Algorithm
,	O
boolean	O
,	O
file	O
,	O
and	O
string	O
.	O
</s>
<s>
(	O
Later	O
pixel	B-Algorithm
and	O
picture	O
types	O
were	O
added	O
to	O
support	O
raster	B-Algorithm
graphics	I-Algorithm
.	O
)	O
</s>
<s>
Integer	O
,	O
real	B-Algorithm
,	O
and	O
boolean	O
are	O
types	O
common	O
to	O
most	O
programming	O
languages	O
.	O
</s>
<s>
The	O
file	O
type	O
is	O
an	O
input/output	B-General_Concept
(	O
I/O	B-General_Concept
)	O
stream	B-Architecture
that	O
allows	O
writing	O
or	O
reading	O
data	O
objects	O
.	O
</s>
<s>
It	O
is	O
much	O
more	O
pleasant	O
than	O
the	O
arrays	O
of	O
characters	O
used	O
in	O
Pascal	B-Application
.	O
</s>
<s>
For	O
any	O
data	O
type	O
T	O
,	O
*	O
T	O
is	O
the	O
type	O
of	O
a	O
vector	O
with	O
components	O
of	O
type	O
T	O
.	O
The	O
bounds	O
of	O
the	O
vector	O
are	O
not	O
part	O
of	O
its	O
type	O
but	O
are	O
determined	O
dynamically	O
,	O
and	O
multi-dimension	O
arrays	O
are	O
implemented	O
as	O
vectors	B-Data_Structure
of	I-Data_Structure
vectors	I-Data_Structure
.	O
</s>
<s>
Pointers	O
as	O
general	O
objects	O
themselves	O
as	O
in	O
ALGOL	B-Language
68	I-Language
and	O
C	B-Language
are	O
rejected	O
for	O
S-algol	B-Language
because	O
of	O
the	O
concerns	O
of	O
C.A.R.	O
</s>
<s>
Hoare	O
about	O
the	O
null	O
pointer	O
and	O
the	O
problems	O
with	O
dangling	B-Error_Name
pointers	I-Error_Name
.	O
</s>
<s>
S-algol	B-Language
provides	O
true	O
constant	O
values	O
,	O
objects	O
which	O
value	O
cannot	O
be	O
updated	O
.	O
</s>
<s>
This	O
idea	O
is	O
due	O
to	O
Strachey	O
,	O
but	O
constants	O
in	O
many	O
languages	O
such	O
as	O
Pascal	B-Application
are	O
manifest	O
constants	O
,	O
processed	O
at	O
compile	B-Language
time	O
and	O
not	O
implemented	O
as	O
protected	O
locations	O
.	O
</s>
<s>
S-algol	B-Language
is	O
an	O
expression-oriented	O
language	O
,	O
and	O
statements	O
are	O
expressions	O
of	O
type	O
void	O
.	O
</s>
<s>
There	O
are	O
several	O
conditional	B-Language
constructs	I-Language
.	O
</s>
<s>
The	O
two-alternative	O
version	O
of	O
the	O
conditional	B-Language
is	O
if	O
<condition> then <clause> else <clause>	O
,	O
where	O
the	O
clauses	O
can	O
be	O
statements	O
or	O
expressions	O
.	O
</s>
<s>
The	O
one-armed	O
conditional	B-Language
if	O
<condition> do <statement>	O
has	O
type	O
void	O
.	O
</s>
<s>
Use	O
of	O
do	O
instead	O
of	O
else	O
in	O
the	O
conditional	B-Language
statement	O
avoids	O
the	O
dangling	O
else	O
syntactic	O
ambiguity	O
.	O
</s>
<s>
Matches	O
are	O
tested	O
in	O
order	O
,	O
so	O
this	O
resembles	O
the	O
guarded	B-Application
commands	I-Application
of	O
Edsger	O
Dijkstra	O
without	O
the	O
non-determinism	O
.	O
</s>
<s>
S-algol	B-Language
abstracts	O
expressions	O
as	O
functions	O
and	O
statements	O
(	O
void	O
expressions	O
)	O
as	O
procedures	O
.	O
</s>
<s>
Modules	B-Architecture
would	O
provide	O
the	O
abstraction	B-Application
of	O
declarations	O
,	O
but	O
S-algol	B-Language
does	O
not	O
include	O
modules	B-Architecture
because	O
of	O
the	O
difficulties	O
they	O
pose	O
with	O
block-structured	O
scope	O
.	O
</s>
<s>
Tennent	O
used	O
the	O
term	O
sequel	O
for	O
the	O
abstraction	B-Application
over	O
sequencers	O
,	O
these	O
would	O
be	O
generalizations	O
of	O
goto	B-Application
and	O
break	O
.	O
</s>
<s>
The	O
best	O
known	O
abstraction	B-Application
in	O
this	O
category	O
is	O
call-with-current-continuation	O
,	O
but	O
it	O
would	O
not	O
be	O
well	O
understood	O
until	O
some	O
years	O
later	O
.	O
</s>
<s>
S-algol	B-Language
does	O
not	O
include	O
goto	B-Application
or	O
break	O
,	O
and	O
does	O
not	O
include	O
abstraction	B-Application
over	O
sequencers	O
.	O
</s>
<s>
Every	O
data	O
object	O
in	O
S-algol	B-Language
must	O
be	O
given	O
a	O
value	O
when	O
it	O
is	O
declared	O
.	O
</s>
<s>
In	O
fact	O
call	O
by	O
value	O
is	O
the	O
only	O
parameter	O
passing	O
method	O
in	O
S-algol	B-Language
.	O
</s>
<s>
Reference	O
and	O
result	O
parameters	O
are	O
rejected	O
,	O
which	O
is	O
consistent	O
with	O
the	O
S-algol	B-Language
ban	O
on	O
passing	O
l-values	O
.	O
</s>
<s>
Any	O
procedure	O
passed	O
as	O
a	O
parameter	O
has	O
its	O
full	O
type	O
specified	O
(	O
in	O
contrast	O
to	O
Pascal	B-Application
)	O
and	O
the	O
same	O
is	O
true	O
for	O
a	O
structure	O
class	O
.	O
</s>
<s>
S-algol	B-Language
provides	O
the	O
file	O
data	O
type	O
for	O
I/O	B-Architecture
streams	I-Architecture
,	O
and	O
several	O
variations	O
of	O
read	O
and	O
write	O
are	O
defined	O
to	O
operate	O
on	O
the	O
basic	O
types	O
.	O
</s>
<s>
ALGOL	B-Language
languages	I-Language
have	O
been	O
criticized	O
as	O
being	O
verbose	O
.	O
</s>
<s>
S-algol	B-Language
attempts	O
to	O
improve	O
this	O
by	O
providing	O
less	O
restrictive	O
syntax	O
.	O
</s>
<s>
Although	O
it	O
would	O
be	O
possible	O
to	O
infer	O
procedure	O
parameter	O
and	O
return	O
types	O
by	O
examining	O
where	O
the	O
procedure	O
is	O
called	O
,	O
S-algol	B-Language
does	O
require	O
parameter	O
and	O
return	O
types	O
to	O
be	O
specified	O
.	O
</s>
<s>
Most	O
ALGOLs	B-Language
require	O
that	O
all	O
declarations	O
come	O
before	O
the	O
statements	O
in	O
a	O
block	O
.	O
</s>
<s>
In	O
S-algol	B-Language
,	O
declarations	O
may	O
be	O
mixed	O
with	O
statements	O
because	O
everything	O
must	O
be	O
declared	O
before	O
it	O
is	O
used	O
and	O
there	O
is	O
no	O
goto	B-Application
that	O
would	O
permit	O
jumping	O
past	O
a	O
declaration	O
.	O
</s>
