<s>
TScript	B-Application
is	O
an	O
object-oriented	B-Language
embeddable	O
scripting	B-Language
language	I-Language
for	O
C++	B-Language
that	O
supports	O
hierarchical	O
transient	O
typed	O
variables	O
(	O
TVariable	O
)	O
.	O
</s>
<s>
Its	O
main	O
design	O
criterion	O
is	O
to	O
create	O
a	O
scripting	B-Language
language	I-Language
that	O
can	O
interface	O
with	O
C++	B-Language
,	O
transforming	O
data	O
and	O
returning	O
the	O
result	O
.	O
</s>
<s>
This	O
enables	O
C++	B-Language
applications	O
to	O
change	O
their	O
functionality	O
after	O
installation	O
.	O
</s>
<s>
TScript	B-Application
example	O
.	O
</s>
<s>
TVariable	O
are	O
hierarchical	O
in	O
nature	O
and	O
are	O
very	O
similar	O
to	O
XML	B-Protocol
,	O
JavaScript	B-Language
and	O
PHP	B-Application
variables	I-Application
.	O
</s>
<s>
Class	O
in	O
TScript	B-Application
are	O
similar	O
to	O
array	O
in	O
how	O
TVariable	O
handle	O
them	O
,	O
but	O
use	O
strings	O
as	O
array	O
scriptures	O
.	O
</s>
<s>
In	O
the	O
native	O
C++	B-Language
code	I-Language
,	O
structured	O
TVariable	O
elements	O
are	O
accessible	O
in	O
C++	B-Language
by	O
-	O
or	O
by	O
either	O
or	O
in	O
native	O
code	O
.	O
</s>
<s>
Supporting	O
hierarchical	O
variables	O
,	O
TScript	B-Application
is	O
able	O
to	O
store	O
both	O
primitive	O
and	O
complex	O
variables	O
within	O
the	O
same	O
variable	O
structure	O
.	O
</s>
<s>
TScript	B-Application
implements	O
concepts	O
of	O
inheritance	O
and	O
code	O
encapsulation	O
through	O
defined	O
variables	O
.	O
</s>
<s>
Another	O
striking	O
feature	O
of	O
TScript	B-Application
is	O
the	O
function	O
declarations	O
,	O
which	O
use	O
output	O
parameters	O
rather	O
than	O
return	B-Language
values	I-Language
,	O
and	O
provide	O
syntactic	O
support	O
for	O
these	O
.	O
</s>
<s>
In	O
TScript	B-Application
this	O
pattern	O
has	O
been	O
changed	O
to	O
the	O
form	O
:	O
</s>
<s>
This	O
change	O
has	O
done	O
two	O
things	O
,	O
first	O
it	O
allows	O
multiple	O
output	O
variables	O
and	O
secondly	O
it	O
changed	O
the	O
return	B-Language
statement	I-Language
to	O
an	O
error	B-General_Concept
handling	I-General_Concept
function	O
.	O
</s>
<s>
This	O
removes	O
some	O
of	O
the	O
need	O
for	O
using	O
reference	O
pointers	O
to	O
return	O
multiple	O
variables	O
that	O
is	O
common	O
in	O
C/C	O
++	O
,	O
and	O
the	O
use	O
of	O
references	O
in	O
most	O
other	O
scripting	B-Language
languages	I-Language
is	O
actually	O
prevented	O
,	O
forcing	O
the	O
use	O
of	O
a	O
structure	O
or	O
array	O
to	O
return	O
multiple	O
values	O
.	O
</s>
<s>
The	O
second	O
noticeable	O
thing	O
about	O
the	O
calling	O
conventions	O
is	O
that	O
now	O
all	O
functions	O
have	O
an	O
integrated	O
error	B-General_Concept
handling	I-General_Concept
purpose	O
similar	O
to	O
and	O
of	O
C++	B-Language
and	O
Java	O
.	O
</s>
<s>
In	O
TScript	B-Application
since	O
all	O
functions	O
return	O
an	O
error	O
,	O
the	O
return	B-Language
statement	I-Language
operates	O
similar	O
to	O
the	O
throw	O
statement	O
.	O
</s>
<s>
For	O
convenience	O
TScript	B-Application
offers	O
a	O
shorthand	O
function	O
calling	O
in	O
the	O
situation	O
where	O
there	O
is	O
only	O
one	O
returned	O
variable	O
.	O
</s>
<s>
Error	B-General_Concept
handling	I-General_Concept
in	O
many	O
other	O
languages	O
is	O
done	O
through	O
the	O
use	O
of	O
exceptions	B-General_Concept
.	O
</s>
<s>
TScript	B-Application
uses	O
a	O
similar	O
process	O
of	O
error	B-General_Concept
handling	I-General_Concept
,	O
although	O
slightly	O
different	O
.	O
</s>
<s>
TScript	B-Application
has	O
a	O
global	O
error	O
variable	O
similar	O
to	O
the	O
traditional	O
errno	B-Error_Name
in	O
C	O
,	O
although	O
the	O
error	O
variable	O
in	O
TScript	B-Application
is	O
capable	O
to	O
holding	O
both	O
an	O
error	O
code	O
and	O
a	O
detailed	O
error	O
message	O
.	O
</s>
<s>
TScript	B-Application
uses	O
the	O
notation	O
that	O
allows	O
calling	O
code	O
to	O
filter	O
the	O
error	O
,	O
potentially	O
recovering	O
from	O
the	O
error	O
and	O
returning	O
to	O
normal	O
operation	O
,	O
or	O
returning	O
the	O
error	O
to	O
its	O
own	O
calling	O
function	O
.	O
</s>
<s>
C++	B-Language
supports	O
function	B-Language
overloading	I-Language
,	O
which	O
enables	O
functions	O
to	O
have	O
the	O
same	O
name	O
while	O
being	O
differentiated	O
by	O
their	O
input	O
parameters	O
.	O
</s>
<s>
This	O
causes	O
TScript	B-Application
an	O
issue	O
while	O
supporting	O
loose	O
type	O
variables	O
,	O
as	O
there	O
is	O
no	O
way	O
to	O
tell	O
what	O
the	O
type	O
of	O
a	O
variable	O
is	O
until	O
the	O
software	O
is	O
being	O
executed	O
.	O
</s>
<s>
To	O
counter	O
this	O
problem	O
,	O
TScript	B-Application
has	O
been	O
written	O
with	O
run-time	O
linking	O
.	O
</s>
<s>
First	O
it	O
means	O
that	O
there	O
is	O
no	O
need	O
to	O
declare	O
functions	O
before	O
they	O
are	O
used	O
,	O
for	O
example	O
in	O
C++	B-Language
two	O
functions	O
may	O
call	O
one	O
another	O
,	O
like	O
and	O
.	O
</s>
<s>
TScript	B-Application
's	O
run-time	O
linking	O
means	O
the	O
functions	O
can	O
be	O
declared	O
in	O
any	O
order	O
without	O
the	O
need	O
to	O
prototype	O
.	O
</s>
<s>
This	O
enables	O
TScript	B-Application
programs	O
to	O
write	O
themselves	O
.	O
</s>
<s>
For	O
example	O
,	O
when	O
using	O
the	O
SOAP	B-Application
interface	O
,	O
the	O
remote	O
WSDL	O
will	O
be	O
encoded	O
into	O
the	O
script	O
library	O
,	O
allowing	O
the	O
functions	O
within	O
to	O
be	O
called	O
as	O
if	O
they	O
were	O
coded	O
at	O
design	O
time	O
.	O
</s>
<s>
TScript	B-Application
is	O
among	O
a	O
small	O
group	O
is	O
scripting	B-Language
languages	I-Language
that	O
provide	O
the	O
functionality	O
to	O
dynamically	O
load	O
and	O
link	O
to	O
existing	O
shared	O
libraries	O
.	O
</s>
<s>
Java	O
through	O
its	O
JNI	B-Language
and	O
VB6	B-Language
are	O
two	O
other	O
scripting	B-Language
languages	I-Language
that	O
enable	O
code	O
to	O
be	O
written	O
that	O
would	O
load	O
a	O
third	O
party	O
library	O
and	O
execute	O
through	O
its	O
native	O
interface	O
.	O
</s>
<s>
This	O
gives	O
TScript	B-Application
the	O
ability	O
to	O
use	O
a	O
wealth	O
of	O
pre-existing	O
functionality	O
and	O
code	O
written	O
in	O
different	O
languages	O
and	O
this	O
can	O
be	O
done	O
without	O
any	O
need	O
to	O
change	O
the	O
shared	O
library	O
's	O
interface	O
or	O
to	O
be	O
compiled	O
with	O
the	O
source	O
code	O
.	O
</s>
<s>
TScript	B-Application
uses	O
the	O
standard	O
C++	B-Language
class	O
encapsulation	O
to	O
allocate	O
and	O
de-allocate	O
memory	O
resources	O
.	O
</s>
<s>
This	O
means	O
that	O
all	O
allocated	O
memory	O
is	O
released	O
when	O
the	O
variable	O
containing	O
it	O
is	O
destroyed	O
and	O
operated	O
differently	O
from	O
the	O
Garbage	O
Collection	O
model	O
of	O
Java	O
or	O
the	O
reference	O
counting	O
model	O
of	O
.NET	B-Application
languages	O
.	O
</s>
<s>
Operation	O
system	O
resources	O
such	O
as	O
files	O
,	O
sockets	O
and	O
encryption	O
keys	O
are	O
managed	O
via	O
a	O
reference	O
counting	O
mechanism	O
similar	O
to	O
.NET	B-Application
,	O
so	O
they	O
will	O
be	O
released	O
as	O
soon	O
as	O
there	O
are	O
no	O
variables	O
containing	O
their	O
values	O
.	O
</s>
<s>
This	O
security	O
architecture	O
is	O
designed	O
to	O
allow	O
the	O
running	O
of	O
scripts	O
in	O
a	O
similar	O
way	O
to	O
JavaScript	B-Language
while	O
enabling	O
the	O
usefulness	O
of	O
more	O
powerful	O
scripting	B-Language
languages	I-Language
like	O
PERL	B-Language
.	O
</s>
