►
From YouTube: Rust Lang Meetup - January 2019
Description
No description was provided for this meeting.
If this is YOUR meeting, an easy way to fix this is to add a description to your video, wherever mtngs.io found it (probably YouTube).
A
A
So
I
said:
oh,
what
is
a
closure,
so
it's
a
function
that
can
directly
use
variable
from
the
scope
in
which
it
is
defined
so
usually
in
most
programming
language.
Closure
is
associated
with
like
lambda
as
in
Python
or
like
an
anonymous
function,
but
those
two
are
not
really
exactly
the
same.
So
closure
is
like
an
environment
that
basically
captures
all
the
variable
from
the
scope,
which
is
just
define
love
basically,
so
this
is
an
example
from
Russ.
A
Okay,
cool,
okay,
so
some
some
some
terms.
So
here
we
have
I
mean
this
is
how
we
define
closure
in
reps.
So
we
have
like
my
closure
and
then
you
get
like
like
a
double
pipe
double
pipe
here,
because
there's
no
input
basically
and
then
we
call
a
function
like
do
something,
and
we
pass
a
reference
of
text
here
and
then
seeing
this
variable
is
not
since
this
variable.
Basically,
the
the
scope
of
the
variable
is
from
from
the
outside
of
the
culture.
A
So
here
we
have
a
closure
that
is
written
with,
with
with
a
language
with
GC
garbage
collector
language.
Basically,
so
we
have
a
function
main
that
basically
create
a
function
that
at
one
to
a
given
number,
so
we
give
it
a
five,
and
then
it
returns
a
function
that
basically
at
one
to
the
to
the
to
the
number
that
we
pass
in
and
that
we
get
back
the
result
here
and
I
will
print
it.
A
So
this
was
fine
in
any
language
with
GC,
but
what
if
we
were
to
rewrite
this
in
Rus,
so
we
have
this
function
written
in
Rush
and
you
see
my
first
is
like
the
there's:
no,
no,
really
a
problem.
So
if
we
try
to
compile
it,
then
we
have
that
it
says:
I
mean
like
it
cannot
compare.
Then
it
gives
you
like
a
like
a
cryptic
error.
If
you're
not
familiar
with
rush
that
closure
may
out
leaf,
Deacon
function
equals
1.
What
does
it
mean
so.
A
B
A
A
B
A
So
we
run
the
first
line,
which
is
5,
and
then
we
elope
we
allocate
5,
basically
like
a
object
representation,
for
example,
piping,
basically
present
5
as
an
object
in
the
internship
and
then
in
the
stack
frame.
We
have
0.25
that
basically
point
to
the
to
the
heap
and
then
we
go
to
the
next
line
and
then
we
run
the
add
one
function
which
basically
do
the
same
thing
allocate
one
to
the
heap
and
then
a
pointer
from
one
to
the
hip.
A
Now,
let's
see
from
the,
we
have
a
function
that
basically
create
a
closure
that
do
the
same
thing,
but
instead
of
doing
it
directly,
we
written
a
function.
So
it's
a
non
is
written
and
anonymous
function,
which
also
closure,
because
it
reference
1
here
inside
the
written
anonymous
function.
So
we
run
it
again.
A
A
Yeah,
it's
not
really
a
function
is
just
like
a
representation.
This
is
just
a
high
level
how
just
how
language
with
GC
works,
so
here
it'd
be.
Closure
basically
has
to
reference
to
one,
because
we
have
one
here
that
still
need
to
be
reference
here.
Okay,
here
what
happens
is
that
it
depends
on
the
programming
language
yourself.
So,
for
example,
like
Python
do
like
a
reference
code,
so
like
one
so
the
garbage
collector
will
watch
the
the
heap
basically
and
then
it
will
collect
all
the
audio
reference
count
that
hit
zero.
A
Basically,
but
one
reference
count
is
not
0,
because
Catholic
basically
still
pointing
to
one
so
basically,
there's
still
a
reference
that
using
1
and,
for
example,
like
language
like
JavaScript.
Instead
of
like
deleting
the
stack
frame,
this
type
frame
basically
get
Undine,
we
get
it
gets
unlink
and
but
it
doesn't
get
drifted
from
the
memory
somewhere
in
the
memory.
So
when
we
need
to
run
the
catholic
closure,
it
still
can
refer
to
this
frame
that
what
happens
so
now.
A
The
problem
with
russ
is
that
Russ
doesn't
have
a
GC,
so
there
is
no
way
for
us
to
actually
knows
that
one
is
still
needed.
So
if
we
were
to
like
delete
the
stack
frame
here-
and
we
probably
would
also
be
deleting
the
heap
and
then
the
closure
is
pointing
to
the
cabbage
movie-
you
know
here
because
one
is
no
longer
there.
A
A
So
first
we
have
the
depends
on
the
tray.
So
let's
say,
for
example,
don't
know
relate
to
it.
I
mean
like
a
primitive
type.
Basically
that
yeah
the
ins,
the
pool
and
everything
that
can
be
I
mean
I,
all
the
really
small
types
yeah.
So
and
then,
let's
say,
if
you
wanna,
if
you
wanna
look
at
something
to
the
heap,
we
can
actually
do
like
box
it
using
like
box,
or
we
can
create
like
a
like
a
pointer
to
the
the
object.
A
We
can
use
a
lot
of
things
like
things
like
our
see
things
like
mostly
people
use
like
blocks
to
basically
like
put
into
the
heap,
and
then
we
get
we
get
a
pointer
to
the
to
the
heat
from
the
stack.
So,
for
example,
here
we
have
by
default,
is
ball
roll
and
then
this
of
course
doesn't
work,
because
when
this
one
goes
out
of
school,
when
we,
this
closure,
basically
burrows
a
reference
to
one
and
then
the
compiler
is
smart
enough
to
know
that
one
lifetimes
is
bit
obvious.
A
Cool
of
the
ones
is
basically
shorter
than
the
scope
of
the
then
the
closure
itself.
That's
why
you
get
as
well.
You
get
this
error
saying
that
the
closure
may
elliptical
function,
but
it
borrows
one.
So
that's
how
you
represent,
because
disclosure
basically
Boris
one
and
then
you
were
saying
that
closure
may
outlive
the
current
function,
because
one
doesn't
live
long
enough
compared
to
the
one
no
you
can
compile.
This
is
compile
error.
Basically,
so.
A
Because
we
cannot
borrow,
then
we
can
actually
move
the
developer,
basically
the
ownership
of
the
variable.
So
once
we
do
that
so
one
here,
we
basically
you
can
call
it
like
live
inside
the
is
being
owned
by
the
coach
itself,
because
we
move
the
ownership
of
the
of
the
variable
into
the
closure
itself.
So
this
one
compile
so
how
we
do
this
in
Rus.
So
what
was
a
nice
thing
for
us?
Is
that
sometimes
the
help
here?
Is
that
really
helpful?
B
A
So
we
go
back
here
to
the
code,
the
same
point
and
then
closure,
basically
is
represented
as
anonymous
and
unique
strut
in
red.
So
basically,
what
is
being
done
or
what's
being
the
sugar
is,
as
you
have
like
a
struck
anonymous
closure
I
mean
this
truck,
doesn't
really
have
a
name.
I
mean
the
nib
is
internal
to
the
compiler.
This
is
just
how
we
understand
it,
and
then
we
have
like
one,
which
is
the
which
is
of
type
reference,
because
by
default
the
closure
borrows
the
whatever
the
capture
variable.
B
A
B
B
A
A
C
A
A
A
B
A
So
in
so,
the
diagram
here
shows
that
we
have
like
all
these
circles
right,
so
this
circle
is
basically
the
constrain.
So
if
you
were
to
implement
the
trade
FM
you,
you
must
also
implement
the
trade
FN
one.
If
you
were
to
implement
the
trade
FN,
then
you
have
to
also
implement
FM?
U
which
in
turn
you
must
also
implement
at
anyone's
right.
A
So
how
much
determines
the
trick
to
implement.
So,
first
of
all,
it
checks
whether
the
weather,
if
we
move
the
captured
variable,
if
you
ask
that
it
only
implement
F
and
once
only
the
keywords
here,
is
only
because
if
you
implement
FN
once
you
cannot
call
the
closure
multiple
time,
you
can
only
call
it
once
because
of
because
the
capture
variable
has
already
been
more.
If
you
call
it
for
the
second
time,
then
we
are
basically
referencing
yeah,
something
that
doesn't
exist
anymore
so
that
to
the
compile
it
doesn't
allow
that.
So,
if
no.
B
A
A
A
Because
when
we,
when
we
want
to
implement
fmu,
there's
a
constraint
that
you
must
also
implement
FN
once
so,
basically
FN
every
collision
must
implement
happen
once
so.
Basically,
that's
it,
but
if
the
capture
variable
Y
at
mass.
So
if,
if
we
move
the
captured
variable,
it
can
only
implement
FN
once
and
okay.
So
we
are
basically
at
this
branch.
Just
now.
A
A
Yeah,
basically
so,
oh
before
that,
so
now,
if
you
see
here
now,
you
can
actually
see
why
this
is
this
doesn't
compile,
because
you
see
that
here
we
have
like
a
Stratton
enclosure
and
then
we
are
referencing
one,
a
variable
one
from
the
from
the
top
line
here
and
when
we
give
back
the
ID
when
we
return
back
the
closure
and
enclosure.
Here
we
actually
referencing
a
local
variable
one,
because
that's
why
it
doesn't
compile,
because
by
the
time
this
function
returned
this
one
is
already
going
because
you
had
written
in
reference.
But
what?
If?
A
A
A
A
A
A
D
A
A
A
So
basically
it's
the
Russ
Russ
intermediate
representation,
so
this
was
developed
because
in
order
to
support
incremental
compilation,
who
knows
so,
the
bill
Emma
are
to
basically
support
D
if
I,
if
I
recall
correctly.
So
here
what
I
have
so.
We
have
some
closure
here
and
then
we
have
some
numb
and
then,
when
we,
when
we
compile,
we
can
actually
just
confined
playground
to
human,
but.
A
A
B
A
B
A
B
B
B
A
A
B
B
A
A
B
A
We
can
say
that
mismatch
type
I
expected
that
unit,
because
I
put
Union
I
I
put
it
I,
put
it
intentionally.
So
we
can
throw
this
error
and
then
you
say,
found
I
32,
but
what's
going
on
here
right
because
because
some
num
to
be
a
reference
and
then
even
in
the
MRI
put,
is
actually
a
reference,
but
why?
A
But
why
is
it
ITP
2?
So
this
is
plus
doing
its
magic
lab
recipe.
So
if
you
look
back
at
the
MIR
output
here
so
here
we
have
some
num,
which
is
basically
have
a
so
legging,
also
no
reference
to
ITT
2
and
then,
if
we
see
here
under
Scott
to
basically
refers
to
X,
how
do
I
know
that,
because
this
line
mean
rs5
so
underscore
one
basically
refers
to
be
closure
right.
So
this
closure
is
basically
reference
reference
to
the
closure.
A
A
Think
I
think
it
just
make
it
just
missed
me
consistently,
basically
I
think
so
it
so
because
if
you
have
here
some
type
on
the
solitary,
so
let's
see,
if
you
have
the
type
here
s,
si
32,
then
suddenly,
if
you
assign
it
to
accidentally,
become
ref,
then
is
kind
of
inconsistent
in
how
you
want
to
how
you
want
to
think
about.
How
do
you
want
a
reason
about
your
coin
right,
so
I
think
probably
this
decision
of
it
I
don't
want.
Is
that
that's
just
my
speculation.
B
A
B
A
So
so,
because
when
you,
when
you
create
a
closure,
basically
it
creates
truck
for
you
and
not
anonymous
struck.
That
is
unique.
So
even
if
you
write
the
same
closure,
a
closure
like
X
plus
one
you
do
like
X
is
equal
to
some
closure.
X
plus
one,
and
then
you
do
like
Y
is
equal
to
some
closure.
X
plus
one
in
the
body
is
the
same
thing
right,
but
if
you
try
to
compare
x
and
y,
it's
actually
a
two
different
closure.
A
B
B
A
I
think
this
I
think
you
understanding.
This
in
Russia
is
actually
quite
important,
because
sometimes
you
have
especially
when
you
want
to
understand
the
three
types
of
trade,
because
some
function
expect
when
some
function
basically
picks
closure
as
a
human
and
then
some
time
they
take
it,
be
constrained
it
into
like
FN
once
so.
If
you
I
mean
everyone
walks
lot,
because
everything
every
culture,
implementation
ones
so
I
say,
for
example,
your
closure
I
said
I
fan,
and
then
we
have.
Then
you
are
sending
my
FN,
then
probably
doesn't.
A
A
B
D
C
D
B
B
C
B
C
D
Okay,
here
you
have
zero
cost
extraction,
the
rest
where
most
of
the
things
are
done
at
compile
time.
So,
like
the
crates,
when
you
do
size
of
like
a
strap
yeah,
no,
you
have
no
cost.
When
you
try
in
a
coat
you
do
size
of
the
mem.
That's
a
something
to
do.
Rem
cycle,
like
your
strap,
there's
no
value
unless
it's
a
boxer,
then
yeah
some
cost
or
crits,
and
then
no
garbage
collector,
so
I
think
he's
fake.
Okay
and
the
last
one
say
you
don't
get
this
thing
anymore,
anytime
and
p.m.
B
B
D
B
D
Every
propagating
my
libraries
like
the
area
library,
is
called
failure.
Yeah.
Those
bad
really
did
something,
not
that
good
I
heard
I
heard.
Okay,
here's
a
quote
in
theory:
it
would
be
entirely
reasonable
to
guess
that
most
respect
would
need
a
no
need
to
use
a
significant
amount
of
unsafe
code
to
escape
the
limitations
of
the
protocol.
However,
in
practice
it
turns
out,
okay,
that
the
overwhelming
majority
of
programs
can
be
implemented
but
Nero
using
only
safer.
My
visa.
B
D
C
B
D
Yes,
no,
no,
the
nuclear
is
nuclear,
yeah,
okay,
Steve
say
99
the
nuclear,
and
so
it
means
that
that's
like
two.
D
It's
bad
for
that
bridge,
but
then,
like
some,
some
interesting
I'd
be
like
stood
the
simulation
and
the
serum
of
a
very
popular
one
in
rust.
That's
right,
laughs,
I
have
a
long,
unsafe,
aiyla
that
reduce
I'm
sure
like
many
more
but
then
still
using
the
second
open.
There's
like
no
performance,
in
fact,
they're
just
writing
in
a
different
a
bit
different
way.
Okay,.
D
B
B
D
B
D
A
C
D
B
B
B
B
B
B
C
D
Okay,
so
we're
assembly
the
introduction,
it's
a
binary
format
and
it's
compact
use
for
the
web.
He
just
the
one
of
the
aim
is
like
it's
faster
and
I
brought
us
can
use
it
because
you
can
do
the
optimization
before
you're
running
before
running.
So
the
browser
have
the
I
think
Moe
did
I,
have
a
good
right
upper
body
on
yeah.
Why
we
assembly
and
then
how
the
passing
works
and
then
optimization
how
it
can
be
shown.
D
D
D
B
B
B
D
B
D
A
C
D
B
B
D
B
D
D
You
cannot
just
use
like
JavaScript.
You
need
to
format.
It
me
frost.
This
is
one
of
the
downside
law
right
now.
You
need
for
many
transfers
as
a
whole
string
and
then
by
the
binder.
We
do
all
the
magic
behind
and
make
it
quite
uncomfortable.
So
this
some
this
hello
world
in
what
am
I
doing
using
using
my
don't
mind
you,
okay,
they're,
ready,
showing
them
anyway,
how
they
do
we.
D
D
B
D
But
this
way
architecture
is
almond,
I,
said
architecture.
The
Triplett
cure
sounds
this
way
can
run
anywhere.
Okay.
So
basically,
what?
After
what
you
do
with
binary,
is
somewhere
around
here
and
then
you
need
to
write
the
JavaScript
manually
and
then
you
will
need
to
write
the
initiate
streaming,
the
versa
meeting,
initializer
module,
and
then
you
can
only
use
a
person
be
okay,.
B
D
D
Things
quite
big,
but
you
need
to
manually
trick
something
to
optimize
it
for
now
and
then
okay,
what
makes
it
easy
then
they
introduced
was
impact
is
really
helpful
around
the
atom
that
was
away
so
it's
helper
to
that's
what
they
say:
pack
and
publisher
with
them,
so
their
support
for
Bowser
and
nodejs
model
book.
Yeah
I
found
this
very
weird
like
this
year
that
this
their
target
is
an
open
issue.
They
already
know.
B
B
D
Not
again
we're
one
of
them
right
now
right
now,
so
if
you
want
where
browser
library
and
you
need
any
no
jailbreak,
you
did
Beauty
separately,
but
the
question
is
the
same,
but
just
the
command
to
view
it's
a
bit
different
if
they
want
to
quickly
show
that
the
library
that
you
generate
can
support
both
browser
and
not
just
so,
and
then
with
this,
you
have
less
in
empower
like
ever
handling
for
bay.
You
can
I,
don't
think
you
can
use
a
result.
D
You
return
a
result
string
and
then
we
aerial
shot
before
structure
for
error.
So
you
can
do
that.
You
have
like
less
use
of
the
rust
rust
way
to
do
error
handling
like
the
callbacks
propagating
areas.
You
know
azuma
for
javascript
plans,
and
one
of
the
nice
thing
is
therefore
very
simple,
API
food
using
prop
macro
like
just
now.
You
see
this
wasn't
binding.
D
B
D
We
sure
need
to
replace
the
performance
and
stick
part,
but
you
can
really
invariably,
like
you
want
some
parts
to
butane
run
somehow
story
thing
about
them.
They
want
to
make
it
very,
very
easy
for
you
to
do
that,
so
they
Friday.
This
was
in
pack,
you
just
rights
on
Rosco
and
then
you
just
publish
to
a
DM.
B
B
B
D
D
B
D
B
D
D
D
C
D
B
D
C
B
D
C
D
B
D
Okay,
so
I
change
it
to
2018.
The
foul
was
originally
just
it
made
this
pal
originally
just
this
and
I
split
it
into
a
library
as
well,
so
the
three
and
the
main
power.
So
this
is
library.
This
is
a
binary
file,
the
iran's
and
four,
and
to
make
it
into
water
I
need
in
binary,
so
I'm
I
put
it
binary.
D
D
B
B
B
B
B
B
D
B
B
D
B
B
C
C
D
D
D
D
C
B
B
B
B
D
B
D
D
B
B
B
B
D
B
B
D
B
D
B
D
Noticed
that,
because
just
now
all
we
do
is
just
not
just,
then
why
do
you
will
need
to
use
like?
What's
the
matter,
then
we
can
just
use
the
binding.
You
see,
there's
something
called
neon.
Okay.
This
is
another
examples.
This
is
on
is
more
powerful,
but
then
a
lot
more
complicated.
You
didn't
get
like
similar
Rosco.
You
need
to
write
like
a
function.
Context,
okay,
but
as
neon
is
like
rust,
a
lot
there's
bindings
for
us.
B
D
B
B
B
B
B
D
Table
is
not
oh,
I
saw
that
something
else.
I
need
to
that
new
girl.
Every
I
saw
what
was
the
main
thing
we
explore.
Some
garbage
collectors
are,
like
you
see
here,
it's
a
bit
different.
You
can
use
gesturing,
you
can
use
tear
to
object
here.
So
it's
not
really
me
the
normal
rascal
everything
you
need
to
sushi
like
JSON
ideas.
All.
B
D
Colleges
and
then
basically
expose
on
the
garbage
collector
cell
device
like
more
complicated
to
guess
that
that
is
just
like
getting
the
one
value
from
the
function
context,
which
is
capping
at
one
value
and
someone.
You
need
to
use
another
weird
thing
to
the
weather.
This
argument
is
string
or
integer
or
stuff,
so
it
is
more
complicated
by
then.
You
need
to
trick
your
laboratory.
My
ability
is
pasta,
maybe
is
not
compatible
bottom
and
like
didn't
even
write,
some
mini
yes,
cool.
D
B
B
D
D
B
D
Least
having
at
least
oh
okay,
the
tree
GG
ratio,
okay,
I
mean.