<s>
Mercury	B-Operating_System
is	O
a	O
functional	B-Application
logic	I-Application
programming	I-Application
language	O
made	O
for	O
real-world	O
uses	O
.	O
</s>
<s>
The	O
first	O
version	O
was	O
developed	O
at	O
the	O
University	O
of	O
Melbourne	O
,	O
Computer	O
Science	O
department	O
,	O
by	O
Fergus	O
Henderson	O
,	O
Thomas	O
Conway	O
,	O
and	O
Zoltan	B-Operating_System
Somogyi	I-Operating_System
,	O
under	O
Somogyi	O
's	O
supervision	O
,	O
and	O
released	O
on	O
April	O
8	O
,	O
1995	O
.	O
</s>
<s>
Mercury	B-Operating_System
is	O
a	O
purely	O
declarative	B-Language
logic	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
It	O
is	O
related	O
to	O
both	O
Prolog	B-Language
and	O
Haskell	B-Language
.	O
</s>
<s>
It	O
features	O
a	O
strong	O
,	O
static	O
,	O
polymorphic	B-Application
type	O
system	O
,	O
and	O
a	O
strong	O
mode	O
and	O
determinism	O
system	O
.	O
</s>
<s>
The	O
official	O
implementation	O
,	O
the	O
Melbourne	O
Mercury	B-Operating_System
Compiler	B-Language
,	O
is	O
available	O
for	O
most	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
platforms	O
,	O
including	O
Linux	B-Application
,	O
macOS	B-Application
,	O
and	O
for	O
Windows	B-Application
.	O
</s>
<s>
Mercury	B-Operating_System
is	O
based	O
on	O
the	O
logic	B-Language
programming	I-Language
language	I-Language
Prolog	B-Language
.	O
</s>
<s>
It	O
has	O
the	O
same	O
syntax	O
and	O
the	O
same	O
basic	O
concepts	O
such	O
as	O
the	O
selective	B-Application
linear	I-Application
definite	I-Application
clause	I-Application
resolution	I-Application
(	O
SLD	O
)	O
algorithm	O
.	O
</s>
<s>
It	O
can	O
be	O
viewed	O
as	O
a	O
pure	O
subset	O
of	O
Prolog	B-Language
with	O
strong	O
types	O
and	O
modes	O
.	O
</s>
<s>
The	O
language	O
is	O
designed	O
using	O
software	B-General_Concept
engineering	I-General_Concept
principles	O
.	O
</s>
<s>
Unlike	O
the	O
original	O
implementations	O
of	O
Prolog	B-Language
,	O
it	O
has	O
a	O
separate	O
compilation	B-Language
phase	O
,	O
rather	O
than	O
being	O
directly	O
interpreted	O
.	O
</s>
<s>
By	O
using	O
information	O
obtained	O
at	O
compile	B-Language
time	O
(	O
such	O
as	O
type	O
and	O
mode	O
)	O
,	O
programs	O
written	O
in	O
Mercury	B-Operating_System
typically	O
perform	O
significantly	O
faster	O
than	O
equivalent	O
programs	O
written	O
in	O
Prolog	B-Language
.	O
</s>
<s>
Its	O
authors	O
claim	O
that	O
Mercury	B-Operating_System
is	O
the	O
fastest	O
logic	B-Language
language	I-Language
in	O
the	O
world	O
,	O
by	O
a	O
wide	O
margin	O
.	O
</s>
<s>
Mercury	B-Operating_System
is	O
a	O
purely	O
declarative	B-Language
language	I-Language
,	O
unlike	O
Prolog	B-Language
,	O
since	O
it	O
lacks	O
extra-logical	O
Prolog	B-Language
statements	O
such	O
as	O
!	O
</s>
<s>
(	O
cut	O
)	O
and	O
imperative	B-Application
input/output	B-General_Concept
(	O
I/O	B-General_Concept
)	O
.	O
</s>
<s>
This	O
enables	O
advanced	O
static	O
program	O
analysis	O
and	O
program	O
optimization	O
,	O
including	O
compile-time	O
garbage	B-General_Concept
collection	I-General_Concept
,	O
but	O
it	O
can	O
make	O
certain	O
programming	O
constructs	O
(	O
such	O
as	O
a	O
switch	O
over	O
a	O
number	O
of	O
options	O
,	O
with	O
a	O
default	O
)	O
harder	O
to	O
express	O
.	O
</s>
<s>
While	O
Mercury	B-Operating_System
does	O
allow	O
impure	O
functionality	O
,	O
it	O
serves	O
mainly	O
as	O
a	O
way	O
to	O
call	O
foreign	O
language	O
code	O
.	O
</s>
<s>
Operations	O
which	O
would	O
typically	O
be	O
impure	O
(	O
such	O
as	O
input/output	B-General_Concept
)	O
are	O
expressed	O
using	O
pure	O
constructs	O
in	O
Mercury	B-Operating_System
using	O
linear	O
types	O
,	O
by	O
threading	O
a	O
dummy	O
world	O
value	O
through	O
all	O
relevant	O
code	O
.	O
</s>
<s>
Notable	O
programs	O
written	O
in	O
Mercury	B-Operating_System
include	O
the	O
Mercury	B-Operating_System
compiler	B-Language
and	O
the	O
Prince	B-Application
XML	I-Application
formatter	O
.	O
</s>
<s>
The	O
Software	O
company	O
ODASE	O
has	O
also	O
been	O
using	O
Mercury	B-Operating_System
to	O
develop	O
its	O
Ontology-Centric	O
software	O
development	O
platform	O
,	O
ODASE	O
.	O
</s>
<s>
Mercury	B-Operating_System
has	O
several	O
back-ends	O
,	O
which	O
enable	O
compiling	B-Language
Mercury	B-Operating_System
code	O
into	O
several	O
languages	O
,	O
including	O
:	O
</s>
<s>
Mercury-0.12.2	O
is	O
the	O
last	O
version	O
to	O
support	O
Aditi	O
.	O
</s>
<s>
Mercury	B-Operating_System
also	O
features	O
a	O
foreign	O
language	O
interface	O
,	O
allowing	O
code	O
in	O
other	O
languages	O
(	O
depending	O
on	O
the	O
chosen	O
back-end	O
)	O
to	O
be	O
linked	O
with	O
Mercury	B-Operating_System
code	O
.	O
</s>
<s>
The	O
most	O
commonly	O
used	O
back-end	O
is	O
the	O
original	O
low-level	O
C	B-Language
back-end	O
.	O
</s>
<s>
Calculating	O
the	O
10th	O
Fibonacci	B-Algorithm
number	I-Algorithm
(	O
in	O
the	O
most	O
obvious	O
way	O
)	O
:	O
</s>
<s>
!	O
IO	O
is	O
a	O
"	O
state	O
variable	O
"	O
,	O
which	O
is	O
syntactic	O
sugar	O
for	O
a	O
pair	O
of	O
variables	O
which	O
are	O
assigned	O
concrete	O
names	O
at	O
compilation	B-Language
;	O
for	O
example	O
,	O
the	O
above	O
is	O
desugared	O
to	O
something	O
like	O
:	O
</s>
<s>
In	O
February	O
2010	O
the	O
Mercury	B-Operating_System
project	O
decided	O
to	O
name	O
each	O
stable	O
release	O
by	O
using	O
the	O
year	O
and	O
month	O
of	O
the	O
release	O
.	O
</s>
