►
From YouTube: RustConf 2019 - Closing Keynote by Lin Clark
Description
RustConf 2019 - Closing Keynote by Lin Clark
A
I'm
Lynn,
Clark
and
I
make
code
cartoons
and
I
also
work
at
Mozilla
and
advance
development,
and
today
I'm
going
to
be
talking
about
a
possible
future
for
rust
and
the
impact
it
could
have
on
the
programming
world.
I
have
to
say
it
was
quite
an
honor
when
I
was
asked
to
keynote
this
conference.
You
know,
of
course
it's
always
an
honor
when
you're
asked
a
keynote
a
conference,
but
that's
not
what
I'm
talking
about
here.
A
What
I'm
talking
about
is
that
rust
is
really
a
leader
in
a
whole
new
generation
of
programming,
languages
and
programming
language
communities.
It's
truly
transformative
is
transforming
the
conversations
we
can
have
about
what's
possible,
now,
I'm
sure
that
many
of
you
are
aware
of
some
of
the
things
I'm
referencing
here.
A
So
the
most
well-known
of
these,
of
course,
is
how
rust
is
ushering
in
a
whole
new
way
of
thinking
about
systems,
programming,
and
the
impact
of
this
is
visible
in
a
lot
of
different
places.
One
recent
example
is
the
series
of
blog
posts
that
Microsoft
put
out
you
know
in
these
posts.
They
say
if
only
the
developers
could
have
all
of
the
memory
security
guarantees
of
language
languages
like
dotnet
c-sharp,
combined
with
the
efficiencies
of
C++.
A
Maybe
we
can
with
rust
and
they
go
on
to
say
rather
than
providing
guidance
and
tools
for
addressing
flaws,
we
should
strive
to
prevent
the
developer
from
introducing
the
flaws
in
the
first
place.
So
we
have
one
of
the
world's
finest
tool
manufacturers
saying
do
we
really
need
to
build
tools
for
this
at
all?
A
What
if
we
can
make
developers
lives
easier
without
having
to
resort
to
tooling,
and
we
have
them
asserting
that
rust
has
opened
up
a
different,
more
desirable
possible
future,
even
if
it
were
just
for
that,
rust
would
be
an
incredibly
impactful
language,
blazing
a
new
trail
for
other
languages
to
follow.
But
it's
not
just
that
rust
has
also
blazed
a
trail
on
a
completely
different
front,
and
this
one
has
more
to
do
with
technology's
intersection
with
social
issues
from
the
early
days.
A
Quite
personally,
when
you
come
from
an
underrepresented
group
in
tech,
it
can
feel
like
you're
swimming
in
a
sea
of
unconscious
bias
and
sometimes
outward
aggression
and
seeing
a
beacon,
seeing
people
waving
a
flag
saying
that
they're
going
to
make
space
for
you
to
join
them.
That
can
be
the
difference
between
leaving
Tech
and
finding
a
future
in
it
and
I
know
this
feeling.
A
This
is
where
things
were
for
me
when
I
first
heard
about
rust
and
seeing
those
rust
leaders
seeing
them
waving.
This
flag
of
inclusion
gave
me
a
place
to
swim
towards,
and
that
was
actually
a
big
part
of
me
taking
the
job
at
Mozilla,
knowing
that
I
was
gonna,
be
working
at
the
same
company
as
a
lot
of
the
people
that
were
waving
this
flag,
so
I
swam
in
that
direction.
I
started
working
at
Mozilla.
I
wasn't
working
closely
with
the
rust
team
at
that
time,
but
I
wanted
to
move
in
that
direction.
A
A
A
So
I
got
a
little
bit
waylaid
on
my
journey
and
I
ended
up
not
getting
all
the
way
to
rust,
but
ending
up
somewhere,
rust
adjacent,
but
as
I
was
preparing,
this
talk,
I
realized.
That's
actually
given
me
a
really
great
vantage
point
to
see
another
place
where
rust
is
starting
to
blaze,
a
trail
and
that's
because
since
those
early
days
when
I
was
first
playing
around
with
rust,
compiled
to
webassembly
rust
has
developed
top-notch
support
for
webassembly.
The
experience
is
so
good.
A
It's
widely
considered
to
be
the
best
tool
chain
around
for
compiling
to
webassembly,
and
it's
not
just
that
rust
has
a
great
implementation.
Rust
is
also
informing
the
specification
actively
participating
in
shaping
the
future
of
webassembly.
A
big
part
of
this
is
a
project
called
wasm
bind
gen.
This
project
was
created
to
make
it
easier
for
rust
code
that
was
compiled
to
webassembly
to
interoperate,
with
JavaScript
and
web
api's,
because
at
least
up
until
now,
web
assembly
has
only
been
able
to
talk
in
numbers.
A
If
you
had
anything
more
complex,
so
you
know
something
that
you
wouldn't
even
think
of
being
that
complex,
a
string
that
wouldn't
work,
you
couldn't
actually
pass
that
back
and
forth.
You'd
have
to
write
all
this
glue
code
in
between
to
encode
and
decode.
This
string,
so
Luke
expert
nerd
sniper
that
he
is
found
some
folks
to
work
with
him
to
sort
out
this
problem.
He
explained
a
few
rough
ideas
so
to
people
you
might
know
Alex
Crichton
and
Nix
Jerald,
and
this
was
how
wise
invention
was
born
a
provided,
really
ergonomic
yet
performance.
A
So
it
showed
what
was
possible
and
there
started
to
be
this
virtuous
cycle
with
web
assembly
proposals
around
interoperability,
influencing
wise
and
bind
gen
and
woz
and
bind
gen
influencing
those
proposals
and
with
this
virtuous
cycle,
this
is
becoming
a
much
bigger,
much
more
impactful
thing.
It's
moved
past,
just
interoperability
with
the
web
platform
and
onto
interoperability
with
all
of
the
things.
A
Why
would
you
want
to
do
this?
Why
would
you
want
to
use
it
as
a
web
assembly
module
in
all
of
these
different
contexts?
Well,
there
are
a
few
reasons:
if
your
app
is
in
a
scripting
language
like
Python,
then
what
would
something
could
be
much
faster.
You
could
get
near
native
performance
without
the
hassle
of
compiling
a
native
extension.
If
your
app
is
in
a
lower
level,
language
like
C++,
then
web
assembly
can
give
you
lightweight
sandboxing
the
module,
can't
access
memory
or
other
resources
unless
they've
been
directly
handed
to
it.
A
Why
is
this?
Well,
it's
for
a
couple
of
reasons.
Rust
already
has
really
a
really
good
story,
around
code,
reuse
with
affordances,
like
the
module
system
and
creció,
and
it
already
does
have
what's
widely
considered
to
be
the
best
tool
chain
for
compiling
to
web
assembly.
So
rust
could
blaze
a
trail
here
and
I
know
that
I,
for
one
would
really
like
to
see
that
I'd
like
to
see
rust,
bring
those
technical
values
and
those
social
values
to
a
much
broader
community
to
the
union
of
all
of
these
language
communities.
A
So
I'm
going
to
explain
the
proposal
in
more
depth
and
I
hope
that
this
helps
you
all
think
through
what
kind
of
impact
rust
can
have
here
now.
There
may
be
some
things
in
this
explanation
that
our
review
for
you
but
I
like
to
make
sure
that
everybody's
on
the
same
page.
So
please
bear
with
me
for
those
parts.
A
First,
I'll
start
by
explaining
the
initial
problem
that
both
the
specification
and
wasum
bind
gen
we're
trying
to
solve,
and
then
I'll
talk
about
the
larger
problem
that
they've
moved
on
to
since
then
so,
like
I
am
in.
Like
I
mentioned,
the
initial
problem
was
a
more
tractable
one.
How
can
webassembly
interact
with
the
web
platform
using
high-level
types?
Now
this
still
isn't
a
tiny
problem.
A
So
here
we
have
an
obvious
solution:
just
create
a
mapping
from
web
assembly
to
web
IDL,
just
as
there
is
for
JavaScript,
but
that's
not
as
straightforward
as
it
may
seem
for
simple
web
ideal
types
like
boolean
and
unsigned
long
they're,
clear
mappings
from
web
assemblies
numbers
to
web
ideal.
But
for
the
most
part
web
web
keep
parameters
are
more
complex
types.
A
So,
for
example,
an
API
might
take
a
dictionary
which
is
basically
an
object
with
properties
or
a
sequence,
which
is
basically
an
array
to
have
a
straightforward
mapping
between
webassembly
types
and
these
web
IDL
types.
We
need
to
add
some
higher-level
types
to
web
assembly
and
we
actually
are
doing
that
with
the
GC
proposal.
A
With
that
web
assembly
modules
we'll
be
able
to
create
GC
objects,
things
like
structs
and
arrays,
and
those
will
be
you
know,
you'll-
be
able
to
map
those
to
the
more
complex
web
ideal
types,
but
if
the
only
way
to
interoperate
with
these
web
api
is
through
GC
objects
that
makes
life
harder
for
languages
like
rust
and
c++
that
wouldn't
use
GC
objects.
Otherwise,
whenever
that
code,
interoperates
with
a
web
api,
would
have
to
create
a
new
GC
object
and
copy
values
from
its
linear
memory
into
that
object.
A
A
But
even
though
the
exact
layout
and
memory
for
these
is
often
different,
there
are
some
abstract
concepts
that
are,
they
usually
share
in
common,
so,
for
example,
for
Strings
the
language
often
has
a
pointer
to
the
offset
in
memory
and
a
number
indicating
the
length.
So
this
means
that
we
could
reduce
this
string
down
to
a
type
that
webassembly
does
understand.
2-Inch
32s.
A
Now
we
could
hard
code
this
mapping
into
the
engine,
just
like
the
JavaScript
to
what
ID
l1
is.
You
know
we
could
say
that
if
this
web
api
is
taking
a
string-
and
I
pass
two
numbers-
just
figure
out
what
to
do
from
there
but
there's
another
problem
here:
webassembly
is
a
type
checked
language
to
keep
things
secure.
A
The
engine
has
to
check
that
the
calling
code
is
passing
in
the
right
types,
the
ones
at
the
colleagues
backs,
and
this
is
because
there
are
ways
for
attackers
to
exploit
type
mismatches
and
make
the
engine
do
things.
That's
not
supposed
to
do
so.
If
you're
calling
something
that
takes
a
string
and
try
to
pass
an
integer
to
it.
The
engines
gonna
yell
at
you,
and
it
should
yell
at
you.
A
So
we
need
a
way
for
a
module
to
explicitly
tell
the
engine.
Something
like
I
know,
document
create
element,
I
know
that
that
takes
a
string,
but
when
I
call
it
I'm
gonna
pass.
You
two
integers
now
use
these
to
create
a
Dom
string
from
my
linear
memory,
and
this
is
what
an
early
version
of
the
proposal
did.
It
gave
a
web
assembly
module
a
way
to
map
between
the
types
that
it
uses
and
web
ideal
types.
Now
these
mappings
aren't
hard-coded
in
the
engine.
A
So
how
do
we
generate
this
booklet?
Well,
the
compiler
takes
care
of
that.
For
you,
it
adds
a
custom
section
to
the
web
assembly
module
so
for
many
language.
Toolchains,
the
programmer
doesn't
have
to
do
very
much
work
at
all.
So,
for
example,
let's
take
a
look
at
how
the
RUS
tool
chain
handles
this
for
one
of
those
simplest
cases
where
you're
passing
a
string
into
the
alert
function.
A
The
programmer
just
has
to
tell
the
compiler
to
include
this
function
in
the
booklet
using
the
annotation
wise
and
bind
gen
by
default.
The
compiler
will
treat
this
as
a
linear
memory
string
and
add
it
the
right
mapping
for
that,
and
if
you
wanted
it
to
be
some
other
kind
of
string,
you
could
add
a
little
bit
more
to
that
annotation.
A
A
A
A
A
What
bad
girl
kind
of
looks
like
an
IR
now
why
by
DL,
is
pretty
specific
to
the
web,
and
there
are
lots
of
use
cases
for
webassembly
outside
of
the
web,
so
what
my
deal
itself
isn't
really
great
ir
for
us
to
use.
But
what
have
you
just
used
web
ID
Allah,
is
inspiration
and
create
a
new
set
of
abstract
types.
A
This
is
how
we
got
to
the
web
assembly
interface
types
proposal.
These
types
aren't
concrete
types.
They
aren't
like
the
inch
32
where
the
float
64
in
web
assembly
today
there
are
no
operations
on
them
in
web
assembly,
so,
for
example,
we
won't
be
adding
any
string
concatenation
operations
to
web
assembly.
Instead,
all
operations
are
performed
on
the
concrete
types
on
either
side.
A
There's
one
key
point
that
makes
us
possible
with
interface
types.
The
two
sides
aren't
trying
to
share
a
representation.
Instead,
the
default
is
to
copy
values
between
one
side
and
the
other
side.
So
this
makes
a
lot
easier
for
a
single
module
to
talk
to
many
different
languages
because
it
decouples
them.
In
some
cases,
like
the
browser,
the
mapping
from
the
interface
types
of
the
hosts,
concrete
types
will
be
baked
into
the
engine,
so
one
set
of
mappings
will
be
baked
in
at
compile
time
and
the
other
is
handed
to
the
engine
at
load
time.
A
But
in
other
cases,
when
you
have
two
web
assembly
modules
that
are
talking
to
each
other,
they'll
both
send
down
a
little
booklet.
They
both
have
that
booklet
that
maps
their
types
to
the
abstract
types,
the
interface
types
now
one
thing
I
forgot
to
mention
here-
is
that
these
the
instructions
that
use
for
defining
these
are
actually
declarative.
You
know
use
instructions,
but
there's
no
loops
or
other
control
flow
mechanisms.
That
would
turn
this
into
a
turing-complete
instruction
set.
A
So
what
do
these
instructions
look
like
well
before
we
get
into
that?
I
should
say
this
proposal
still
under
development.
So
the
what
I'm,
showing
you
here
is
very
likely
to
change
before
it's
all
said
and
done,
and
also
this
is
all
handled
by
the
compiler.
So
even
when
this
proposal
is
finalized,
you'll
only
need
to
know
what
annotations
your
tool
chain
expects
to
be
in
your
source
code.
A
A
What
does
this
look
like
in
Reverse
like
if
we
were
trying
to
take
a
string
as
parameter
in
that
case
we'd
use
string
to
memory,
so
this
would
go
from
the
abstract
string
to
the
concrete
string
type
in
our
linear
memory.
So
we
do
an
r
get
to
put
a
reference
to
the
abstract
string
on
the
stack,
and
then
we
would
call
string
to
memory,
and
the
first
immediate
here
does
the
same
thing
that
the
memory
to
string
one
did.
A
So
this
is
how
the
declarative
mapping
works
and
there's
a
really
nice
side
effect
to
it
being
declarative.
The
engine
can
see
when
the
translation
is
actually
unnecessary.
One.
You
know
the
two
modules
on
either
side
are
already
using
the
same
type,
and
then
the
engine
can
skip
a
lot
of
the
steps
in
between.
A
A
We
can
keep
up
with
the
standard
as
it
develops,
even
though
all
of
these
parts
will
continue
changing
we're
synchronizing
the
changes
so
as
long
as
you're
using
up-to-date
versions
of
all
of
these,
you
shouldn't
have
things
breaking
on
you
too
much
so
now
on
to
the
demo
and
I
have
to
say,
I
have
a
healthy
fear
of
the
demo
gods.
So
these
are
actually
all
recorded
to
show
of
how
this
works.
A
We
need
a
web
assembly
module
that
uses
interface
types,
so
let's
go
ahead
and
make
one
and
since
I've
been
talking
about
strings
so
much
I'll
use
one
that
takes
strings
and
return
strings,
so
a
markdown
parser
and
since
I'm,
not
this
modules,
author
I'll
do
this
by
wrapping
functionality
with
the
functionality
of
this
module.
With
my
own
module.
A
So
I'll
create
a
render
function
and
that
uses
string
types
and
annotate
it
with
the
blossom
blind,
Jen
macro,
and
this
is
all
the
magic.
It
knows
how
the
the
various
string
types
in
rust
should
be
matched
to
the
webassembly
string
type
and
then
I'll,
compile
it
using
wasum
pack
and
the
woz
and
interface
types
lag
which
is
needed
right
now,
because
this
is
experimental.
A
So
this
gives
us
that
single
wasm
file
that
we
can
use
in
all
of
these
different
environments
for
our
first
environment.
Let's
try
something
like
pure
web
assembly.
This
is
a
standalone
runtime,
so
I'll
download
class
some
time
from
while
some
time
talk
to
F
and
then
we
can
run
this
module
and
pass
it.
A
markdown
string-
and
you
see
if
the
web
assembly
module,
took
that
markdown
string
and
returned
to
the
HTML
string.
A
Even
though
the
runtime
doesn't
know
anything
about
how
rough
strings
work,
they
were
able
to
communicate
with
each
other
using
these
high-level
types.
So
that
was
easy
and
straightforward.
But
what
about
Python?
Can
we
use
this
markdown
parser
there?
Yes,
we
can-
and
we
might
want
to
for
the
speed
to
do
this.
We
download
the
West
and
time
extension,
and
this
makes
it
possible
for
Python
modules
to
call
webassembly
functions
and
then
all
I
need
to
do
is
import
the
extension
and
the
markdown
module
and
then
I
can
call
the
render
function.
A
And
again
it
works.
The
types
were
different,
this
time,
we're
passing
in
Python
values,
but
it
still
just
works,
and
this
is
because
of
that
magic
of
interface
types,
the
same
file
runs
in
the
same
way.
We
can
also
use
the
same
web
assembly,
module
and
rust.
One
reason
you'd
want
to
use
the
web
assembly
module
here
is
for
lightweight
sandboxing.
That
I
was
talking
about
before
you
know.
This
isolates
this
third-party
code
from
the
rest
of
your
application.
A
So
let's
look
at
how
this
works,
so
we
add,
while
some
time
rust
as
a
dependency,
and
this
does
the
same
thing
as
the
Python
extension
and
then
in
the
main
file.
We
add
the
Oise
and
time
rust
macro
and
then
add
a
trait
and
we're
gonna
add
a
render
method
as
part
of
that
tree,
but
we
won't
add
an
implementation
here
where
you
might
expect
it.
Instead,
the
web
assembly
module
is
going
to
be
that
implementation,
so
the
macro
just
wires
that
up
for
us.
A
It
also
adds
in
other
methods
on
that
trait,
like
load
file,
which
instantiates
a
web
assembly
module
from
a
file.
So
in
the
main
function,
we'll
call
low
file
to
instantiate
the
module
and
then
we'll
call
render
and
something
that's
important
to
note
here.
The
result
is
actually
strongly
typed,
so
it
can
be
used
exactly
in
the
same
way
as
a
natively
compiled
version
of
this
functionality.
A
So
now,
let's
use
cargo
to
run
it
and
again
it
just
works,
except
with
a
different
environment
using
different
types.
Now
this
might
not
seem
impressive
since
we
compiled
the
original
version
from
rust,
but
it
would
work
just
as
seamlessly
even
if
this
were
compiled
from
go,
receive,
plus
plus
as
long
as
module
was
using
interface
types.
A
So
where
else
can
we
make
this
work?
I
don't
have
enough
time
to
show
you,
but
it
already
works
in
node
and
the
web
as
well
through
Watson
behind
Jun,
and
that's
the
same,
what
Russ
module
compiled
to
web
assembly
and
we're
using
it
the
same
rich
API
and
types
to
talk
to
five
wildly
different
runtimes
and
languages,
and
those
are
just
a
few
examples.
There's
no
reason
this
can't
work
in
other
languages
and
other
runtimes,
many
more
of
them.
A
So
I
hope
this
helps
illuminate
the
potential
here,
the
potential
for
rust
to
bring
the
many
things
that
have
made
it
so
impactful
the
technical
values
and
the
social
values
directly
to
the
rest
of
the
programming
world,
because
that
is
a
possible
future.
Now
and
I
know
it's
a
future
that
many
of
us
would
like
to
see.
I
want
to
thank
the
people
who
have
been
working
on
this.
The
folks
they've
been
working
on
the
specification
and
a
huge
thanks
to
the
folks
that
worked
on
the
demo.
A
They
did
a
tremendous
job
incorporating
web
assembly
into
all
of
these
environments,
and
they
also
are
very
involved
in
all
of
the
rust
and
web
assembly
work.
So
if
you
want
to
learn
more
about
how
you
can
incorporate
web
assembly
into
another
language
or
runtime
they're,
definitely
good
people
to
talk
to
I
also
want
to
thank
my
fantastic
collaborators,
till
Schneider
8
and
Luc
Wagner
for
their
invaluable
input
on
both
the
talk
in
the
post
around
this,
and
thank
you
all
for
listening.