►
From YouTube: CinciJS - WebAssembly with Chris Nelson
Description
Join SuperChris as he updates us on the state of WebAssembly and gives a short demo of Rust interacting with the land of browsers.
A
Okay,
go
ahead,
Chris
start
talking:
okay,
hi,
I'm,
Chris,
again
I'm
still
here,
so
yeah
I
didn't
actually
have
a
speaker
really
for
this
month.
So,
like
the
title
says,
this
is
a
little
bit
like
hastily
prepared
and
slapped
together.
However,
the
topic
webassembly
is
something
that
I've
been
really
interested
in
for
a
really
long
time
and
I
was
able
to
get
a
demo
together.
That
I
think
is
fairly
interesting.
It
is
kind
of
like
low-level
nerdery
and,
like
very
little
like
front
end
nice,
appealing
visually
good
stuff,
so
I
apologize
for
that.
A
If
that's
not
your
bent,
but
hopefully
I
can
kind
of
explain
why
what
a
fierce
appear
to
be
not
that
interesting
stuff
coming
out
on
the
console.
The
implications
of
that
I
think
are
really
really
cool,
so
webassembly
how
many
people
have
heard
of
webassembly,
yet
so
most
people,
maybe
about
half.
So
that's
that's
kind
of
cool.
A
A
So,
first
of
all
to
understand
why
webassembly
is
interesting
and
cool
I
think
it's
fun
to
kind
of
like
climb
back
into
my
Wayback
Machine
with
me,
how
many
people
are
doing
web
development
in
1995,
okay,
cool,
like
a
few
people?
Okay,
awesome!
So
in
1995
there
was
this
browser
called
Netscape
and
write
it.
A
So
I
did
my
internship
in
college
in
1995,
in
Nationwide,
Insurance
and
I
was
mostly
doing
sequel,
sequel
server,
but
I
kind
of
had
this
side
thing
where
I
was
building
them
some
web
stuff
and
right
during
that
summer,
probably
in
the
spring,
actually
netscape
version.
I
don't
know
I
want
to
say
100.
Maybe
it
was
one
one
shipped
and
Netscape
had
that
version
of
Netscape
had
two
new
things
in
it.
A
It
had
a
language
called
JavaScript
which
was
brand
new
and
it
turns
out
written
by
a
guy
named
Brandon,
Naik
I
want
to
say
in
like
10
days,
and
it
had
this
language
that
everybody
already
knew
about,
which
is
this
up-and-coming
language
that
was
getting
more
and
more
attraction
and
people
were
excited
about
called
Java
and
at
the
time
JavaScript
was
definitely
the
afterthought.
It
was
like
this
really
kind
of
like
people
saw
it
and
they
advertises
like
kind
of
almost
a
little
toy
for
making
your
webpages
more
interactive.
A
But
if
you
wanted
to
do
like
serious
hardcore
software
engineering
in
the
browser,
you
want
a
Java
that
was
like
the
tool
that
you
were
supposed
to
use
to
do
that,
and
so
it's
obviously
super
interesting
that,
like
nowadays,
Java
and
the
browser
is
dead
as
a
doornail
and
JavaScript
is
like
this
user
group
that
you're
sitting
at
so
like
that's
weird
what
happened?
Okay!
A
A
You
could
finally
talk
to
the
rest
of
the
web
page
from
Java,
but
by
that
time
that
was
already
almost
dead
and
it
was
too
late.
So
the
idea
of
Java,
being
a
virtual
machine
in
the
browser,
actually
gave
us
a
lot
of
the
same
abilities
that
webassembly
will
as
we'll
see
here
in
a
second,
but
it
ultimately
failed,
but
the
idea
of
wow
what
if
we
could
have
a
virtual
machine
in
the
browser
and
we
could
write
whatever
language
we
want.
A
It's
actually
not
new.
We
tried
it
once
already
and
we're
like
just
going
in
this
giant
circle
and
I
just
find
that
like
super
super
interesting,
maybe
nobody
else
cares.
But
anyway,
let's
talk
about
load
assembly.
What
is
web
assembly
web
assembly
according
to
their
website,
web
assembly
or
wisdom,
is
the
new
portable
size
and
load
time
efficient
format
suitable
for
compilation
for
the
web.
A
A
A
So
all
the
browser's
at
this
point
in
time
have
some
kind
of
JavaScript
virtual
machine
built
into
them,
and
what
web
assembly
is
doing
is
exposing
the
internal
browser.
Vm,
that's
already
there
so,
rather
than
the
of
bolt-on
we're
saying
like
what.
If
we
could
like
directly
expose
the
virtual
machine
and
possibly
skip
the
fact
or
not
care
about
the
fact
that
javascript
is
the
language
that
this
virtual
machine
knows
how
to
execute
natively.
What
if
it
could
execute
whatever
language
that
we
want
to
so
I
should
have
added
a
slide
here.
A
A
When
you
write
computer
programs,
you
compile
those
computer
programs
in
whatever
language
that
you
wrote
them
in
down
into
machine
language,
zeros
and
ones
that
your
cpu
that
little
chip
inside
your
laptop
can
execute.
If
you
have
a
different
kind
of
chip,
you
need
to
compile
it.
I
can
admit
the
right
kind
of
instructions
for
whatever
kind
of
computer
chip.
That
is
a
virtual
machine,
is
basically
an
idea
which
says
that
what,
if,
instead
of
compiling
into
actual
machine
instructions
that
can
execute
on
whatever
CPU
I
have
what?
A
If
I
made
up
this,
pretend
computer
that
had
a
set
of
instructions
that
I
define
and
I
compile
into
this
pretend
machine
language.
The
advantages
that
this
pretend
machine
language,
it's
easier
to
translate
that
at
the
lower
level
into
the
actual
machine
language.
And
so
that's
the
idea,
and
it
also
makes
it
really
easy
to
make
a
compiler
once
that
can
compiled
into
a
some
pretend
machine,
language
format
and
I,
don't
have
to
write
a
separate
compiler
for
every
different
kind
of
computer
chip.
That's
on
our
market,
that's
the
basic
idea
of
the
virtual
machine.
A
So
that
said,
exposing
that
means
I
can
write
in
whatever
programming
language
I
want.
The
other
thing
that's
different.
This
time
is
cross
browser
support,
so
web
assembly,
like
I,
couldn't
believe
this
actually
happens
when
I
saw
happen,
but
webassembly
is
actually
there's
commitment
to
support
across
Chrome
Firefox
and
ie
Chrome,
as
you
might
guess,
Chrome
and
Firefox
are
done
and
edge
is
still
coming
along,
but
there's
actually
like
official
support
across
all
the
browsers
to
be
able
to
support
it.
So
those
are
what's
that
yeah.
So
far,
sorry,
my
bad
I.
A
Yeah
I'm
sure
it's
like
the
future.
The
future
Microsoft
browser
whatever
is
whatever
they
call
it.
I,
have
trouble
keeping
track
of
all
those
things,
but
the
point
is
like
the
Microsoft
browser
platform
will
also
adopt
this
as
well.
It
is
like
underway
with
it.
The
other
thing
that's
really
really
important
is
it
does
have
well-defined
J's
bindings.
So
when
you
build
something
in
web
assembly,
you
can
talk
to
it
and
execute
things
from
JavaScript.
A
Obviously
this
is
Java
users
group.
So,
like
yeah,
that's
a
thing
and
I'm
not
here
to
talk
trash
on
JavaScript,
but
I
like
freedom
of
choice
as
a
developer,
I
want
to
be
able
to
choose
what
I
want
to
use
to
do
whatever
I'm
doing
when
it
comes
right
down
to
it.
Java
scripts
got
a
ton
better
and
maybe
I'll
keep
choosing
it
but
like
not
having
to
I.
Think
is
awesome.
A
Also,
there's
some
definite
performance
benefits
that
wasm
promises,
and
especially,
if
you're
doing
things
like
hard
core
3d
graphics,
whatever
in
the
browser
being
able
to
optimize
code
by
dropping
down
to
a
lower
level
languages.
Interesting,
so
is
it
ready
yet
kind
of
we'll
see
like
what
are
the
things
that
are
good
now
and
we
can
do
and
what
are
the
things
that
are
like
stay
tuned
coming
soon?
A
So
what
can
I
do
right
now?
I
can
execute
plasm
format.
So
ways
format
is
like
a
binary
format
of
these
imaginary
machine
language.
Instructions
basically
I
think
it's
a
little
higher
level
abstraction
than
that.
But
I
don't
go.
Look
at
the
binaries
to
see
what
they
are
I'm,
not
that
interested
so
browsers.
Right
now,
like
Chrome
right
now,
today,
stock
Chrome
can
just
execute
plasm
I
didn't
have
to
go
to
Crenn
Eric
canary
to
do
it.
A
A
There
are
compilers
that
can
emit
wasm
that
binary
format
and
the
key
one
is
LLVM,
which
is
a
kind
of
a
virtual
machine.
Compiler
back-end
I'm,
not
an
LLVM
expert,
but
it's
basically
like
a
compiler
back-end
that
lots
of
lots
of
languages
use
and
so
rust
is
the
example.
Language
I'm,
going
to
look
at
rust,
using
LLVM
can
compile
into
this
wasm
format,
so
the
two
languages
that
you
can
actually
practically
do
stuff
with
in
wasm
so
far
the
ones
that
I
can
find
working
examples
for
our
seed
and
rust.
A
How
many
people
have
heard
of
rust
at
all?
Okay,
so
most
people,
actually
that's
pretty
cool,
so
rust,
is
a
it's
I
think
it's
mainly
like
a
system
level,
programming
language
that
Mozilla
came
up
with,
and
it's
a
pretty
low
level
language
designed
to
write
operating
systems
and
things
of
that
level.
It's
basically
it
snitches
to
be
a
more
productive.
C
C
is
like
a
really
old
school
language
been
around
forever
and
rust
is
trying
to
fill
that
same
Nicias
c.
So
it's
pretty
low
level.
A
You
can
do
things
like
memory
management
yourself
in
rush
and
see
yeah,
you
got
to
do
memory
management
yourself,
so
they're
both
pretty
low
level
languages
and
it
might
occur
to
you-
and
it
certainly
did
to
me
like.
Why
do
I
am
I
limited
to
such
low
level
languages?
Why?
Why?
Why
aren't
all
the
languages
in
the
world
just
like
jumping
on
this
and
building
compilers
that
emit
lesson?
A
I
will
answer
that
question
in
just
a
minute,
but
let's
go
ahead
and
jump
in
and
do
a
demo,
so
I
thought
it
was
really
cool
to
actually
do
true
language
choice.
I,
don't
know
rough
at
all,
so
I'm
just
sort
of
like
stumbling
around,
but
I
got
a
demo
and
was
able
to
actually
write
some
of
my
own
rust
code
and
see
it
actually
work
in
the
browser.
A
So
I
thought
it
would
be
really
cool
to
see
that
so,
let's
jump
into
the
code
and
then
I'll
actually
run
it,
because
the
demo
is
frankly,
the
least
exciting
bit.
Sadly,
but
let's
start
with
a
file
of
rust
so
for
those
that
haven't
seen
rust.
Hopefully
this
is
I,
don't
know
what
I'm
doing
either,
but
this
was
mostly
self
explanatory
view.
A
A
It
knows
how
to
translate
print
line,
which
is
like
the
internal
like
puts
their
system.out.print
line
of
rust.
It
actually
sends
that
to
the
so
knows
how
to
do
that.
Much
and
then
I'm,
defining
two
functions,
add
and
multiply
that
are
self-explanatory.
I
think
rust
is
a
type
language,
so
I
have
to
tell
it
my
parameters
and
my
return
value
are
all
in
32s.
Something
else
that's
interesting,
probably
or
at
least
I'll
give
you
a
little
context.
A
These
are
all
like.
Take
numbers
and
return.
A
number
type
function,
I
actually
tried
and
wanted
to
say,
like
oh
I,
think
it
would
be
cool
to
do
some
string,
manipulation,
I'd,
like
a
little
hello
function
that
took
a
string
and
return
a
string
actually
working
with
strings
in
rust
and
then
sending
them
back
to
the
browser
turns
out
to
be
non-trivial
because
I'm,
not
yet
an
expert
enough
with
memory
management
in
rust
to
know
that,
like
a
string
well,
I,
don't
know
how
many
bytes
that
is
ahead
of
time.
A
I
got
to
allocate
the
right
amount
of
memory
and
then
I
got
to
deal
with
sending
that
back
into
the
browser,
and
that
was
like
too
hard
for
me
to
do
so.
Like
literally
writing
a
hello
world
function
was
required
more
brain
power
than
they
had
I
had
in
the
hours
that
I
spent
at
it
yesterday.
So
that
gives
you
an
idea
for
like
what
level
we're
at
right
now
we're
like
way
down
here
so
I'll
talk
about
like
how
that's
going
to
get
better
here
soon
in
a
little
bit,
but
right
now,
yeah.
A
A
There
is
a
web
pack
plug-in
which
runs
the
rust,
compiler
and
builds
my
executable
for
me
already.
So
basically,
all
I
had
to
do
is
start
with
an
example
project
and,
as
we
can
see
here
in
my
java
script,
I
can
actually
require
rust
files
and
use
them,
and
web
pack
knows
how
to
do
all
the
work
for
me
to
be
able
to
make
that
happen.
So
this
require
actually
web
pack
is
taking
care
of
the
details
of
running
the
rust
compiler
on
this
file
emitting
a
wasm
binary
format.
A
A
I'm
calling
initialize
I'm
passing
this
flag.
I
actually
had
to
add
this.
When
I
first
started
working
with
this
demo,
it
didn't
work.
What
happened
was
I
would
load
my
functions,
but
by
the
time
I
tried
to
execute
them,
the
run
time
would
have
executed
would
have
exited,
and
it
would
tell
me
that
runtime
is
no
longer
around.
You
can't
execute
that
function
anymore,
which
was
kind
of
awkward,
so
I
had
to
pass
this
extra
flag
in
here.
A
To
tell
it
hey,
don't
let
the
runtime
exit
execute
please,
because
I
want
to
actually
be
able
to
use.
Those
functions
anyway
seems
a
little
silly,
but
that's
what
I
had
to
do
so
so
this
initialized
actually
like
buyers
up
the
wazoo
stuff,
and
it
returns
a
promise
where
my
wasm
module
gets
passed
in
the
after
it's
bloated.
This
module
is
what
contains
the
executable
right
stuff
and
how
I
bridge
that
executable,
Russ
stuff
into
JavaScript
is
with
functions
on
that
module
object
and
the
only
function
that
I'm
using
here
is
called
C,
wrap
I.
A
A
I
am
wrapping
an
add
function
and
I
need
to
tell
it
all
the
type
information.
So
that's
important
when
we're
going
from
like
totally
different
environments,
one
billion
other.
Somehow
the
system
has
to
know
how
to
map
types
from
one
environment
to
types
in
another
environment
and
the
JavaScript
primitive
types.
It
knows
how
to
do
that
with,
in
this
case
I'm
just
using
number.
That's
it.
I
had
issues
with
string
like
I
said
so
this
says:
hey
this
function
returns
a
number
and
then
that
last
argument
is
the
parameters.
A
I
have
two
in
there,
both
numbers,
so
I
get
back
a
function.
A
JavaScript
function
from
that
module,
C,
wrap
call
and
then,
finally,
once
all
that's
done,
I'm
able
to
just
invoke
those
functions
as
if
they
were
JavaScript
because
effectively
they
are
so
just
so.
You
can
actually
see
this
is
working.
A
We
can
see
that
it
actually
outputs
hello
world
as
I'm
calling
Russ
functions
from
JavaScript
up
with
the
result
of
ADD
and
the
result
of
our
multiply,
which
is
a
lie,
so
it
actually
works.
I
can
actually
execute
Russ
compiled
code.
In
my
browser,
I
know
it's
not
visually
cool,
but
for
me
like
as
it
the
implications
of
it
are
pretty
exciting
and
yeah.
That's
my
tempo,
such
as
it
is,
let's
see
so
I
promised
like
there
was
a
question
that
I'd
get
back
to,
and
that
is
like.
A
Why
can't
I
use
higher-level
languages
like
Ruby
and
crystal
and
whatever
whatever
whatever,
and
it
turns
out.
There's
some
features
that
higher-level
languages
expect
from
their
runtime.
The
principal
ones
are
a
garbage
collector.
If
you
think
about
a
language
like
Ruby,
you
never
have
to
allocate
memory
yourself,
you
just
make
objects
willy
nilly
and
there's
the
thing
called
the
garbage
collector
that
keeps
track
of
who's
using
those
objects
and,
if
nobody's
using
those
objects
that
cleans
up
that
memory
for
you,
so
that
you
don't
run
out
of
it.
The
other
Oh
memory
management.
A
You
know
that's
a
type
I'm,
sorry
garbage
collector
and
memory
manager.
That's
just
different
ways
of
saying
the
same
thing.
The
other
bullet
point
should
have
been
reading
that
the
other
thing
that
most
modern
one
times
expect
you
to
be
able
to
have
or
most
higher-level
languages
expect
out
of
their
runtime
is
the
ability
to
view
threads.
So
those
are
the
features
needed
by
languages.
Here's
the
complete
list
of
feature,
those
features
that
are
supported
by
web
assembly.
Currently,
as
you
can
see,
there
aren't
any.
A
However,
what's
cool
is
all
of
those
things
are
actively
on
the
roadmap
and
if
we
I
should
have
actually
left
a
link
to
this
over
here.
But
if
you
actually
go
in
and
find
some
of
these
features,
you
can
actually
yeah
host
MVP
features
document.
So
all
of
these
things
so
right
now
we're
webs
assembly
at
is
at
is
the
MVP
has
just
now
shipped
and
been
declared
like
done
we're
done
with
the
MVP
and
the
MVP
is
just
like.
A
Can
we
execute
plasm
code
in
the
browser,
and
we
saw
that
happen
and
we
can
do
that?
The
next
things
are
like:
how
do
I
build
out
this
platform
so
that
I
could
support
higher
level
languages,
as
we
can
see
there,
the
key
bits
that
we're
going
to
need
garbage
collection
and
threads
are
underway
right
now
and
if
you
want
to,
if
you
track
through
these
issues,
you
can
actually
go
find
that
there
git
repositories
with
code
and
then
for
a
lot
of
them
and
people
actually
working
on
that
stuff.
A
A
A
A
Seems
like
it's
starting:
okay,
yes
doing
something!
Oh
you
can't
hear
the
little
silly
sounds
that
it's
playing.
Oh
look:
I've
got
a
little
tank.
I
bet,
I
can
shoot
stuff,
which
one
is
mine,
I'm
moving
the
red
tank,
but
when
I
press
the
spacebar,
the
blue
tank
shoots
so
yeah,
maybe
they
got
some
issues
to
work
out
there
I
guess,
but
it's
still
like
using
unity,
which
is
what
real
game
developers
use
and
it
actually
works.
So
yeah,
that's
kind
of
my
schpeel
any
any
questions
on
what
assembly.
A
I'm
most
excited
about
language
independence,
so
I
see
languages,
maybe
not
Ruby,
but
I.
Think
it's
more
likely
a
language
like
crystal,
which
is
very
closely
related
to
Ruby
and
uses
LLVM
I
think
crystal
might
be
one
of
the
first
ones
that
I'd
be
interested
in,
because
I
think
it
already
uses
LLVM.
Any
languages
are
based
on
LLVM
at
that
you
will
ship
first,
so
pearl
actually
might
be
one
of
the
first
ones
believe
internet
sea.