<s>
NewtonScript	B-Device
is	O
a	O
prototype-based	B-Application
programming	I-Application
language	I-Application
created	O
to	O
write	O
programs	O
for	O
the	O
Newton	B-Device
platform	O
.	O
</s>
<s>
It	O
is	O
heavily	O
influenced	O
by	O
the	O
Self	B-Operating_System
programming	I-Operating_System
language	I-Operating_System
,	O
but	O
modified	O
to	O
be	O
more	O
suited	O
to	O
needs	O
of	O
mobile	O
and	O
embedded	B-Architecture
devices	I-Architecture
.	O
</s>
<s>
On	O
August	O
3	O
,	O
1993	O
,	O
Apple	O
unveiled	O
the	O
Apple	B-Device
Newton	I-Device
MessagePad	I-Device
.	O
</s>
<s>
The	O
device	O
had	O
640	O
KB	O
RAM	B-Architecture
,	O
4	O
MB	O
ROM	B-Device
,	O
and	O
an	O
20MHz	O
ARM	B-Architecture
610	O
microprocessor	O
.	O
</s>
<s>
The	O
main	O
intention	O
behind	O
Newton	B-Device
project	O
,	O
was	O
to	O
develop	O
a	O
device	O
capable	O
of	O
replacing	O
a	O
computer	O
while	O
being	O
portable	O
.	O
</s>
<s>
The	O
developers	O
looked	O
at	O
the	O
C++	B-Language
programming	I-Language
language	I-Language
but	O
realized	O
that	O
it	O
lacked	O
flexibility	O
.	O
</s>
<s>
They	O
started	O
focusing	O
on	O
prototype	B-Application
based	I-Application
languages	I-Application
and	O
were	O
impressed	O
with	O
Smalltalk	B-Application
and	O
Self	B-Operating_System
.	O
</s>
<s>
Concurrently	O
Apple	O
was	O
developing	O
another	O
dynamic	B-Language
programming	I-Language
language	I-Language
called	O
Dylan	B-Language
,	O
which	O
was	O
a	O
strong	O
candidate	O
for	O
the	O
Newton	B-Device
platform	O
.	O
</s>
<s>
However	O
,	O
both	O
Self	B-Operating_System
and	O
Dylan	B-Language
were	O
dropped	O
out	O
of	O
consideration	O
,	O
as	O
they	O
were	O
both	O
in	O
nascent	O
stage	O
for	O
proper	O
integration	O
.	O
</s>
<s>
Instead	O
,	O
a	O
team	O
headed	O
by	O
Walter	O
R	O
.	O
Smith	O
developed	O
a	O
new	O
language	O
called	O
NewtonScript	B-Device
.	O
</s>
<s>
It	O
was	O
influenced	O
by	O
dynamic	B-Language
language	I-Language
like	O
Smalltalk	B-Application
and	O
prototype	B-Application
model	O
based	O
like	O
Self	B-Operating_System
.	O
</s>
<s>
Although	O
NewtonScript	B-Device
was	O
heavily	O
influenced	O
by	O
Self	B-Operating_System
,	O
there	O
were	O
some	O
differences	O
in	O
both	O
the	O
languages	O
.	O
</s>
<s>
Differences	O
arose	O
due	O
to	O
three	O
perceived	O
problems	O
with	O
Self	B-Operating_System
.	O
</s>
<s>
One	O
is	O
that	O
the	O
typical	O
Self	B-Operating_System
snapshot	O
requires	O
32MB	O
of	O
RAM	B-Architecture
to	O
run	O
in	O
,	O
whereas	O
the	O
Newton	B-Device
platform	O
was	O
designed	O
to	O
use	O
only	O
128KB	O
for	O
the	O
operating	O
system	O
.	O
</s>
<s>
Finally	O
,	O
the	O
inheritance	O
system	O
in	O
the	O
normal	O
Self	B-Operating_System
engine	O
had	O
a	O
single	O
parent	O
object	O
,	O
whereas	O
GUIs	B-Application
typically	O
have	O
two	O
—	O
one	O
for	O
the	O
objects	O
and	O
another	O
for	O
the	O
GUI	B-Application
layout	O
that	O
is	O
typically	O
handled	O
via	O
the	O
addition	O
of	O
a	O
slot	O
in	O
some	O
sort	O
of	O
GUI-hierarchy	O
object	O
(	O
like	O
View	B-Architecture
)	O
.	O
</s>
<s>
The	O
syntax	O
was	O
also	O
modified	O
to	O
allow	O
a	O
more	O
text-based	O
programming	O
style	O
,	O
as	O
opposed	O
to	O
Self	B-Operating_System
's	O
widespread	O
use	O
of	O
a	O
GUI	B-Application
environment	O
for	O
programming	O
.	O
</s>
<s>
This	O
allowed	O
Newton	B-Device
programs	O
to	O
be	O
developed	O
on	O
a	O
computer	O
running	O
the	O
Toolkit	O
,	O
where	O
the	O
programs	O
would	O
be	O
compiled	O
and	O
then	O
downloaded	O
to	O
a	O
Newton	B-Device
device	O
for	O
running	O
.	O
</s>
<s>
One	O
of	O
the	O
advantages	O
of	O
NewtonScript	B-Device
's	O
prototype	B-Application
based	I-Application
inheritance	O
was	O
reduced	O
memory	O
usage	O
,	O
a	O
key	O
consideration	O
in	O
the	O
128KB	O
Newton	B-Device
.	O
</s>
<s>
The	O
prototype	B-Application
of	O
a	O
GUI	B-Application
object	O
could	O
actually	O
be	O
stored	O
in	O
ROM	B-Device
,	O
so	O
there	O
was	O
no	O
need	O
to	O
copy	O
default	O
data	O
or	O
functions	O
into	O
working	O
memory	O
.	O
</s>
<s>
Unlike	O
class-based	O
languages	O
,	O
where	O
creation	O
of	O
an	O
object	O
involves	O
memory	O
being	O
allocated	O
to	O
all	O
of	O
its	O
attributes	O
,	O
NewtonScripts	B-Device
 '	O
use	O
of	O
prototype	B-Application
inheritance	O
allowed	O
it	O
to	O
allocated	O
memory	O
to	O
few	O
fields	O
like	O
_proto	O
and	O
_parent	O
instead	O
of	O
creating	O
whole	O
new	O
object	O
.	O
</s>
<s>
Here	O
,	O
_proto	O
and	O
_parent	O
signifies	O
whether	O
the	O
object	O
is	O
using	O
prototype	B-Application
or	O
parent	O
inheritance	O
.	O
</s>
<s>
If	O
the	O
button	O
uses	O
the	O
default	O
font	O
,	O
accessing	O
its	O
font	O
"	O
slot	O
"	O
(	O
i.e.	O
,	O
property	O
or	O
member	O
variable	O
)	O
will	O
return	O
a	O
value	O
that	O
is	O
actually	O
stored	O
in	O
ROM	B-Device
;	O
the	O
button	O
instance	O
in	O
RAM	B-Architecture
does	O
not	O
have	O
a	O
value	O
in	O
its	O
own	O
font	O
slot	O
,	O
so	O
the	O
prototype	B-Application
inheritance	O
chain	O
is	O
followed	O
until	O
a	O
value	O
is	O
found	O
.	O
</s>
<s>
If	O
the	O
developer	O
then	O
changes	O
the	O
button	O
's	O
font	O
,	O
setting	O
its	O
font	O
slot	O
to	O
a	O
new	O
value	O
will	O
override	O
the	O
prototype	B-Application
;	O
this	O
override	O
value	O
is	O
stored	O
in	O
RAM	B-Architecture
.	O
</s>
<s>
NewtonScript	B-Device
's	O
"	O
differential	B-Application
inheritance	I-Application
"	O
therefore	O
made	O
efficient	O
use	O
of	O
the	O
Newton	B-Device
's	O
expensive	O
flash	B-Device
RAM	I-Device
by	O
storing	O
the	O
bulk	O
of	O
the	O
default	O
data	O
and	O
code	O
in	O
the	O
PDA	O
's	O
cheaper	O
and	O
much	O
larger	O
ROM	B-Device
.	O
</s>
<s>
Views	O
:	O
They	O
are	O
objects	O
created	O
by	O
Newton	B-Device
View	B-Architecture
System	O
,	O
which	O
are	O
created	O
on	O
run-time	B-Library
to	O
render	O
views	O
.	O
</s>
<s>
Protos	O
:	O
They	O
can	O
be	O
blueprint	O
for	O
a	O
template	O
or	O
a	O
view	B-Architecture
,	O
and	O
are	O
elements	O
of	O
NewtonScript	B-Device
code	O
libraries	O
.	O
</s>
<s>
It	O
is	O
worthwhile	O
to	O
note	O
that	O
all	O
objects	O
in	O
NewtonScript	B-Device
are	O
frames	O
.	O
</s>
<s>
Frame	O
Heap	O
:	O
RAM	B-Architecture
allocated	O
dynamically	O
by	O
NewtonScript	B-Device
.	O
</s>
<s>
Base	O
View	B-Architecture
:	O
It	O
is	O
the	O
main	O
view	B-Architecture
of	O
application	O
,	O
consisting	O
of	O
all	O
the	O
variables	O
and	O
methods	B-Language
used	O
in	O
the	O
application	O
.	O
</s>
<s>
NewtonScript	B-Device
is	O
a	O
dynamic	O
prototype	B-Application
based	I-Application
programming	I-Application
language	O
,	O
which	O
uses	O
differential	B-Application
inheritance	I-Application
.	O
</s>
<s>
at	O
run	B-Library
time	I-Library
,	O
giving	O
great	O
flexibility	O
for	O
developers	O
.	O
</s>
<s>
The	O
RAM	B-Architecture
is	O
used	O
only	O
for	O
storing	O
attributes	O
whose	O
values	O
change	O
during	O
runtime	B-Library
.	O
</s>
<s>
Writing	O
interfaces	O
for	O
GUI	B-Application
applications	O
can	O
be	O
implemented	O
effectively	O
using	O
the	O
prototype	B-Application
model	O
,	O
since	O
we	O
can	O
directly	O
write	O
an	O
object	O
for	O
a	O
GUI	B-Application
control	O
rather	O
than	O
creating	O
a	O
class	O
and	O
instantiating	O
it	O
.	O
</s>
<s>
Garbage	B-General_Concept
collection	I-General_Concept
is	O
carried	O
automatically	O
by	O
the	O
system	O
.	O
</s>
<s>
Garbage	B-General_Concept
collection	I-General_Concept
also	O
helped	O
in	O
mitigating	O
problem	O
of	O
dangling	B-Error_Name
pointers	I-Error_Name
where	O
a	O
pointer	O
erroneously	O
points	O
to	O
a	O
memory	O
location	O
that	O
was	O
deallocated	O
.	O
</s>
<s>
Since	O
NewtonScript	B-Device
code	O
was	O
written	O
on	O
one	O
platform	O
and	O
run	O
on	O
another	O
,	O
it	O
was	O
practically	O
impossible	O
to	O
debug	O
.	O
</s>
<s>
Better	O
debugging	O
code	O
in	O
the	O
Newton	B-Device
engine	O
would	O
have	O
helped	O
offset	O
this	O
problem	O
to	O
some	O
degree	O
,	O
but	O
the	O
limited	O
memory	O
made	O
this	O
difficult	O
.	O
</s>
<s>
Another	O
disadvantage	O
is	O
that	O
,	O
dynamic	O
variable	O
reduces	O
the	O
speed	O
of	O
operation	O
since	O
simple	O
pointer	O
dereference	O
cannot	O
be	O
used	O
as	O
in	O
statically	O
typed	O
like	O
C++	B-Language
and	O
Java	O
.	O
</s>
<s>
With	O
the	O
cancellation	O
of	O
the	O
Newton	B-Device
project	O
by	O
Apple	O
in	O
1998	O
,	O
all	O
further	O
mainstream	O
developments	O
on	O
NewtonScript	B-Device
were	O
stopped	O
.	O
</s>
<s>
However	O
,	O
the	O
features	O
used	O
in	O
NewtonScript	B-Device
would	O
continue	O
to	O
inspire	O
other	O
programming	O
models	O
and	O
languages	O
.	O
</s>
<s>
The	O
prototype-based	B-Application
object	O
model	O
of	O
Self	B-Operating_System
and	O
NewtonScript	B-Device
was	O
used	O
in	O
JavaScript	B-Language
,	O
the	O
most	O
popular	O
and	O
visible	O
language	O
to	O
use	O
the	O
concept	O
so	O
far	O
.	O
</s>
<s>
NewtonScript	B-Device
is	O
also	O
one	O
of	O
the	O
conceptual	O
ancestors	O
(	O
together	O
with	O
Smalltalk	B-Application
,	O
Self	B-Operating_System
,	O
Act1	O
,	O
Lisp	B-Language
and	O
Lua	B-Language
)	O
of	O
a	O
general-purpose	O
programming	O
language	O
called	O
Io	B-Application
which	O
implements	O
the	O
same	O
differential	B-Application
inheritance	I-Application
model	O
,	O
which	O
was	O
used	O
in	O
NewtonScript	B-Device
to	O
conserve	O
memory	O
.	O
</s>
