<s>
SuperPascal	B-Language
is	O
an	O
imperative	B-Application
,	O
concurrent	B-Architecture
computing	I-Architecture
programming	O
language	O
developed	O
by	O
Per	O
Brinch	O
Hansen	O
.	O
</s>
<s>
It	O
was	O
designed	O
as	O
a	O
publication	O
language	O
:	O
a	O
thinking	O
tool	O
to	O
enable	O
the	O
clear	O
and	O
concise	O
expression	O
of	O
concepts	O
in	O
parallel	B-Operating_System
programming	I-Operating_System
.	O
</s>
<s>
SuperPascal	B-Language
is	O
based	O
on	O
Niklaus	O
Wirth	O
's	O
sequential	B-Algorithm
language	O
Pascal	B-Application
,	O
extending	O
it	O
with	O
features	O
for	O
safe	O
and	O
efficient	O
concurrency	B-Architecture
.	O
</s>
<s>
Pascal	B-Application
itself	O
was	O
used	O
heavily	O
as	O
a	O
publication	O
language	O
in	O
the	O
1970s	O
.	O
</s>
<s>
It	O
was	O
used	O
to	O
teach	O
structured	B-Language
programming	I-Language
practices	O
and	O
featured	O
in	O
text	O
books	O
,	O
for	O
example	O
,	O
on	O
compilers	B-Language
and	O
programming	O
languages	O
.	O
</s>
<s>
Hansen	O
had	O
earlier	O
developed	O
the	O
language	O
Concurrent	B-Language
Pascal	I-Language
,	O
one	O
of	O
the	O
earliest	O
concurrent	B-Operating_System
languages	I-Operating_System
for	O
the	O
design	O
of	O
operating	B-General_Concept
systems	I-General_Concept
and	O
real-time	B-General_Concept
control	I-General_Concept
systems	O
.	O
</s>
<s>
The	O
requirements	O
of	O
SuperPascal	B-Language
were	O
based	O
on	O
the	O
experience	O
gained	O
by	O
Hansen	O
over	O
three	O
years	O
in	O
developing	O
a	O
set	O
of	O
model	O
parallel	B-Operating_System
programs	I-Operating_System
,	O
which	O
implemented	O
methods	O
for	O
common	O
problems	O
in	O
computer	B-General_Concept
science	I-General_Concept
.	O
</s>
<s>
This	O
experimentation	O
allowed	O
him	O
to	O
make	O
the	O
following	O
conclusions	O
about	O
the	O
future	O
of	O
scientific	O
parallel	B-Operating_System
computing	I-Operating_System
:	O
</s>
<s>
Future	O
parallel	B-Operating_System
computers	I-Operating_System
will	O
be	O
general-purpose	O
,	O
allowing	O
programmers	O
to	O
think	O
in	O
terms	O
of	O
problem-oriented	O
process	O
configurations	O
.	O
</s>
<s>
This	O
was	O
based	O
on	O
his	O
experience	O
programming	O
networks	O
of	O
transputers	B-General_Concept
,	O
which	O
were	O
general-purpose	O
processors	O
able	O
to	O
be	O
connected	O
in	O
arrays	B-Data_Structure
,	O
trees	B-Application
or	O
hypercubes	B-Operating_System
.	O
</s>
<s>
Regular	O
problems	O
in	O
computational	O
science	O
require	O
only	O
deterministic	O
parallelism	B-Operating_System
,	O
that	O
is	O
,	O
expecting	O
communication	O
from	O
a	O
particular	O
channel	B-Operating_System
,	O
rather	O
than	O
from	O
several	O
.	O
</s>
<s>
Parallel	O
scientific	O
algorithms	O
can	O
be	O
developed	O
in	O
an	O
elegant	O
publication	O
language	O
and	O
tested	O
on	O
a	O
sequential	B-Algorithm
computer	O
.	O
</s>
<s>
The	O
language	O
should	O
extend	O
a	O
widely	O
used	O
standard	O
language	O
with	O
deterministic	O
parallelism	B-Operating_System
and	O
message	O
communication	O
.	O
</s>
<s>
The	O
language	O
should	O
enable	O
a	O
single-pass	B-Language
compiler	I-Language
to	O
check	O
that	O
parallel	O
processes	O
do	O
not	O
interfere	O
in	O
a	O
time-dependent	O
manner	O
.	O
</s>
<s>
The	O
key	O
ideas	O
in	O
the	O
design	O
of	O
SuperPascal	B-Language
was	O
to	O
provide	O
a	O
secure	O
programming	O
,	O
with	O
abstract	O
concepts	O
for	O
parallelism	B-Operating_System
.	O
</s>
<s>
SuperPascal	B-Language
is	O
secure	O
in	O
that	O
it	O
should	O
enable	O
its	O
compiler	B-Language
and	O
runtime	B-Device
system	I-Device
to	O
detect	O
as	O
many	O
cases	O
as	O
possible	O
in	O
which	O
the	O
language	O
concepts	O
break	O
down	O
and	O
produce	O
meaningless	O
results	O
.	O
</s>
<s>
SuperPascal	B-Language
imposes	O
restrictions	O
on	O
the	O
use	O
of	O
variables	O
that	O
enable	O
a	O
single-pass	B-Language
compiler	I-Language
to	O
check	O
that	O
parallel	O
processes	O
are	O
disjoint	O
,	O
even	O
if	O
the	O
processes	O
use	O
procedures	O
with	O
global	O
variables	O
,	O
eliminating	O
time-dependent	O
errors	O
.	O
</s>
<s>
Several	O
features	O
in	O
Pascal	B-Application
were	O
ambiguous	O
or	O
insecure	O
and	O
were	O
omitted	O
from	O
SuperPascal	B-Language
,	O
such	O
as	O
labels	O
and	O
goto	O
statements	O
,	O
pointers	O
and	O
forward	O
declarations	O
.	O
</s>
<s>
The	O
parallel	O
features	O
of	O
SuperPascal	B-Language
are	O
a	O
subset	O
of	O
occam	B-Language
2	I-Language
,	O
with	O
the	O
added	O
generality	O
of	O
dynamic	O
process	O
arrays	B-Data_Structure
and	O
recursive	O
parallel	O
processes	O
.	O
</s>
<s>
Channels	O
are	O
not	O
variables	O
in	O
themselves	O
,	O
but	O
are	O
identified	O
by	O
a	O
unique	O
value	O
known	O
as	O
the	O
channel	B-Operating_System
reference	O
,	O
which	O
are	O
held	O
by	O
channel	B-Operating_System
variables	O
.	O
</s>
<s>
which	O
defines	O
a	O
new	O
(	O
mixed	O
)	O
type	O
named	O
channel	B-Operating_System
and	O
a	O
variable	O
of	O
this	O
type	O
named	O
c	B-Language
.	O
A	O
mixed	O
type	O
channel	B-Operating_System
is	O
restricted	O
to	O
transmitting	O
only	O
the	O
specified	O
types	O
,	O
in	O
this	O
case	O
boolean	O
and	O
integer	O
values	O
.	O
</s>
<s>
The	O
channel	B-Operating_System
c	B-Language
is	O
initialised	O
by	O
the	O
open	O
statement	O
:	O
</s>
<s>
Message	O
communication	O
is	O
then	O
achieved	O
with	O
the	O
send(channel, value )	O
and	O
receive(channel, variable )	O
statements	O
.	O
</s>
<s>
The	O
expression	O
or	O
variable	O
providing	O
the	O
value	O
for	O
send	O
,	O
and	O
the	O
variable	O
in	O
receive	O
,	O
must	O
both	O
be	O
of	O
the	O
same	O
type	O
as	O
the	O
first	O
channel	B-Operating_System
argument	O
.	O
</s>
<s>
The	O
following	O
example	O
shows	O
the	O
use	O
of	O
these	O
functions	O
in	O
a	O
process	O
that	O
receives	O
a	O
value	O
from	O
the	O
left	O
channel	B-Operating_System
and	O
outputs	O
it	O
on	O
the	O
right	O
one	O
.	O
</s>
<s>
The	O
following	O
runtime	B-Library
communication	O
errors	O
can	O
occur	O
:	O
</s>
<s>
Channel	B-Operating_System
contention	O
occurs	O
when	O
two	O
parallel	O
processes	O
both	O
attempt	O
to	O
send	O
or	O
receive	O
on	O
the	O
same	O
channel	B-Operating_System
simultaneously	O
.	O
</s>
<s>
A	O
message	O
type	O
error	O
occurs	O
when	O
two	O
parallel	O
processes	O
attempt	O
to	O
communicate	O
through	O
the	O
same	O
channel	B-Operating_System
and	O
the	O
output	O
expression	O
and	O
input	O
variable	O
are	O
of	O
different	O
types	O
.	O
</s>
<s>
The	O
most	O
difficult	O
aspect	O
of	O
concurrent	B-Architecture
programming	I-Architecture
is	O
unpredictable	O
or	O
non-reproducible	O
behaviour	O
caused	O
by	O
time-dependent	O
errors	O
.	O
</s>
<s>
Time-dependent	O
errors	O
are	O
caused	O
by	O
interference	O
between	O
parallel	O
processes	O
,	O
due	O
to	O
variable	O
updates	O
or	O
channel	B-Operating_System
conflicts	O
.	O
</s>
<s>
Similarly	O
,	O
if	O
two	O
processes	O
simultaneously	O
try	O
to	O
send	O
or	O
receive	O
on	O
a	O
shared	O
channel	B-Operating_System
,	O
the	O
resulting	O
effect	O
is	O
time-dependent	O
.	O
</s>
<s>
SuperPascal	B-Language
enforces	O
certain	O
restrictions	O
on	O
the	O
use	O
of	O
variables	O
and	O
communication	O
to	O
minimise	O
or	O
eliminate	O
time-dependent	O
errors	O
.	O
</s>
<s>
SuperPascal	B-Language
is	O
a	O
block	O
structured	B-Language
language	O
,	O
with	O
the	O
same	O
basic	O
syntax	O
as	O
Pascal	B-Application
.	O
</s>
<s>
Statements	O
are	O
separated	O
by	O
semicolons	O
,	O
as	O
opposed	O
to	O
languages	O
like	O
C	B-Language
or	O
Java	B-Language
,	O
where	O
they	O
are	O
terminated	O
by	O
semicolons	O
.	O
</s>
<s>
The	O
following	O
is	O
an	O
example	O
of	O
a	O
complete	O
SuperPascal	B-Language
program	O
,	O
which	O
constructs	O
a	O
pipeline	O
communication	O
structure	O
with	O
100	O
nodes	O
.	O
</s>
<s>
The	O
SuperPascal	B-Language
software	O
can	O
be	O
accessed	O
freely	O
from	O
the	O
Brinch	O
Hansen	O
Archive	O
.	O
</s>
<s>
It	O
consists	O
of	O
a	O
compiler	B-Language
and	O
interpreter	O
,	O
which	O
are	O
both	O
written	O
in	O
normal	O
,	O
sequential	B-Algorithm
Pascal	B-Application
(	O
ISO	O
Level	O
1	O
standard	O
Pascal	B-Application
)	O
.	O
</s>
<s>
This	O
is	O
supported	O
by	O
the	O
GNU	O
Pascal	B-Application
compiler	B-Language
and	O
newer	O
versions	O
of	O
the	O
Free	B-Operating_System
Pascal	I-Operating_System
compiler	I-Operating_System
(	O
2.7.1	O
+	O
)	O
with	O
the	O
-Miso	O
switch	O
,	O
with	O
the	O
following	O
respective	O
small	O
modifications	O
to	O
the	O
code	O
.	O
</s>
<s>
Instead	O
,	O
the	O
Extended	O
Pascal	B-Application
getTimeStamp	O
function	O
can	O
be	O
used	O
(	O
which	O
is	O
supported	O
by	O
the	O
GNU	O
Pascal	B-Application
compiler	B-Language
)	O
,	O
by	O
declaring	O
a	O
variable	O
of	O
type	O
TimeStamp	O
,	O
setting	O
that	O
with	O
the	O
current	O
time	O
using	O
getTimeStamp	O
and	O
assigning	O
the	O
Second	O
field	O
of	O
the	O
TimeStamp	O
to	O
the	O
variable	O
t	O
.	O
</s>
<s>
Regarding	O
GPC	O
on	O
64-bit	B-Device
operating	B-General_Concept
systems	I-General_Concept
;	O
the	O
GNU	O
Pascal	B-Application
compiler	B-Language
must	O
be	O
compiled	B-Language
and	O
installed	O
from	O
source	O
code	O
.	O
</s>
<s>
Free	B-Operating_System
Pascal	I-Operating_System
also	O
needs	O
a	O
solution	O
to	O
the	O
above	O
"	O
clock	O
"	O
problem	O
(	O
On	O
windows	O
,	O
just	O
declare	O
gettickcount	O
as	O
external	O
with	O
"	O
clock	O
"	O
as	O
name	O
)	O
.	O
</s>
<s>
(	O
GPC	O
probably	O
only	O
errors	O
on	O
this	O
if	O
you	O
enable	O
strict	O
flags	O
)	O
,	O
and	O
the	O
C	B-Language
preprocessor	O
commands	O
#include	O
'	O
xx	O
 '	O
must	O
be	O
changed	O
to	O
{$include	O
'	O
xx'}	O
.	O
</s>
