<s>
Dynamic	B-Application
compilation	I-Application
is	O
a	O
process	O
used	O
by	O
some	O
programming	O
language	O
implementations	O
to	O
gain	O
performance	O
during	O
program	O
execution	O
.	O
</s>
<s>
Although	O
the	O
technique	O
originated	O
in	O
Smalltalk	B-Application
,	O
the	O
best-known	O
language	O
that	O
uses	O
this	O
technique	O
is	O
Java	B-Language
.	O
</s>
<s>
Since	O
the	O
machine	B-Language
code	I-Language
emitted	O
by	O
a	O
dynamic	B-Application
compiler	I-Application
is	O
constructed	O
and	O
optimized	O
at	O
program	O
runtime	B-Library
,	O
the	O
use	O
of	O
dynamic	B-Application
compilation	I-Application
enables	O
optimizations	O
for	O
efficiency	O
not	O
available	O
to	O
statically-compiled	O
programs	O
(	O
i.e.	O
</s>
<s>
those	O
compiled	B-Language
by	O
a	O
so-called	O
"	O
batch	O
compiler	B-Language
"	O
,	O
as	O
written	O
below	O
)	O
except	O
through	O
code	O
duplication	O
or	O
metaprogramming	B-Application
.	O
</s>
<s>
Runtime	B-Device
environments	I-Device
using	O
dynamic	B-Application
compilation	I-Application
typically	O
have	O
programs	O
run	O
slowly	O
for	O
the	O
first	O
few	O
minutes	O
,	O
and	O
then	O
after	O
that	O
,	O
most	O
of	O
the	O
compilation	B-Language
and	O
recompilation	O
is	O
done	O
and	O
it	O
runs	O
quickly	O
.	O
</s>
<s>
Due	O
to	O
this	O
initial	O
performance	O
lag	O
,	O
dynamic	B-Application
compilation	I-Application
is	O
undesirable	O
in	O
certain	O
cases	O
.	O
</s>
<s>
In	O
most	O
implementations	O
of	O
dynamic	B-Application
compilation	I-Application
,	O
some	O
optimizations	O
that	O
could	O
be	O
done	O
at	O
the	O
initial	O
compile	B-Application
time	I-Application
are	O
delayed	O
until	O
further	O
compilation	B-Language
at	O
run-time	B-Library
,	O
causing	O
further	O
unnecessary	O
slowdowns	O
.	O
</s>
<s>
Just-in-time	O
compilation	B-Language
is	O
a	O
form	O
of	O
dynamic	B-Application
compilation	I-Application
.	O
</s>
<s>
A	O
closely	O
related	O
technique	O
is	O
incremental	B-Application
compilation	I-Application
.	O
</s>
<s>
An	O
incremental	B-Application
compiler	I-Application
is	O
used	O
in	O
POP-2	B-Language
,	O
POP-11	B-Language
,	O
Forth	B-Application
,	O
some	O
versions	O
of	O
Lisp	B-Language
,	O
e.g.	O
</s>
<s>
Maclisp	B-Language
and	O
at	O
least	O
one	O
version	O
of	O
ML	B-Language
(	O
Poplog	B-Language
ML	B-Language
)	O
.	O
</s>
<s>
This	O
requires	O
the	O
compiler	B-Language
for	O
the	O
programming	O
language	O
to	O
be	O
part	O
of	O
the	O
runtime	B-Device
system	I-Device
.	O
</s>
<s>
In	O
consequence	O
,	O
source	O
code	O
can	O
be	O
read	O
in	O
at	O
any	O
time	O
,	O
from	O
the	O
terminal	O
,	O
from	O
a	O
file	O
,	O
or	O
possibly	O
from	O
a	O
data-structure	O
constructed	O
by	O
the	O
running	O
program	O
,	O
and	O
translated	O
into	O
a	O
machine	B-Language
code	I-Language
block	O
or	O
function	O
(	O
which	O
may	O
replace	O
a	O
previous	O
function	O
of	O
the	O
same	O
name	O
)	O
,	O
which	O
is	O
then	O
immediately	O
available	O
for	O
use	O
by	O
the	O
program	O
.	O
</s>
<s>
Because	O
of	O
the	O
need	O
for	O
speed	O
of	O
compilation	B-Language
during	O
interactive	O
development	O
and	O
testing	O
,	O
the	O
compiled	B-Language
code	O
is	O
likely	O
not	O
to	O
be	O
as	O
heavily	O
optimised	O
as	O
code	O
produced	O
by	O
a	O
standard	O
'	O
batch	O
compiler	B-Language
 '	O
,	O
which	O
reads	O
in	O
source	O
code	O
and	O
produces	O
object	O
files	O
that	O
can	O
subsequently	O
be	O
linked	O
and	O
run	O
.	O
</s>
<s>
However	O
an	O
incrementally	O
compiled	B-Language
program	O
will	O
typically	O
run	O
much	O
faster	O
than	O
an	O
interpreted	B-Application
version	O
of	O
the	O
same	O
program	O
.	O
</s>
<s>
Incremental	B-Application
compilation	I-Application
thus	O
provides	O
a	O
mixture	O
of	O
the	O
benefits	O
of	O
interpreted	B-Application
and	O
compiled	B-Language
languages	O
.	O
</s>
<s>
To	O
aid	O
portability	O
it	O
is	O
generally	O
desirable	O
for	O
the	O
incremental	B-Application
compiler	I-Application
to	O
operate	O
in	O
two	O
stages	O
,	O
namely	O
first	O
compiling	B-Language
to	O
some	O
intermediate	O
platform-independent	O
language	O
,	O
and	O
then	O
compiling	B-Language
from	O
that	O
to	O
machine	B-Language
code	I-Language
for	O
the	O
host	O
machine	O
.	O
</s>
<s>
In	O
this	O
case	O
porting	O
requires	O
only	O
changing	O
the	O
'	O
back	O
end	O
 '	O
compiler	B-Language
.	O
</s>
<s>
Unlike	O
dynamic	B-Application
compilation	I-Application
,	O
as	O
defined	O
above	O
,	O
incremental	B-Application
compilation	I-Application
does	O
not	O
involve	O
further	O
optimisations	O
after	O
the	O
program	O
is	O
first	O
run	O
.	O
</s>
