►
Description
Rust recently got an official support for asm.js and WebAssembly targets.
While many have already played with it, tried to build simple hello-worlds and check the browser/Node.js console for result, there is still no well-established solution for Rust to interact with DOM API, JavaScript libraries or Node.js built-ins.
During the talk we will get a glimpse on how this can be done on the low-level, how to wrap common browser APIs into a nice Rust interface and how to interact with JavaScript objects without having a native GC support in Rust (yet).
Ingvar Stepanyan
https://rreverser.com/
https://twitter.com/RReverser
https://github.com/RReverser
A
Hello,
so
yeah
I'll
be
talking
today
about
like
Ross
and
JavaScript
Interop
and
like.
Why
would
you
do
it?
How
would
you
do
that,
and
so
on?
So
I
wouldn't
be
talking
like
about
why
we
would
choose
for
us
because,
like
obviously
you
came
and
if
you
came
to
the
conference
that
you
Algie
like
crashing,
it
was
old
many
times
before.
So
why
JavaScript?
Why
would
you
ever
choose
it
like
as
a
target
if
you
have,
as
it
can
actually
compiled
to
native
and
non-native
and
so
on?
A
Well,
you
like
you
to
note,
but
like
Joe
Gipp
nowadays
is
like
the
real
cross-platform
target,
like
you.
Have
it
in
desktop
like
whether
it's
math
class
Linux
Windows,
whatever
you
have
you
most
likely,
have
a
browser
that
can
just
run
JavaScript,
no
matter
which
platform
you
are
and
this
pretty
cool
and
like
also
you
have
a
lot
of
other
devices
like
it's
normal
to
run
it
on
tablets.
Just
the
same
JavaScript
will
just
run
out
of
the
box
to
across
button.
A
Like
no
surprise,
if
it's
on
like
available
and
phones
like
everything,
basically
has
browser
now,
like
even
TVs
Oh
like
eBook
readers,
you
might
want
to
just
redo
some
pages
and
run
JavaScript
isn't
go.
We
don't
know
yet
I,
don't
know
like
Nintendo.
Why
don't
you
see
you
easy?
Try
the
book
entry,
something
on
your
Nintendo
write,
all
like!
Probably
the
best
idea
ever
like.
While
you
drive
just
visit
some
website
in
your
car
and
respond
to
comments
and
try
to
reload
pages
what
could
go
wrong?
A
Like
like,
it's
really
available
on
all
sorts
of
devices
nowadays,
like
you,
can
even
watch
your
website
on
your
watch.
Not
it
is
extremely
convenient
but
like
well,
it's
wrong.
Alright,
so
you
just
run
one
code
right,
one
code
and
run
it
literally
everywhere
else.
You
can
just
do
what
everyone
ok.
So
how
do
we
do
that?
Mike
Ross
is
quite
low-level
target
and
it
must
have
compiled
to
native
code.
How
do
we
even
get
to
the
stage
where
it
generates
JavaScript
that
can
run
across
all
these
platforms
like
without
significant
changes
right?
A
So
the
answer
is
encrypted.
So
encryption
is
projects
that
allows
you
to
load
basically
to
compile
native
C
C++
code
to
JavaScript
or
nowadays
also
webassembly
target.
So
the
way
it
does
it
like
basically
takes
input.
C
C++
converts
to
control
flow
graph
with
pretty
low-level
operations
and
sends
that
to
LLVM.
Allow
them
generate
a
low-level
bit
code
that
is
still
platform
independent
and
then
it
generates
like
native
objects
and
native
executable.
A
So
what
results
like
just
like
C
language,
just
instead
of
C
C++
it
takes
rust,
generates
CFG
SSI
using
LLVM
api's
generates
it
code
native
object,
not
executables,
it
can
run
and
so
on.
So
when
we
put
them
together
like
we
can
see
that
this
LLVM
or
block
is
shared
and
what
rust
can
do,
instead
of
like
trying
to
teach
and
scripting
or
understand
rust
itself,
it
can
just
literally
inject
and
keep
all
these
pages
that
encrypt
and
does
and
plus
the
generated
LLVM
bit
code.
A
Let's
write
like
simple
hello
world,
just
a
warning
like
there
will
be
lots
of
unsafe
stuff,
but
initially,
let's,
let's
try
with
some
sensible
nowadays,
it's
quite
easy,
because
I'm
scripting,
like
a
sanjaya,
is
negative
target
in
rossi
cells
in
Roscoe.
So
you
can
just
write
like
literally
event,
man
through
the
length
hello
world
and
you
compile
it
using
rust,
see,
there's
s
target
as
an
GS
and
our
names
Krypton
or
if
you
want
to
generate
webassembly,
just
132
announced
Cretan,
humor
rust
and
you
can
just
run
like
note
hello.
A
A
Sorry,
so
this
is
nice
and
cool
like.
But
what?
If
we
want
to
export
something
like
build,
a
library
that
actually
like
that
exports,
some
rust
functions
to
JavaScript
so
that
you
could
use
them
instead
of
just
running
the
entire
application
on
interrupt
and
have
access
to
entire
dome
to
networking,
API
and
everything
else,
it
is
exposed
on
the
on
JavaScript
side
but
at
the
same
time,
use
rot
for
anything.
That
is
fast.
A
So
as
a
simple
example,
we
can
just
like
nowadays
use
a
same
syntax
as
we
is
like
4x14
defunct,
which
functions
to
csfi.
So
we
just
do
pub
x
turn
on
our
function
and
add
no
mangle
and
rust
will
automatically
export
this
function
to
an
script
and
tell
it
that
it
needs
to
be
exposed
to
JavaScript
as
well,
not
only
like
on
sea
level.
A
The
only
problem
with
this
is
it
doesn't
work
like
small
one
because
static
libraries,
as
I
said
like
in
AB
script,
and
they
have
same
meaning
as
everywhere
else,
except
is
that,
if
native
objects,
you
are
having
LLVM
bit
code,
so
you
can't
really
build
a
static
library
that
is
also
JavaScript
at
the
same
time.
Instead,
if
you
want
to
build
a
JavaScript
library,
you
need
to
build
an
execute
table,
so
you
just
eat,
add
empty
main
and
you
compile
it
as
like
exactly
table,
but
it
will
be
a
library,
as
I
said
unsafe.
A
The
only
problem
is
this
small
one
that
it
doesn't
work
so
when
you
just
generate
like
target
a
suggests,
a
noun
in
scripting
and
try
to
require
this
module,
you
can
see
that
like
no
just
immediately
crashes
or
turns
out
it's
not,
it
doesn't
really
crash
the
foam.
Is
it
like?
As
I
said,
you
generated,
execute
table
and
M
script
and
really
think
it
should
just
execute
main
and,
like
one
main
exits?
Well,
they
did.
A
A
To
do
this,
we
need
to
use
a
anjali
feature
flag,
so
we
add
a
feature
link
arcs,
and
then
we
can
pass
some
linked
in
arguments
directly
to
Emscripten
and
we
just
add,
like
MKX
turn,
because
that's
the
only
way
to
pass
any
link
hogs
and
we
say
like
no
exits-
runtime
equals
1.
Then
Emscripten
just
generates
main,
which,
when
finishes
doesn't
exit
your
know,
chess
program,
hogs
and
double,
but
there
is
like
slightly
simpler
worries.
It
is
also
available
in
stable
so
that
you
don't
need
to
undo.
A
You
then
say
feature
here
encrypt
and
provide
the
special
function
like
an
script
and
exit
with
live
around
time
that
you
can
use.
Instead,
it
will
have
pretty
much
the
same
epic.
Just
in
the
end
of
your
mind,
you
say
like
encryption
tags
that
we
deliver
in
time
and
it
will
preserve
memory,
preserve
all
the
functions
but
like
it
won't
try
to.
A
Actually
aggregate
no
J's
and
then
when
we
try
to
run
like
with
debug
one
is,
it
will
say,
like
exit
implicitly
called
by
end
of
main,
but
no
exit
through
time
so
not
exiting,
and
now
you
can
actually
use
functions
by
using
the
C
mangled
name.
We
just
had
underscore
in
front
of
it
nice.
We
can
add
the
integers
in
the
rest
and
get
them
back
what
it
does
internally.
A
In
fact,
like
la
you
had
to
do
it
by
hand,
but
now
rust
adds
a
special
expertise,
functions,
property
that
it
sends
to
inscription
linker
that
basically
all
the
functions
that
should
be
expected
to
JavaScript
side.
So
by
default,
it's
the
thrust.
F
personality
as
like
it's
for
under
windy,
the
stack
mind
should
be
always
exposed
because
inscription
needs
to
find
the
entry
point
that
it
should
execute
and
like
any
functions
that
you
marked
with
barbed,
extend
no
mangle.
So
in
this
case
just
at
the
integers
right
now.
This
is
all
done
like
automatically.
A
So
what
exactly
do
narrate
on
the
other
side?
So,
first
of
all
it
generates
like
wrappers.
It
actually
checks
that
you're
on
time
wasn't
exited.
That
memory
is
still
available
that
you
can
do
anything
useful
and
then
comes
the
actual,
add
integers.
How
much
do
you
coded?
Do
you
need
to
add
two
integers
right?
A
So
if
you
try
to
recompile
with
this
mode,
the
code
becomes
slightly
simpler,
so
it
still
doesn't
look
very
straightforward.
The
reason
for
that
that
is
that
often
GS
is
not
exactly
a
normal
JavaScript
like
you
can
just
write
like
root
and
X
plus
y
here
so
as
Magette
is
in
fact
special
syntax
for
very
low
level
operations
that
is
backward
compatible
with
JavaScript,
but
it
compiles
like
to
native
code
immediately
ahead
of
time
like
without
any
cheat.
A
So
in
this
case,
these
annotations
are
like
normal
JavaScript
operations
that
also
that
Excel
ahead
of
time,
compiler,
which
types
do
you
have
on
each
variable,
return
value
and
so
on.
So,
in
particular,
like
the
first
argument
or
like
binary
or
v-0,
it
automatically
converts
number
just
to
set
it
a
bit
integer
so
ahead
of
time.
Compiler
can
no
type
of
this
parameter
afterwards,
some
it
does
for
the
second
one.
So
this
looks
extremely
hockey,
but
basically
what
it
does.
A
A
Another
flavor
of
these
it
became
more
less
stable.
Recently,
it
still
doesn't
work.
You
know,
just
to
be
honest.
Sec
fault
is
the
button
Lee
so
where
button
Lee
is
also
standardization
of
the
same
format,
but
instead
of
using
javascript
hogs,
it
just
compiled
everything
to
actual
binary
white
code
so
that
you
can
debug
s
like
in
this
way,
because
everyone,
likes
least.
A
But
here
like
it
allows
you
to
have
at
least
nice
names
for
every
operation
that
happens
and
to
see
like
how
exactly
they
have
asked
around.
So
in
this
case,
like
you,
have
this
get
local
to
just
get
local
variables.
I
set
it
to
add,
is
just
instructions
righty
to
integers
and
so
on.
So
in
general,
awesome
jettison
button
we
go
to
through
the
same
compilation
pipelines.
A
The
only
difference
is
that
the
second
one
is
byte
code,
so
it's
much
smaller,
much
faster
to
travel,
with
a
network,
much
faster
to
bars
and
so
on,
but
generally
the
result
is
the
same
native
code.
So
how
exactly
do
the
relays
like
hacen
GS,
has
like,
for
example,
export
when
I
do
X,
plus
y
or
or
zero?
This
is
the
same
as
in
Wasson,
you
say
ICT
to
just
add
like
and
sound
like
when
you
do
F,
X
or
0,
it's
just
normal
call
in
where
possibly
so,
sometimes
reversibly
out
with
slightly
movable.
A
Sometimes
it's
the
opposite.
So
the
last
one
is
interesting.
The
way
of
just
accesses
memory
is
by
having
one
single
memory
blob
that
is
given
to
it.
In
the
beginning
and
the
same
in
divide
assembly-
and
it
can
only
use
only
user
memory
from
the
same
typed
array
so
in
the
very
beginning,
inscription
generates
just
one
buffer
allocation
and
then
creates
tons
of
use
of
different
types
over
the
same
buffer.
A
This
way,
when
you
try
to
dereference
any
pointer,
it
actually
tries
to
access
one
of
these
arrays
and
as
long
as
you
don't
violate
pointer
addressing
you
can
actually,
for
example,
pootie
you
ate
at
some
point
ends
and
like
Creek,
you
set
it
to
altitude
and
sound
like
so.
The
idea
is
basically
is
just
like
a
buffer
vu
buffer.
A
A
But
how
do
we
do
anything
useful
for
us?
How
do
we
actually
call
out
to
staff
that
is
expose
only
to
JavaScript
for
the
in
C
C++
side
in
script?
Has
this
M
awesome
macro
where
you
can
just
put
any
JavaScript
code
inside
of
it,
and
it
will
actually
call
this
on
JavaScript
side
and
get
the
result
back
and
cast
it
to
needed
type.
So,
in
order
to
have
the
same
in
the
raft,
we
would
have
to
look
how
exactly
it's
implemented
in
a
Krypton
self.
A
So
when
we
try
to
go
to
the
inscription
include
like
the
default
headers,
you
can
see
the
deed
serves
also
onto
a
function,
call
where
we
just
pass
a
string,
divided
version
of
this
javascript.
Okay,
let's
find
the
function
when
we
find
this
function
like
the
definition
is
not
extremely
helpful
because,
like
it
just
doesn't
exist
and
like
what
is
happening
here.
A
Bison
script
yeah,
so,
in
the
end,
this
main
function
will
have
unscripted
awesome,
Kong's
TV.
Instead,
so
in
Krita
specialized
the
assembly
call
with
return
type.
V
stands
for
void
in
this
case
and
then
in
the
JavaScript
outside
of
our
NGS.
It
just
has
literally
array
of
functions
where
it
accepts
this
code
like
zero.
In
this
case,
and
just
call
this
function
like
by
the
references
are
a
the
stones
of
hearts,
but
it
works
quite
efficiently
compared
to
like
any
normal
Evo
or
something
else.
Okay.
A
A
Instead,
we
have
to
use
Excel
pointed
to
set
of
bytes,
and
then
we
can
try
to
call
it
using
the
deeper
ethics
on
rough
drinks,
which
basically
tells
like
okay
I
want
this
string
to
be
a
raw
string
like
just
by
string
yeah,
and
you
just
pass
it
to
this
well,
the
problem
is,
it
doesn't
work
because
you
need
to
convert
this
to
actual
pointer
now.
You
have
just
array
and
we
need
to
just
add
dot
spqr.
This
is
the
recommended
Russ
way
to
get
pointers
out
of
any
reference
to
a
right
and
so
on.
A
The
only
small
problem
is
this,
so
actually
it
doesn't
work
the
reason
it
doesn't
work.
As
I
said
like
this
Python
script
is
actually
goes
through
LLVM
bit
code
and
set
it
for
exactly
and
script
and
autumn
Const
int
and
a
pointer
to
some
string
and
static
memories.
We
can
extract
to
JavaScript
on
compilation
time
when
we
have
dot.
Svg
are
at
least
in
debug
mode.
Rust
doesn't
in
line
the
function,
so
you
actual
function
call
of
SBT
are
inside
the
inscription
constant,
which
makes
em
script
them
like.
Okay,
probably
this
is
not
real.
A
Javascript
I
want
to
execute
it,
and
just
nothing
happens.
It
doesn't
even
warn
you
about
it,
so
we
will
need
to
slice
the
devoted
go
away
from
what
the
plantation
suggests
and
just
use
role,
conversions
that
luckily
at
least
this
works,
so
you
can
just
do
as
star
conveyed,
and
this
is
normal
cost.
It
just
converts
to
literal
like
LLVM
caste
inscription
can
understand
it
even
in
the
barcode.
It
works.
The
only
problem.
A
Finally,
when
you
add
all
of
this,
it
starts
working,
but
it
looks
extremely
ugly,
so,
as
we've
ever
seen,
the
rest,
let's
just
hide
it
inside
of
macro,
then,
since
look
so
much
safer.
So
we
can
just
implement
this
macro
where
we
actually
get
the
first
expression,
which
is
like
just
normal
JavaScript
block
with
dream,
defy
it,
we
concatenate
with
zero
byte
in
the
end
and
do
this
two
conversions
to
actually
get
to
the
point
where
we
have
this
u8
pointers
that
encrypt
and
wants
from
us.
A
A
What,
if
you
want
to
explore
some
rough
structure
to
JavaScript
side,
to
construct
and
like
to
get
their
properties
and
so
on?
Inscription
self?
Has
a
solution
called
ambient,
which
is
like
tones
of
C++
magic,
which
templates
that
convert
your
classes
to
statically
to
some
special
and
script
and
calls
set
register
them
on
the
other
side,
and
we
will
have
actually
goes
through
them
to
replicate.
The
second
recite.
So
a
normal
inscription
example
for
ambient
looks
like
this.
A
If
you
just
have
some
class,
you
have
greater
status
for
your
properties
and
then
to
register
it
for
JavaScript
to
see
you
add
this
thing
called
Emscripten
bendings,
where
you
have
these
templates
like
dot
class
dot,
constructor
duper
apogee,
and
this
has
the
same
like
for
functions,
class
functions
and
so
on.
And
then
you
invoke
a
inscription
with
that
abend
which
Linux
it
with
special
internal
library
that
actually
just
forms
this
close
to
actual
Java
scripts.
A
That
will
register
types
and
that,
on
the
other
side
like
you,
can
just
require
this
module
and
create
classes
using
new,
my
class.
It
directly
translates
to
C++
constructor
and
you
can
get
properties
out
the
feet
and
so
on.
So
this
obvious
you're
constructing
they
actually
allocate
something
in
memory,
and
you
can,
if
you
go
into
internal
dollar
dollar
property,
you
can
see
the
pointer
in
memory
right
happens.
You
can
actually
access
that
memory
seriously
and
by
the
way,
like
inscription,
doesn't
actually
care
about.
What
exactly
you
are
accessing.
You
can
access
absolutely
any
address.
A
A
A
The
slightly
more
helpful-
this
is
definitely
more
readable
than
this,
so
the
only
thing
we
can
do
about
this
is
reverse
engineering
yeah
who
doesn't
like
it?
Okay,
let's
look:
how
exactly
am
being
register
Clause
that
it's
being
called
here
is
implemented.
Maybe
that
will
help
well,
it
says
implementing
job,
don't
call
this
directly
yeah.
Obviously,
what
we
need
to
do
call
this
directly.
A
So,
let's
look
at
the
full
definition
of
the
function,
so
it
has
tons
of
stuff,
but
basically
we
can
go
just
one
by
one.
So,
first
of
all,
we
have
type
IDs
for
the
class
itself,
its
pointer,
it's
kwang-soo,
pointer
and
base
class.
Well,
we
don't
have
base
class
is
in
rust
is
a
doesn't
matter,
but
we
want
still
other
types
so
type
IDs
into
poor
flower,
just
like
pointers
to
actual
types
and
in
Rustica
type
ID.
A
A
This
doesn't
work
with
encryption,
because
encrypting
expect
c++
types
which
are
32-bit,
so
we
need
to
just
cost
this
one
of
a
single
okay.
So
this
gets
rid
of
at
least
four
out
of
all
the
parameters.
This
extreme
self-describing
api,
I
know-
and
now
we
need
to
figure
out
like
what
is
the
get
actual
type
well
get
actual
type
apparently
is
used
for
all
the
subclass.
A
In
in
c++,
but
like
normally
for
rust
talks,
you
just
want
to
return
type
ID
of
the
same
types
that
you
got
so
you
just
build
a
generic
function
that
returns
type
ID
of
the
type
itself.
I
don't
know
why
I'm
script
and
needs
it,
but
well,
if
it
does
okay
and
now
we
have
this
signatures
before
each
function.
So
what
exactly
is
signature?
A
We
need
to
figure
that
out.
We
need
to
just
try
to
compile
some
function
and
see
like
what
signature
generates
C++
code,
so,
for
example,
for
the
function
C++
will
like
simplify
systems.
Krypton
will
just
contend.
Well,
it's
not
Wi-Fi,
but
it's
Wi-Fi,
so
what
it
actually
stands
for.
You
like
first
letter
use,
root,
n
type,
which
is
just
V
for
void,
and
others
are
arguments
so
I
for
integers
ever
floats
I
for
pointers,
so
yeah.
A
So
yeah
so
yeah,
I'm
scripting
just
has
three
types
void,
integer
ends
loads
and
basically
everything
else
can
be
represented
using
through
these
three
types
and
it
doesn't
care
on
the
other
side,
because
when
you
call
it
just
from
JavaScript
get
pointer,
you
still
need
to
the
reference
it
through.
One
of
the
arrays
at
the
earlier
showed
like
heap
32,
he
py,
8
and
so
on.
Okay,
this
seems
to
be
bridges
resold.
We
crossed
out
a
few
more
of
the
advance,
and
now
we
just
need
to
pass
class
name
and
the
actual
functions.
A
So
for
the
last
name
we
could
use
a
macro,
but
since
we
are
using
intrinsic
anyway,
you
wanted
to
use
another
hidden
feature
of
rust.
Rust
allows
you
to
get
type
name
of
any
type.
By
just
calling
this
intrinsics
and
passing
like
it's
generic
over
any
type.
You
can
just
pass
structure,
it
will
return
you
actual
rust
drink
with
name
of
this
type.
A
So
yeah
Emscripten
always
expects
this
drink,
so
we
need
to
actually
create
this
drink
too
close
and
other
location
unwrap
and
get
pointer,
and
then
it
should
work.
So
now
we
have
on
the
destructor.
So
if
we
are
passing
ownership
of
rust
objects
to
JavaScript
and
expect
it
to
be
able
to
work
with
them
like
for
violence
and
return
them
back
destructor,
so
most
likely,
we
will
be
just
passing
boxes
right.
It
just
creaking
boxes
on
the
outside
and
passing
pointers
to
JavaScript
and
expected
to
like
deallocate
when
needed,
and
then
this
starts.
A
Implementation
is
just
basically
box
from
row
when
we
pass
the
pointer
back
and
what
is
that
is.
Basically,
it
reads
box
out
of
the
pointers
that
we
gave
it,
which
is
hopefully
allocated
by
the
same
box
and
then
rusty
just
in
sets
implicit
drop
in
the
end
of
the
function,
so
it
just
delegate
what
I
will
be
busted
yay
now
the
code
when
we
try
to
write
this
all
by
hand,
looks
quite
ugly.
I
wouldn't
want
to
do
the
lake
for
every
single
function,
so
we
can
at
least
like
abstract
away
the
sistering.
A
So
some
nice
macro
it
all
do
it
looks
better,
and
then
this
can
be
wrapped
into
some
general
function
where
you
just
pass
your
structure
and
it
will
cause
this
on
its
own
okay,
another
function,
I
promise
I,
won't
be
going
through
all
the
details
again,
but
basically
we
have
M
been
register
class
constructor.
So
let's
say
we
are
not
interested
in
like
every
new
implementation
of
our
structure,
but
only
in
default
right.
A
So
this
one
is
got
much
simpler,
like
we
have
already
class
types
that
we
were
edited
before,
we
have
arguments
like
the
account
and
type
IDs
we
have
invoker,
which
is
which
has
C
:
convention
and
then
constructor,
which
can
be
anything
and
where
the
inscription
decided
lives
in
just
in
case.
If
by
constructor
you
want
to
pass
some
ID
or
float
or
whatever.
So,
on
the
other
side,
we
just
linked
to
this
normal
extern
and
for
constructor.
We
just
say
that
we
have
function
that
returns
box
void.
A
We
will
just
have
any
books,
except
for
us
doesn't
really
likes
it.
It
will
tell
us
that
we
are
passing
improper
C
types,
because
we
are
passing
normal
function
and
not
extend
one
to
a
constructor,
so
we
will
just
tell
it
to
shut
up
because
it
works
nicely.
We
know
we
ate
what
we
are
doing.
At
least
we
are
pretending
to
and
then
the
actual
invoker
what
it
will
be
doing.
A
It
will
be
just
doing
box
inter,
oh
so,
but
it
will
be
constructing
the
box
on
a
rough
side
and
just
passing
pointed
to
JavaScript
and
forgetting
about
it,
so
that
it
wouldn't
drop
it
until
JavaScript,
say
so,
and
then
for
our
type.
You
can
just
get
type
ID
for
pointers
and
bus
like
everything,
lots
of
scary,
like
pointer
lands
and,
finally,
what
we
are
doing.
We
just
get
a
default
implementation
of
box
key
and
we
transmute
it
transmission
functions.
A
A
But
for
us
we
are
missing
one
of
important
stories
which
sense,
which
is
strings
so,
while
for
c
c++,
it
already
happily
accepts
see
like
unsafe
c
strings
with
zero
byte.
It
accepts
STD
string
s,
kkw
string,
but
memory
layout
of
STD
drink
is
completely
different
from
what
trust
provides,
and
the
only
thing
we
can
do
is
actually
like
either
clone
rust,
drink
and
add
zero
byte
and
pass
gems
Krypton
or
like
clone
again,
but
in
other
memory
layers.
We
don't
really
want
to
do
that.
A
A
So
if
you
want
to
adjust
extended
and
at
our
own
API,
so
inscription
provides
mechanisms
for
that
where
you
just
write
JavaScript
into
in
like
special
kind
of
special
centers,
where
you
say
that
library
manager
that
library
should
be
extended
with
following
functions,
and
you
can
literally
put
like
any
JavaScript
inside
of
it
that
you
want-
and
these
names
inscription,
we'll
just
parse
magic
again
and
exposed
to
rust
as
normal
c
FF
I
bindings.
So
when
we
just
do
some,
my
J's,
which
says
a
lot
I
on
the
right
side.
A
We
can
say
Jess
library,
the
JavaScript
and
just
extend
the
function
and
we
can
use
it
as
net
any
other
normal
at
CF
fi
function.
So
for
us
drink
we
can
just
add
our
own
converter,
which
will
register
this
type.
It
doesn't
look
extremely
nice,
but
it's
much
more
efficient
than
cloning
strings
on
outside.
So
what
we
are
doing
here
like
when
we
are
getting
pointer
to
STR
from
rust
side,
it's
actually
a
fat
pointer
because
SGR
a
slice,
so
it
contains
both
lens
and
the
actual
pointer
to
data.
A
So
we
are
just
reading
both
from
the
heap
and
then
calling
pointer
stream
defi,
which
actually
just
take
this
chunk,
that
we
asked
it
for
and
colors
normal
JavaScript
string.
This
way
any
arrests,
STR
reference
is
immediately
converted
to
JavaScript
side
and
it
just
works
in
any
functions
like
console
logo,
and
since
we
expect
strings
on
its
side,
so
then,
then
we
just
call
it
like
a
bit
register,
a
string
which
type
idea
of
and
STR
it
arises
daily.
A
A
So,
basically,
like
any
objects
will
be
garbage
collected
before
they
even
get
to
rust,
because
often
gels
doesn't
have
access
to
the
same
memory
as
a
JavaScript
does
just
like
verb
assembly.
Because
of
that
we
will
encrypt
in
what
it
does.
It
actually
keeps
separate
array
where
it
just
keeps
any
objects
that
we
ask
it
to
keep
this
way
like,
while
it's
preserved
in
the
same
array
like
JavaScript
engine
will
no
not
two
three,
so
just
for
example,
like
first
we
start
with
window.
We
ask
sit.
A
A
This
works
just
like
a
normal
RC
reference,
counting
type,
so
window
head
like
one
reference
it
internally,
encrypting
internally
increases
like
reference
County
to,
and
so
we
can
take
values
out
of
it.
So,
for
example,
we
want
to
create
value
from
a
string
which
we
just
reduce
it.
We
just
call
em
voltage
value,
which
is
internal
implementation
of
our
API,
and
it
registered
like
this
string
on
JavaScript
side.
A
Again,
like
we
are
going
for
stand
back
every
time
to
just
get
this
handle
for
every
JavaScript
value,
then
we
can
do
a
for
example
and
we'll
get
property
where
we
just
asks
it
get
property
out
of
five
with
name
six.
It
gets
us
the
actual
document,
and
then
you
can
safely
drop
window
and
document
out
of
this
array.
They
will
be
garbage
collected
as
normal
and.
A
A
So
it's
not
extremely
nice
extensible
libraries
that
allows
you
to
DES,
realize
XML,
JSON
and
fertilize
and
back
you
just
need
to
provide
own
implementation
of
serializer.
So
why
don't
we
just
take
all
this?
Get
property
set
property
and
so
on
adorbs,
an
intercessory
Eliezer.
Then
everything
like
all
that
we
need
to
do
on
the
rough
side
is
just
say:
derive
serialize
for
any
of
other
structures
that
we
want
to
send
to
JavaScript
and
just
create
any
values
serialize
with
our
Jess
serializer.
A
How
far
does
this
work?
So,
if
you
compare
just
like
native
Jason
parse,
we
serve
the
JSON
instead
inside
of
awesome.js
over
Barnsley
certainty,
Jason
will
be
about
four
times
slower.
The
reason
for
this
is
like
that
we
are
not
really
competing
with
JavaScript
here,
but
we
are
competing.
These
native
peoples
plus
implementation
side
of
v8
of
json.parse,
so
obviously
like
nccps
I
meant
by
hand,
will
be
slower
by
default.
B
C
B
So
let
me
go
to.
A
B
A
Alright,
any
println
hello
world,
so,
let's
try
to
just
add
our
create,
which
is
awesome,
cheers
and
this
address
is
available.
Just
one
fold
go
ahead,
so
we
will
just
ask
for
now
to
just
take
it
from
the
same
path
and
let's
say
we
do
awesome.js,
sterilizer
and
absent
is
no
value
just
to
see
how
this
works.
So,
sir,
the
safe
interface
we
can
access
all
the
Global's
properties
and
so
on.
So
first
of
all,
let's
just
try
to
get
global.
A
A
We
will
talk
afterwards,
but
yeah.
So
now
you
actually
have
to
use
link
arts
for
this
and
part
without
manually.
Hopefully
this
will
work
anyway,
and
we
can
do
since.
Like
say,
everyone
I
know
get
navigator
get
user
agent.
So
all
the
strings
will
be
converted
through
an
scripting
API
and
now
say
that
we
want
to
get
three
goddesses.
C
A
A
A
So,
and
actually
this
vowel
implements,
like
all
other
normal
or
a
straight
like
we
can
do
it,
erasers
that
are
normal
es6
like
javascript
iterated,
but
convert
you
to
last
ones
without
extra
rights
and
so
on.
So,
for
example,
if
you
want
to
just
enumerate
all
the
plugins
that
our
browser
has,
we
can
just
do
for
plug-in
in
global,
get
navigator
get
plugins
like
just
native
plugins,
and
we
can
click
print
each
of
them.