►
Description
From the Berlin Rust's November "Rust and Tell" Meetup (https://www.meetup.com/Rust-Berlin/)
"Rust and Tell“ is a monthly event to share ideas, and learn about new things in and about Rust. Meet fellow Rustaceans, share your learnings, get motivated and inspired. We’re open to any and all kinds of talks about any subjects that you think will be interesting to an audience interested in Rust. Whether you're an experienced Rust developer or just getting started, we strongly encourage you to share your learnings.
Antonio De La Cruz: https://twitter.com/AntonioVdlC
Hosted at Prisma: https://www.prisma.io/
🎥 Filmed by iStream: http://www.istream.pl/
A
All
right
so
I'm,
hello,
everyone
tonight,
I'll
be
talking
about
implementing
life
by
leveraging
roasting
webassembly.
It
probably
won't
be
as
cool
as
last
month's
talk
about
the
co2
measuring
device
by
thanks.
That
was
pretty
cool,
but
hopefully
we
cool
enough.
So
let's
do
Braden
so
really
quickly.
My
name
is
Antonio.
Do
happen
to
have
a
very
long
last
name
in
the
Spanish
tradition
of
first
names,
I
moved
to
Bari
in
a
couple
months
ago:
I'm
not
working
as
a
first
second
engineer
at
least
some.
We
actually
just
like
a
couple
of
blocks
from
here.
A
So
it's
pretty
short
walk,
walk
to
come
here
and
we
didn't
talk
with
up
a
tip
some,
but
we're
not
doing
any
rust
yet
so
I'm
here,
mostly
as
a
hobbyist
I've,
started
learning
rust
this
year,
mostly
interested
in
webassembly
as
a
web
developer
myself,
and
to
give
you
kind
of
a
idea
of
how
good
am
I
trust
right
now.
This
is
my
third
meetup
and
in
the
two
previous
quiz
I
was
able
to
score
zero
points
in
both
of
them.
A
Well,
yeah,
so
just
like
I
may
actually
be.
The
one
has
new
questions,
as
you
know,
go
talk
all
right,
so,
basically
the
what
I'm
going
to
be
talking
about
is
the
official
rust
wisdom
tutorial
I'm,
not
gonna,
be
going
too
much
into
details.
I
just
want
to
give
kind
of
an
overview
of
the
state
of
the
art
of
rusting.
A
Wasn't
currently
we're
just
kind
of
looking
at
the
tools
and
seen
like
how,
like
things
fit
together,
if
you
interested
like
definitely
do
look
it
up,
it's
pretty
nice
and
for
those
who
of
you
who
are
not
from
you
with
the
game
of
life
redact.
The
ldr
is
that
it's
a
zero
player
summation
game
where
you
have
a
universe
that
evolves
with
time
and
we're
like
cells
a
better
alive,
and
then
they
the
inverse
like
evolves
by
like
calculating
the
next
set
of
the
stairs
based
on
the
previous
set
of
the
cells.
A
So
pretty
simple
set
of
rules
here.
So
it
looks
like
this
I.
Don't
know
why
sex
so
laggy
on
this
gif,
but
hopefully
won't
be
that
lucky
on
the
actual
game
of
life,
and
so
the
the
roads
are
pretty
basically
like
only
like
four
rows
to
the
game.
So
here
a
dead
cell
is
white,
a
live
set
is
gray,
so
if
a
cell
is
alive
and
has
less
than
two
neighbors
that
are
life
that
dies
in
the
next
generation,
if
it
has
two
or
three
that
are
alive,
that
sets
chips
stays
alive.
A
If
there's
more
than
three
cells
that
cell
dies
and
if
that
cell
is
dead
and
there's
like
exactly
three,
a
neighbors
are
alive
that
becomes
alive
in
every
other
case.
The
cell
keeps
the
same
state
okay.
So
what
is
webassembly?
Why
should
we
care
about
web
sembly
in
the
first
place,
so
here's
the
Wikipedia
definition
of
webassembly,
so
it's
a
binary
instruction
format
for
psych
based
VM.
A
It's
quite
interesting
to
see
that
there's
nothing
really
web
specific
about
web
assembly
for
now,
like
it's
only
shipped
in
major
web
browsers,
but
in
the
future
like
we
can
think
of
having
that
be
I
mean
other
places
as
well.
So
it's
designed
to
be
like
a
target
for
high-level
languages
like
C,
C++
and
rust.
A
As
a
JavaScript
engineer
myself,
like
it's
kind
of
fun
when
I
see
the
word
high
level
and
C
C++
in
the
same
sentence
but
sure
and
weighting
principles
was
that
it
was
first
announced
like
four
years
ago,
but
now
all
major
browsers
support
it.
So
unless
you
still
work
with
ie
in
some
way
or
another,
you
can
ship
well
assembly
to
production
and
there's
actually
a
few
companies
who,
like
already
next
ship
enough
of
assembly
to
production,
and
so
why
rust
so
I
took
this
screen
from
the
official
process
of
assembly
website.
A
Second
of
all,
the
zero
subtraction
is
pretty
cool,
like
you
have
really
nice
ergonomics
to
the
language
and
then
I
think
like
third
of
all
is
the
community.
So
it's
basically
all
of
you
here.
It's
a
very
friendly
welcoming
community
that
we
have
in
rust
and
it's
quite
impressive
to
see
how
Russ
is
able
to
fit
the
racially
diverse
crowd.
Like
you
have
people
like
coming
from
like
why
I
mean
webassembly,
you
have
people
doing
like
embedded
programming,
people
doing
existing
programming.
A
A
This
is
when,
like
everything
breaks,
usually
so
oh
yeah,
so
welcome
to
obvious
code.
So
basically,
here
we
have
basic
setup
for
resume
assembly.
So
what
I'm,
mostly
using
here,
is
going
to
be
a
wesen
pack,
which
is
a
wrapper
around
web
pack,
which
allowed
to
do
a
bunch
of
stuff,
but
what
we're
going
to
be
using
it
for
is
basically
just
to
build
brass
into
of
assembly.
I
think
we
have
like
the
observer
here
running,
which
will
just
like
serve
whichever
we
like
fitting
into
a
to
to
a
browser.
Okay.
A
So
if
you
basically
just
take
the
the
sample
code
from
the
tutorial
like
this
is
what
you
get
pretty
much
in
Russ,
just
like
a
simple
public
greet
function,
that's
gonna
be
like
surface
into
a
web
assembly.
Webassembly
wasn't
back,
then
that
compels
it,
and
that
creates
kind
of
this
wrapper
in
JavaScript.
That
allows
us
to
like
imported
into
our
JavaScript
code,
and
then
it
does
also
gave
us
a
nice
web
assembly
file.
A
So
it's
a
binary
file
like
this
is
the
text
format
of
webassembly.
It
uses
s
expressions,
so
that's
pretty
cool
looks
like
Lisp,
but
we're
not
going
to
be
like
looking
too
much
into
this,
and
so
what
we're
gonna
do
here
in
our
index
is.
Is
that
we're
going
to
import
wisdom
from
was
in
game
of
life?
So
this
is
just
like
doing
like
any
input
into
a
strip
nowadays,
and
then
we
just
gonna
call
like
the
grid
function
with
a
game
of
life,
which
would
then
alert
hello
game
of
life.
A
Thank
you.
That's
all!
That's
all
for
tonight,
goodbye,
oh
yeah
cool!
So
and
it's
actually
like
start
like
looking
at
implementation,
so
I'm
gonna
do
a
pretty
nice
mix
of
let
coding
and
time
traveling.
It's
called
get
tags,
so
I'm
gonna
be
like
checking
up
tags
along
the
way.
So,
let's
start
with
this
one,
what
we're
gonna
this
so
basically
what
I?
What
I've
done
here
is
that
I
just
implemented
the
game
of
life
using
rust,
so
I
don't
want
to
like
go
too
much
into
details
into
this.
It's
just
like
pretty
straight
for
us.
A
So
rust.
You
have
like
an
enum
for
the
cell
that
can
be
the
dead
or
alive.
Then
you
have
a
struct
for
the
universe,
wizard
with
the
hive
and
then
a
vector
of
cells.
Then
there's
a
few
functions.
The
pokey
matters
on
the
universe,
to
count
the
number
of
life
neighbors
and
to
get
indexed.
So
this
is
useful
because
we
are
storing
the
universe
in
linear
memory.
So
it's
just
like.
Oh
I
want
the
mission
array
and
we
have
like
a
two
dimension
universe.
A
We're
gonna
have
like
a
loop
that
would
like
run
on
every
like
animation
frame,
we're
gonna
call
the
tick
function
on
universe
and
then
we're
gonna
like
plug
in
all
of
the
string
that
comes
out
of
the
University
into
a
pre
HTML
tag
sounds
pretty
efficient.
It
is
pretty
efficient,
but
this
block
anyway
yay.
A
So
now
we
have
cells
here,
cool,
so
yeah.
You
might
be
thinking
like
this,
pretty
like
better
ways
to
communicate
between
webassembly
and
JavaScript,
then
like
just
passing
strings
around
and
you're,
probably
right
here.
The
good
thing
is
that
JavaScript
has
access
to
the
same
exact
memory
as
webassembly,
so
we
can,
from
the
directive,
read
all
of
those
cells
directly
instead
of
relying
on
the
universe,
passing
up
a
string
or
not.
A
So
let's
again
do
the
magic
of
get
tags
to
implement
that.
So
here
on
the
on
the
universe,
we
haven't
changed
much.
The
main
change
that
we
have
are
those
like
three
setters
getter,
sorry,
so
we
can
get
the
width,
the
height
and
then
a
pointer
to
the
cells
vector
from
rust
and
then
on
the
JavaScript.
A
We
also
like
change
a
bit
implementation
here,
we're
now
using
a
canvas
instead
of
a
pre
HTML
tag,
so
I
mean
this
is
just
like
very
canvas
kind
of
API
thing,
so
this
just
chose
to
create,
and
then
this
would
just
draw
the
cells.
Then
the
important
thing
here
is
that
are
we
getting
the
sales
pointer
from
the
universe?
And
then
we
like
creating
array
buffer
here?
That
would
then
point
to
that
times:
a
responder
and
then
read
every
single
cell
here
for
the
whole
universe.
A
Then
just
will
loop
through
it
and
then
you
just
like
show
all
the
cells
here.
So
if
we
look
at
the
result
now,
okay,
you
two
probably
compiled
webassembly.
First
up
okay,
so
that's
that's
what
we
get
now
our
universe,
64
by
64
with
like
cells,
moving
around
dying
and
living
a
few
letters
here
and
there
yeah.
A
So
as
you
can
notice
as
well
like
the
universe
is
infinite.
So
that
means
that,
like
whenever
it
goes
to
the
body
like
it
wraps
around
the
universe,
okay,
cool,
so
I,
guess
so
far,
so
good,
the
most
important
interesting
part
here,
oh
I,
guess
I-
can
quickly
show
some
thing
else.
We
can
also
like
add
interactivity,
meaning
that
we
can
not
only
read
from
that
memory,
but
also
a
kind
of
back
talk
back
to
the
webOS
m12
assembly.
A
So
here
whatever
it
is
a
pause
button
and
you
can
now
actually
draw
on
the
canvas
as
well.
So
I
can
make
a
nice
glass
over
here,
yay,
okay,
cool,
so
I!
Guess
you
can't
do
a
lot
of
things
involve
assembly.
Does
it
make
sense
to
rewrite
everything
with
assembly?
Probably
not,
and
if
you
actually
are
looking
into
whether
someplace,
probably
because
of
some
like
heavily
computational
stuff,
that
you
want
to
be
more
performant
with.
A
So
let's
have
a
look
now
at
how
we
can
measure
performance
and
see
if
this
is
the
most
efficient
way
of
doing
it
and
how
we
can
improve
on
its
implementation,
because
it's
not
it's
also
efficient,
as
as
it
is
now
okay.
So
what
we're
going
to
do
very
quick
is
that
we're
just
gonna
add
like
an
FPS
counter.
So
again,
this
is
just
like
JavaScript.
We
measured
the
number
of
frame
per
seconds
and
we
just
like
display
it
on
the
counter.
A
Okay,
let's
see
what
happens
if,
for
example,
we
double
the
size
of
the
universe,
if
I
can
find
the
code
here,
can
I
stop
all
the
size
rebuild
and
now,
okay,
it's
not
still
not
too
bad,
but
we
like
at
40
40
frames
per
second.
So
it's
quite
quite
a
deep
here.
So
try,
let's
see
like
what
happened
here.
I
guess
the
the
intuition
is
probably
that,
like
somewhere,
like
in
the
right
implementation,
where
they're
doing
some
things
are
not
so
efficient,
but
it's
always
good
to
look
at
actual
numbers
to
drive
performance.
A
So,
let's
check
out
the
next
part,
so
to
do
that.
What
we
gonna
do
is
we're
gonna,
add
back
a
timer,
so
here
we
can
now
create
a
new
timer
here,
a
new
stroud
which
just
calls
a
console
that
time
big
you
claim
and
we
can
attain
a
very
specific
part
of
the
code,
we're
gonna
time
the
tick,
because
our
intuition,
like
previous,
tells
us
that,
like
the
tick,
is
the
slow
part
of
our
implementation
here.
A
Okay,
so
let's
open
the
browser
here,
let's
run
performance
recording
and
so
what
we're
going
to
be
looking
at
here
is
requestanimationframe,
so
like
every
one
of
those
things
of
those
yellow
things
is
one
one
update
on
the
universe.
Basically,
and
so,
if
you
look
into
here,
we
see
that
here's
our
universe
stick
so
here's
our
timer.
We
see
that
it's
actually
quite
negligible
compared
to
like
the
whole
time
that
we're
spending
we
rendering
the
universe.
A
So
let's
dig
it
up
a
bit.
So
if
you
open
the
GS
flame
chart,
you
can
see
that
most
of
the
time
is
actually
spent
in
the
draw
sales
function
and,
in
particular,
in
the
field
style
setter
on
the
campus.
We
can
again
like
have
a
look
here
and
see
that
actually
actually
spending
57
percent
of
our
time
in
the
field
style
set
around
the
canvas
so
surprise,
surprise,
is
not
right.
The
problem
is
JavaScript.
A
You
can
actually
use
some
of
your
the
native
tools
to
look
at
the
performance
of
awesome.
I'm
not
gonna,
be
showing
it
now,
because
I
haven't
figured
how
to
do
it
yet,
but
like
it's
definitely
possible,
and
yet
there's
not
really
like
a
source
map
for
for
wisdom.
So
you,
whenever,
like
you
build,
was
immune
up
with
like
two
types
of
file
you
do
not.
Dot
was
in
place
which
are
binary
files
and
then
dot
what
files
which
are
text-based
by,
which
is
what
I
kind
of
showed
previously
yeah.
A
Oh
thanks,
oh
yeah,
so
like
this
is
literally
like
where
we
spending
fifty
seven
percent
of
our
time
like
in
the
whole
like
application
like
this
is
the
place
were
like.
We
are
really
like
getting
neck
stuck
and
good
thing.
Is
that
this
cotton-
easy
solution
to
this?
So
basically,
instead
of
assigning
a
color
on
every
single
cell,
iteration
I
think
he
agrees
with
me
that,
like
he
doesn't.
A
Yes,
instead
of
doing
that,
like
on
every
single,
like
cell
iteration,
what
we
can
do
is
move
this
outside
of
the
loop
and
so
that's
what
we're
gonna
be
doing
right
away.
It's
things
up
and
yeah
I
mean
the
then
change
we've
done
here
is
that
we
move
the
style
field
side
outside
of
the
loops,
so
we
like
setting
it
to
like
a
light
color
first
and
we
like
looping
over
the
whole
universe
and
only
setting
the
live
cells
and
then
we're
doing
the
same
thing
with
the
dead
cells
here.
A
So,
let's
see
if
this
actually
solve
our
issue,
let's
review
this
come
back
here
to
defy
do
again
like
yeah,
we
back
at
like
60
around
60
frames
per
second
cool.
Okay.
Let's
try
to
back
stretch
this
a
bit
more.
Instead
of
doing
like
one
tick
per
render
loop.
Let's
try
to
do
a
lot
more
than
that.
Let's
see,
let's
try
to
do
nine,
ticks
per
per
loop
and
see
what
happens
next.
A
A
So,
let's
add
a
few
more
timers
around
so
like
this
is
the
timer
we
had
previously
for
the
universe
stick.
But
now
we
add
in
a
timer
for
the
allocation
of
new
cells,
a
timer
for
the
generation
of
the
next
cell
and
then
a
timer
for
the
the
allocation
of
cells.
I
guess
like
if
you're
a
seasoned,
rust
developer.
This
is
a
bit
of
a
smell,
so
you're
like
okay,
maybe
like
we
can
do
it
in
the
better
way
without
using
clone
here.
But
let's
see
like
where
is
the
extra
bottleneck
here?
A
So
let
me
build
again
then
we're
going
to
do
the
same
performance
recording
tool
here
up
a
few
generations.
So
let's
look
so
you
can
see
that
now,
like
in
the
single
frame.
We
have
like
a
bunch
of
things
because
we
like
doing
like
before
look
here
and
if
you
look
closer,
let's
zoom
in
closer
a
bit-
oh
yeah,
so
you
can
see
that
surprisingly
allocating
new
cells
and
free
new
old
cells,
it's
actually
not
that
expensive
still
and
that
most
of
the
time
is
spent
in
the
new
generation
implementation.
A
And
to
answer
your
question:
that's
actually
where
you
would
be
using
magnetic
tools
to
kind
of
try
to
see
exactly
what's
happening
at
the
bottom
level
and
see
like
where
the
bottleneck
is
I'll.
Do
a
chilled
er
here.
So
the
bottleneck
is
actually
in
our
implementation
of
the
live
cell
counter,
in
particular
using
the
modulo
operator.
Here,
it's
actually
very
expensive
when
we
like
wrapping
around
the
edges
of
the
universe.
A
Again.
Luckily,
for
us,
there's
actually
a
very,
very
simple
solution
so,
instead
of
using
like
the
module
of
where
we
can,
we
just
like
use
a
wall
of
ifs
and
just
like
take
every
single
like
possibility
to
account
like
if
you're
like
on
the
top
row,
like
we
look
at
the
bottom
row.
If
you
look
at
the
top
row
and
I
same
on
the
sides
as
well,
and
this
pretty
much
fixes
it,
so
if
you
go
back
here.
A
Okay,
go
back
here.
We
can
see
that
we
are
okay,
kind
of
around
60
frames
per
second
again,
and
some
of
the
good.
Some
of
the
tuning
run
like
rust,
allows
us
where
to
electron
benchmarks.
So
I'm
not
gonna,
show
that
now,
but
I
did
run
benchmarks
at
home
before
and
after
here,
and
what
we
can
do
is
we
can
just
use
bench
compare
and
then
we
just
compare
before
and
after-
and
we
can
see
here
that,
like
the
new
implementation
is
eight
times
faster
than
the
old
implementation.
A
Okay,
so
that's
that's
pretty
much.
What
I
have
I
also
want
to
like
kind
of
give
a
shout
out
to
the
tooling
around
Wiseman
grassed
I,
don't
know
how
mature
it
is
considering
the
in
diverse
community,
but
again
as
a
JavaScript
developer.
It
takes
me
like
one
week
to
choose
a
front-end
framework
and
configure
web
pack,
so
anything
less
than
that
is
very
much
it
for
me.
A
So
yeah.
Definitely
if
you're
like
interesting
in
this
definitely
have
a
look
at
the
official
official
tutorial.
It's
pretty
free
goes
like
into
more
details
to
what
I
put
in
here.
Okay,
that's
what
I
have,
hopefully
you've
learned
at
least
one
thing
out
of
this-
maybe
yeah.
Thank
you
very
much.
If
you
want
to
dive
more
into
this,
like
to
hear
a
few
links
that
you
can
check
and
I'm
open
for
questions.
B
A
A
We're
kind
of
Supriya
old-school
code
base
we
Salaam
angularjs,
but
moving
into
view
yeah.
That's
what
we
like
playing
to
do.
I,
don't
think
that,
like
wisdom,
makes
sense
in
most
cases,
I
think
like
it
doesn't
make
sense
when
you
have
like
a
really
like
heavily
computational
part
of
the
application
running
on
the
browser
which,
for
like
most
applications
in
a
way,
is
not
really
the
case.
I
think
the
best
example
I
can
give
here
is
a
sigma
which
is
collaborative
design
tool.
A
Okay,
like
this
part,
can
be
really
bringing
in
awesome
and
then
easily
plugged
into
whichever
needs
to
be
plugged
into
it
too,
to
jump
on
the
react
part
of
your
question.
It's
go
interesting
because
someone
took
the
time
to
kind
of
rewrite
the
virtual
Dom
using
Muslim
and,
it's
surprisingly
not
so
much
faster.
It's
it
is
definite
faster,
but
not
at
the
point
where
it
makes
sense
to
rewrite
everything
in
a
webassembly.
A
What
were
the
pain
points?
It
was
surprisingly,
very
easy,
not
to
be
honest,
I
mean,
except
for
the
fact
that
I'm
not
like
a
well
versed
like
rust
programmer
so
like
sometimes
like
looking
at
syntax
and
accessing
like
how
how
things
are
plugged
together
but
again,
like
the
tuning
I,
was
able
to
like
get
everything
in
Sun
in
like
five
minutes,
it
works
out
of
the
box.
I
had
to
like
really
like
debug
anything.
A
A
That's
a
good
question.
I
think
like
there's
a
breeding
effort
to
like
rewrite
most
of
the
Dom
API
is
using
rust
and
like
shipping,
adding
webassembly
I'm,
not
sure.
Yet,
if
the
benchmarks
aren't
really
like
favorable
to
that
in
the
sense
that
does
it
make
sense
to
rewrite
like
a
bunch
of
code
like
to
rust,
if
it's
still
like
allowing
you
to
have
like
60
frames
per
second
and
I.
Think
the
point
here
is
that
you
don't
have
to
rush
to
like
the
most
performant
solution.