<s>
Telescript	B-Language
is	O
an	O
Agent-oriented	B-Language
programming	I-Language
language	O
written	O
by	O
General	O
Magic	O
as	O
part	O
of	O
the	O
overall	O
Magic	B-Application
Cap	I-Application
system	O
.	O
</s>
<s>
Telescript	B-Language
programs	O
used	O
a	O
modified	O
C-like	B-Language
syntax	I-Language
known	O
as	O
High	O
Telescript	B-Language
and	O
were	O
compiled	O
to	O
a	O
stack-based	O
language	O
called	O
Low	O
Telescript	B-Language
for	O
execution	O
.	O
</s>
<s>
Low	O
Telescript	B-Language
ran	O
within	O
virtual	B-Architecture
machine	I-Architecture
interpreters	O
,	O
or	O
"	O
Telescript	B-Language
engines	O
"	O
,	O
on	O
host	O
computers	O
.	O
</s>
<s>
The	O
basic	O
model	O
of	O
Telescript	B-Language
is	O
similar	O
to	O
Java	B-Language
,	O
and	O
differs	O
primarily	O
in	O
where	O
the	O
applications	O
would	O
run	O
.	O
</s>
<s>
Java	B-Language
was	O
modelled	O
to	O
make	O
it	O
possible	O
to	O
download	O
Java	B-Language
applications	O
onto	O
any	O
platform	O
and	O
run	O
them	O
locally	O
.	O
</s>
<s>
Telescript	B-Language
essentially	O
reversed	O
this	O
,	O
allowing	O
end-user	O
equipment	O
with	O
limited	O
capabilities	O
to	O
upload	O
Telescript	B-Language
programs	O
to	O
servers	O
to	O
allow	O
them	O
to	O
take	O
advantage	O
of	O
the	O
server	O
's	O
capabilities	O
.	O
</s>
<s>
Telescript	B-Language
could	O
even	O
migrate	O
a	O
running	O
program	O
;	O
the	O
language	O
included	O
features	O
to	O
marshal	B-Application
a	O
program	O
's	O
code	O
and	O
serialized	B-Application
state	O
,	O
transfer	O
it	O
to	O
another	O
Telescript	B-Language
engine	O
(	O
on	O
a	O
device	O
or	O
a	O
server	O
)	O
to	O
continue	O
execution	O
,	O
and	O
finally	O
return	O
to	O
the	O
originating	O
client	O
or	O
server	O
device	O
to	O
deliver	O
its	O
output	O
.	O
</s>
<s>
When	O
they	O
began	O
to	O
generate	O
some	O
press	O
buzz	O
in	O
1992	O
,	O
Apple	O
decided	O
to	O
enter	O
the	O
same	O
market	O
with	O
their	O
Newton	B-Device
tablet	B-Device
computer	I-Device
.	O
</s>
<s>
General	O
Magic	O
were	O
unable	O
to	O
find	O
a	O
niche	O
within	O
the	O
market	O
,	O
and	O
Telescript	B-Language
services	O
were	O
soon	O
deprecated	B-General_Concept
in	O
favor	O
of	O
new	O
products	O
unrelated	O
to	O
mobile	O
computing	O
.	O
</s>
<s>
In	O
1990	O
,	O
Marc	O
Porat	O
convinced	O
then-Apple-CEO	O
John	O
Sculley	O
that	O
the	O
future	O
of	O
computing	O
lay	O
not	O
in	O
desktop	O
personal	B-Device
computers	I-Device
,	O
but	O
much	O
smaller	O
portable	O
devices	O
combining	O
computing	O
power	O
,	O
communications	O
systems	O
,	O
and	O
data	O
located	O
on	O
network-accessible	O
servers	O
.	O
</s>
<s>
Key	O
members	O
of	O
the	O
early	O
team	O
were	O
Porat	O
,	O
and	O
famous	O
Macintosh	B-Device
developers	O
Bill	O
Atkinson	O
and	O
Andy	O
Hertzfeld	O
.	O
</s>
<s>
The	O
company	O
ranks	O
soon	O
filled	O
out	O
with	O
other	O
Macintosh	B-Device
alumni	O
,	O
including	O
Joanna	O
Hoffman	O
,	O
Susan	O
Kare	O
,	O
Dan	O
Winkler	O
,	O
Bruce	O
Leak	O
and	O
Phil	O
Goldman	O
.	O
</s>
<s>
By	O
1992	O
GM	O
had	O
signed	O
development	O
agreements	O
with	O
a	O
number	O
companies	O
to	O
work	O
with	O
the	O
Magic	B-Application
Cap	I-Application
environment	O
,	O
including	O
Sony	O
,	O
Motorola	O
,	O
Matsushita	O
,	O
Philips	O
,	O
British	O
Telecom	O
and	O
AT&T	O
Corporation	O
.	O
</s>
<s>
Apple	O
had	O
by	O
this	O
time	O
started	O
the	O
Newton	B-Device
project	I-Device
,	O
a	O
design	O
for	O
a	O
larger	O
hand-held	O
tablet-like	O
computer	O
more	O
similar	O
to	O
the	O
full-sized	O
iPad	B-Device
.	O
</s>
<s>
With	O
General	O
Magic	O
's	O
success	O
in	O
the	O
press	O
,	O
they	O
re-positioned	O
the	O
Newton	B-Device
squarely	O
in	O
the	O
same	O
market	O
and	O
rushed	O
it	O
to	O
release	O
in	O
1993	O
.	O
</s>
<s>
General	O
Magic	O
's	O
partners	O
did	O
not	O
release	O
hardware	O
until	O
1994	O
,	O
by	O
which	O
time	O
the	O
Newton	B-Device
had	O
essentially	O
defined	O
what	O
a	O
personal	B-Application
digital	I-Application
assistant	I-Application
(	O
PDA	B-Application
)	O
should	O
be	O
,	O
and	O
PDA	B-Application
systems	O
were	O
being	O
judged	O
on	O
their	O
handwriting	B-Application
recognition	I-Application
capabilities	O
.	O
</s>
<s>
Magic	B-Application
Cap	I-Application
was	O
a	O
point	O
and	O
click	O
interface	O
(	O
similar	O
to	O
HyperCard	B-Application
or	O
the	O
modern	O
iOS	B-Application
)	O
.	O
</s>
<s>
Telescript	B-Language
was	O
modelled	O
on	O
the	O
concept	O
of	O
small	O
programs	O
known	O
as	O
agents	B-Operating_System
that	O
would	O
interact	O
with	O
computing	O
services	O
known	O
as	O
places	O
all	O
of	O
which	O
would	O
run	O
on	O
a	O
cluster	O
of	O
one	O
or	O
more	O
servers	O
that	O
hosted	O
what	O
was	O
called	O
a	O
Telescript	B-Language
cloud	O
.	O
</s>
<s>
Even	O
early	O
documents	O
refer	O
to	O
this	O
as	O
running	B-Architecture
in	I-Architecture
the	I-Architecture
cloud	I-Architecture
.	O
</s>
<s>
User-facing	O
programs	O
would	O
consist	O
of	O
a	O
number	O
of	O
such	O
agents	B-Operating_System
,	O
which	O
might	O
run	O
locally	O
,	O
on	O
the	O
provider	O
's	O
hosts	O
,	O
or	O
even	O
be	O
forwarded	O
to	O
3rd	O
party	O
servers	O
.	O
</s>
<s>
To	O
coordinate	O
communications	O
,	O
Telescript	B-Language
also	O
included	O
the	O
concepts	O
of	O
a	O
telename	O
that	O
uniquely	O
identified	O
users	O
,	O
and	O
teleaddresses	O
which	O
identified	O
the	O
device	O
even	O
as	O
it	O
moved	O
between	O
networks	O
.	O
</s>
<s>
In	O
a	O
traditional	O
client	B-Operating_System
–	I-Operating_System
server	I-Operating_System
model	I-Operating_System
,	O
the	O
application	O
would	O
form	O
a	O
number	O
of	O
queries	O
,	O
send	O
them	O
to	O
a	O
number	O
of	O
services	O
,	O
and	O
then	O
collect	O
the	O
results	O
and	O
display	O
them	O
.	O
</s>
<s>
In	O
the	O
Telescript	B-Language
model	O
,	O
the	O
application	O
would	O
instead	O
build	O
a	O
new	O
agent	O
populated	O
with	O
the	O
data	O
from	O
the	O
request	O
,	O
stamp	O
it	O
with	O
their	O
name	O
and	O
address	O
,	O
and	O
then	O
send	O
that	O
to	O
a	O
store	O
place	O
on	O
a	O
server	O
for	O
processing	O
.	O
</s>
<s>
In	O
the	O
Telescript	B-Language
model	O
,	O
a	O
new	O
agent	O
with	O
the	O
information	O
needed	O
to	O
complete	O
the	O
purchase	O
is	O
sent	O
to	O
that	O
vendor	O
's	O
store	O
place	O
,	O
interacts	O
with	O
the	O
store	O
place	O
or	O
agents	B-Operating_System
from	O
the	O
vendor	O
,	O
and	O
then	O
returns	O
with	O
the	O
success	O
or	O
failure	O
.	O
</s>
<s>
The	O
main	O
communications	O
takes	O
place	O
between	O
the	O
agents	B-Operating_System
and	O
places	O
on	O
the	O
remote	O
server	O
,	O
so	O
communications	O
over	O
the	O
network	O
is	O
required	O
only	O
at	O
the	O
start	O
and	O
end	O
of	O
the	O
process	O
.	O
</s>
<s>
Telescript	B-Language
was	O
object-oriented	O
(	O
OO	O
)	O
and	O
used	O
a	O
number	O
of	O
uncommon	O
terms	O
to	O
describe	O
object	O
state	O
and	O
communications	O
.	O
</s>
<s>
Attributes	O
correspond	O
to	O
what	O
other	O
languages	O
refer	O
to	O
as	O
instance	B-Application
variables	I-Application
or	O
fields	O
.	O
</s>
<s>
Method	B-Language
calls	I-Language
were	O
known	O
as	O
requests	O
,	O
and	O
the	O
act	O
of	O
running	O
a	O
method	B-Language
's	O
implementation	O
was	O
known	O
as	O
performing	O
it	O
.	O
</s>
<s>
Hints	O
on	O
how	O
to	O
pass	O
the	O
data	O
into	O
and	O
out	O
of	O
method	B-Language
calls	I-Language
were	O
known	O
as	O
constraints	O
,	O
and	O
covered	O
the	O
common	O
"	O
by	O
ref	O
"	O
and	O
"	O
by	O
value	O
"	O
,	O
among	O
others	O
.	O
</s>
<s>
Telescript	B-Language
was	O
generally	O
stateless	B-Application
in	O
terms	O
of	O
data	O
lifetime	O
.	O
</s>
<s>
All	O
data	O
within	O
the	O
program	O
,	O
both	O
instance	O
and	O
local	O
variables	O
,	O
were	O
always	O
serialized	B-Application
.	O
</s>
<s>
Agents	B-Operating_System
could	O
be	O
invoked	O
or	O
suspended	O
at	O
any	O
instant	O
,	O
and	O
would	O
not	O
lose	O
their	O
state	O
.	O
</s>
<s>
This	O
same	O
mechanism	O
also	O
allowed	O
agents	B-Operating_System
to	O
be	O
easily	O
communicated	O
between	O
hosts	O
.	O
</s>
<s>
Although	O
Telescript	B-Language
's	O
control	O
and	O
layout	O
was	O
inspired	O
by	O
C	B-Language
,	O
its	O
precise	O
syntax	O
was	O
considerably	O
different	O
.	O
</s>
<s>
One	O
obvious	O
difference	O
was	O
the	O
replacement	O
of	O
C-style	O
curly	O
braces	O
with	O
parentheses	O
at	O
the	O
definition	O
level	O
,	O
retaining	O
curly	O
braces	O
for	O
grouping	O
statements	O
within	O
logic	O
and	O
flow	O
control	O
statements	O
,	O
and	O
the	O
use	O
of	O
the	O
colon	O
to	O
separate	O
a	O
name	O
from	O
its	O
definition	O
.	O
</s>
<s>
The	O
implementation	O
of	O
the	O
Pie	O
could	O
be	O
used	O
in	O
one	O
or	O
more	O
class	O
objects	O
,	O
which	O
can	O
be	O
organized	O
into	O
moduless	O
in	O
a	O
fashion	O
similar	O
to	O
Visual	B-Language
Basic	I-Language
.NET	I-Language
'	O
s	O
namespace	O
construct	O
.	O
</s>
<s>
Telescript	B-Language
's	O
agent	O
and	O
places	O
concepts	O
were	O
invoked	O
simply	O
by	O
sub-classing	O
those	O
two	O
classes	O
,	O
Agent	O
and	O
Place	O
,	O
both	O
of	O
which	O
were	O
subclasses	O
of	O
Process	O
.	O
</s>
<s>
The	O
following	O
code	O
defines	O
the	O
agents	B-Operating_System
needed	O
to	O
implement	O
a	O
store	O
that	O
sells	O
Pies	O
:	O
</s>
<s>
The	O
PieBuyer	O
object	O
,	O
an	O
Agent	O
,	O
contains	O
a	O
single	O
method	B-Language
,	O
live	O
,	O
the	O
standard	O
startup	O
method	B-Language
used	O
by	O
all	O
Agents	B-Operating_System
.	O
</s>
<s>
Simply	O
creating	O
a	O
PieBuyer	O
and	O
invoking	O
it	O
will	O
cause	O
the	O
live	O
method	B-Language
to	O
be	O
called	O
,	O
in	O
a	O
fashion	O
similar	O
to	O
the	O
new	O
operation	O
found	O
in	O
most	O
OO	O
languages	O
,	O
although	O
this	O
method	B-Language
is	O
called	O
after	O
setup	O
.	O
</s>
<s>
The	O
PieSeller	O
object	O
,	O
a	O
Place	O
,	O
also	O
contains	O
a	O
single	O
method	B-Language
,	O
sellPie	O
.	O
</s>
<s>
It	O
then	O
attempts	O
to	O
set	O
aPie	O
to	O
a	O
value	O
by	O
calling	O
its	O
own	O
getPieFromStock	O
method	B-Language
(	O
not	O
shown	O
here	O
)	O
and	O
then	O
checks	O
if	O
that	O
returned	O
a	O
value	O
.	O
</s>
<s>
Telescript	B-Language
includes	O
several	O
built-in	O
collection	O
types	O
,	O
Set	O
,	O
List	O
,	O
Dictionary	O
,	O
and	O
Collection	O
,	O
the	O
last	O
of	O
which	O
is	O
essentially	O
a	O
List	O
with	O
text	O
indexes	O
(	O
one	O
half	O
of	O
a	O
Dictionary	O
)	O
.	O
</s>
<s>
One	O
common	O
source	O
of	O
errors	O
in	O
Telescript	B-Language
was	O
that	O
while	O
a	O
collection	O
as	O
a	O
whole	O
could	O
be	O
passed	O
back	O
in	O
an	O
agent	O
,	O
individual	O
items	O
within	O
it	O
were	O
owned	O
by	O
the	O
place	O
.	O
</s>
<s>
The	O
solution	O
was	O
additional	O
syntax	O
,	O
the	O
DictOwned	O
and	O
ColOwned	O
hints	O
,	O
which	O
caused	O
the	O
ownership	O
of	O
returned	O
values	O
to	O
be	O
changed	O
on	O
return	O
,	O
and	O
thus	O
be	O
serialized	B-Application
into	O
the	O
results	O
when	O
returning	O
to	O
the	O
original	O
place	O
.	O
</s>
<s>
Telescript	B-Language
also	O
included	O
the	O
concept	O
of	O
mix-in	O
classes	O
,	O
which	O
offered	O
features	O
similar	O
to	O
multiple	B-Application
inheritance	I-Application
by	O
allowing	O
the	O
creation	O
of	O
classes	O
containing	O
only	O
code	O
that	O
could	O
then	O
be	O
included	O
in	O
other	O
classes	O
.	O
</s>
<s>
Like	O
many	O
modern	O
OO	O
languages	O
,	O
Telescript	B-Language
separated	O
interface	O
and	O
implementation	O
,	O
placing	O
these	O
in	O
.i	O
files	O
for	O
the	O
interface	O
,	O
and	O
.t	O
files	O
for	O
the	O
implementation	O
(	O
t	O
as	O
in	O
"	O
t	O
"	O
elescript	O
)	O
.	O
</s>
<s>
Compiled	O
code	O
was	O
placed	O
in	O
a	O
.s	O
file	O
,	O
which	O
was	O
guided	O
by	O
linker	B-Application
instructions	O
in	O
a	O
.l	O
file	O
.	O
</s>
<s>
The	O
External	O
Application	O
Framework	O
allowed	O
C++	B-Language
code	I-Language
to	O
be	O
called	O
by	O
Telescript	B-Language
.	O
</s>
