►
Description
PDXRust
More on http://www.meetup.com/PDXRust/events/232597522/
Help us caption & translate this video!
http://amara.org/v/2Fi0/
A
A
So
I
want
to
give
a
brief
overview.
First
of
what
corrode
is
and
what
is
not
and
I'd
like
you
to
hold
questions
while
I
do
that,
but
once
I've
gotten
through
that
will
have
an
intermission
I'd
like
to
welcome
any
questions
then,
and
throughout
the
rest
of
the
talk
at
that
point,
I
want
to
also
talk
about
testing
and
community
building,
so
so
what
does
Kuroda
do
corrode
is
a
tool
for
automatically
translating
see
source
programs
into
rust
source
code
in
the
process.
It's
a
it's
a
semantics,
preserving
translation!
A
A
About
those
things
so
semantics
preserving
I,
what
does
this
expression,
a
plus
B
in
a
sea
program,
actually
mean
anyone
want
to
throw
out
some.
A
So
edition
yeah
it
depends
on
the
types
that's
the
key
thing.
So,
for
example,
if
these
are
both
of
type
int,
then
it's
a
signed
integer
addition,
probably
30
to
bid
on
any
platform
you're
likely
to
be
working
with,
but
not
necessarily,
if
one
of,
if
either
A
or
B
is
a
pointer
and
the
other
one
is
an
integer
type.
Then
this
is
pointer,
arithmetic
over
the
other
cases.
There's.
C
A
A
I'll
I'll
give
it
a
little
bit
of
an
example
of
that
a
bit
later,
but
the
key
thing
is
that
the
road
goes
to
a
lot
of
trouble
to
make
sure
that
the
rust
that
it
generates
as
best
I
can
figure
anyway
matches
what
the
sea
specification
says.
You
know
it
does
exactly
the
same
thing
right
so
the
sea,
abstract
machine
specification
in
c99
or
c11
or
whatever,
whatever
version
of
the
sea
standard
you're
looking
at.
A
If
you
follow
the
directions
that
that
says
your
program
that
describes
if
you
follow
the
steps
that
the
abstract
machine
specification
says
your
program
should
go
through
and
and
look
at
the
generated
rust.
You
should
see
the
rust
going
through
those
same
steps
but
semantics.
Preserving,
isn't
actually
the
only
interesting
thing,
only
interesting
constraint,
I
imposed
on
what
I
wanted
kuro
to
do.
I
also
wanted
corrode
to
preserve
the
structure
of
the
source
program
as
much
as
possible,
and
that
turns
out
to
be
particularly
tricky.
A
A
So
if
you
want
to
try
and
try
and
transform
a
sea
program
that
has
go
tues
into
a
rust
program,
you're
probably
going
to
have
our
time
preserving
the
the
order
that
the
statements
were
in
in
your
in
your
original
see
source.
But
for
the
most
part
you
know,
there's
there's
a
lot
where
a
lot
of
overlap
between
sea
and
rust
and
that's
kind
of
deliberate
on
the
West
designers
part
right
that
that
it
should
be
familiar
to
C,
programmers
or
C++
programmers.
A
Even
when
it's
not
quite
the
same,
and
so
there's
there's
a
lot,
you
can
get
from
just
doing
kind
of
a
naive,
syntax
directed
well.
This
is
a
while
loop
and
see
so
I'm
going
to
construct
a
while
loop
here
and
rust,
or
an
if
statement
and
see
so
I'm
going
to
construct
an
if
statement
and
rust
things
like
that.
So
that's
that's.
A
We
have
to
convert
the.
We
have
the
three
turned
into
a
explicitly
typed
32-bit
integer,
but
then
that
has
to
get
cast
to
board.
I
used,
I
sighs
the
there's,
an
unsigned
32-bit
value
that
then
gets
truncated
by
casting
to
a
signed,
16-bit
value
and
then
gets
cast
again
to
widen
it
back
out
to
the
type
that
we're
trying
to
do
the
whole
computation
in
and
finally,
the
the
char
also
has
to
get
widened.
A
A
F
A
For
this
is
a
nice
simple,
rust
for
loop
using
a
range
expression,
it's
possible
that
I
haven't
off
by
one,
because
I
continue
getting
confused
about
how
r
strange
expressions
work,
but
it's
something
like
this
anyway.
Kuro
generates
this
crap.
A
So
it's
it's
directly
translating
what
you
asked
for,
not
what
you
meant
right.
It
doesn't
know
what
you
meant.
One
of
the
things
that
I
would
love
to
see
someone
may
become
do
is
as
follow
on.
Work
is
a
tool
that
recognizes
these
kinds
of
of
syntactic,
anti-patterns
and
and
tries
to
either
just
suggest,
fixes
or
or
automatically
apply
them
where,
where
it's
you
know
obvious
what
the
programmer
meant
as
a
relevant
piece
in
that
direction.
If
you've
been
working
with
rust
for
a
bit,
you've,
probably
seen
Clippy.
A
If
you
haven't
seen
Clippy,
you
need
to
check
it
out.
It
is
an
amazing
tool,
that's
full
of
full
of
all
sorts
of
advice
of
it'll.
You
know
analyze
your
source
code
and
tell
you
hey
here's
this
thing
you
did,
it
might
not
be
the
way
you
actually
wanted
to
do
it.
Here's
a
suggestion
about
how
to
fix
it.
A
Oh
and
the
other
thing
that
crow
doesn't
do
yet
is
translate
olive
see,
so
there
are,
there
are
constructs
that
it
just
won't
touch
right
now.
It
won't
handle
switch
statements
at
the
moment,
for
example,
for
the
same
reason
that
it
doesn't
handle
go
to
yet
there's
a
lot
of
terrifying
control
flow
things
you
can
do
with
switch
statements,
there's
a
variety
of
other
things
that
it's
either
doesn't
even
try
to
translate
and
we'll
just
report
an
error
or
it
tries
to
translate
it
and
gets
it
wrong.
I
mostly
try
to.
E
A
E
A
A
A
I'll
give
the
example
in
a
little
bits
of
numbers
on
muscle,
lipsy
I
also
tried
it
on
the
Linux
kernel
and
I
was
successfully
able
to
translate
one
source
file
in
Linux
kernel.
It
was
named,
empty
deceit,
turns
out
the
Linux
kernel
every
source
file
and
directly
includes
compiler
dot,
H
and
there's
a
standing
in
line
function
in
there.
That
has
a
switch
statement
or
something
so.
D
G
A
It
doesn't
make
any
difference
in
that
for
loop,
whether
the
prefix
or
postfix,
increment
I
did
have
a
teacher
once
who
insisted
that
you
should
choose
one
way
or
the
other
I
forget,
which
way,
because
of
compiler,
whether
the
compiler
would
generate
more
efficient
code
or
not,
which
is
utterly
bogus,
at
least
on
today's
compilers.
But.
D
So
something
when
I
was
looking
at
this
that
occurred
to
me
immediately
is
how
the
heck
are
you
squaring
the
scoping
differences
between
Lexi
and
rusts,
because
there's
some
awesome,
scoping,
stuff
I
know
you
can
do
in
rust
and
I
was
trying
to
remember
the
particulars
in
C
and
like
I.
I
can
remember
enough
to
know
they're
not
the
same
like
you
know
if
and
for
like.
So
how
are
you
kind
of
navigating
that.
A
In
different
scopes
that
mostly
fellow
naturally
there's
stuff,
you
can
do
in
rust
that
you
can't
do
and
see,
but
that's
fine
right.
I
only
need
to
be
able
to
do
everything
that
C
can
do
a
trust.
A
There
are
a
number
of
interesting
cases
where
wildly
different.
Looking
things
in
C
generate
the
same
rust,
for
example,
if
statements
and
ternary
conditionals
both
translate
to
if
expressions
in
rust.
What
was
another
example.
I
had
one
in
my
head
a
second
ago:
I,
don't
remember,
but
but
that's
come
up
a
few
times.
A
E
So
c
is
notorious
for
having
a
bunch
of
things
where
it's
under
the
specs
undefined
or
vague
or
terrible.
So
what
do
you
do
with
all
those
things
so.
A
An
interesting
thing
about
that
is
undefined.
Behavior
means
the
compiler
is
allowed
to
do
whatever
it
wants
right
and
so
I'm
allowed
to
make
corrode
do
whatever
I
wanted
to
what
I've
been
trying
to
do
is
be
kind
to
the
programmer
as.
E
A
As
possible,
so,
for
example,
signed
integer
overflow
is
undefined
in
see
if
you
have
a
signed,
integer
variable
and
it's
at
the
maximum
value
that
type
can
represent,
and
you
add
one
to
it.
C
does
not
specify
what
your
program
will
do
at
that
point.
It's
the
usual
sort
of
joke
is
it's
allowed
to
delete
your
hard
drive
or
I'll,
kill
goodness
or
whatever,
so
so,
that's
not
very,
very
friendly,
which
is
why,
in
rust,
they
made
the
decision
that
a
signed,
integer
overflow
would
in
debug
builds
panic
and
in
release
builds.
A
Unless
you
specifically
turn
on
the
panicking
behavior,
which
you
can
also
do
in
release,
builds,
it
would
wrap,
which
is
what
programmers
usually
expected
it
to
do
anyway,
and
so
what
I've
done
with
code
is
for
signed,
signed,
arithmetic,
I,
just
translate
it.
You
know.
If
you
have
a
plus
operator
and
see
it
translates
directly
to
the
plus
operator
and
rust,
and
that
has
a
nice
advantage
that
your
rust
is
about
as
readable
as
your
C
was,
which
may
be
not
very.
A
D
A
A
So
it's
a
c2,
R,
Us
translator,
so
there's
already
two
programming
language
is
involved.
Naturally,
I
decided
to
add
a
third
to
the
mix,
so
the
implementation
is
written
in
haskell
and
the
reason
for
that
is
to
get
to
your
question
that
the
only
see
front-end
that
I
could
find
that
was
usable
for
me
was
one
I
knew
how
to
use
an
I.
A
I
tried
it
first
to
write,
corrode
and
rust,
and
basically
everything
I've
done
would
be
easy
to
write
and
rust,
except
that
the
only
half
reasonable
see
front
end
I
could
find.
Was
the
the
rust
findings
to
lib
clang
and
live
clang,
which
is
the
C
wrapper
around
the
C++
API
in
klang
doesn't
expose
everything
that
you
need
from
the
abstract
syntax
tree.
A
H
B
A
That's
that's
in
the
category
of
you
know
it's
generating
sort
of
rust,
anti-patterns
right,
a
follow-on
tool
that
would
do
some
kind
of
borrow
inference.
Work
out
like
try
to
automatically
workout
cases
where
you
could
replace
the
raw
pointers
with
proper
barros.
That
would
be
awesome.
I'd
love
to
see
someone
explore
that
I
think
that
is
sort
of
maybe
grad
student
work
or
something,
but
so
I'm
not
going
to
propose
that
as
hey.
This
should
be
your
next
open
source
project.
Unless
you
happen
to
be
a
grad
student
already,
I.
H
C
F
A
A
A
So
I've
got
two
more
sections
I
want
to
talk
about
here.
The
first
is
testing.
How
can
I
have
any
confidence
that
the
rust
code
that
I
generated
actually
does
the
same
thing
as
the
C
code
that
you
handed
it
I
mean.
The
first
answer,
of
course,
is
that
I'm
trying
to
trying
to
construct
things
you
know
construct
the
source
code
of
corrode
following
the
c99
spec
or
the
c11
spec.
B
A
A
A
A
Some
number
of
global
variables,
some
number
of
struts
and
unions
and
enums
and
whatever
and
each
function
will
have
some
number
of
statements
which,
maybe,
if
statements
or
I
or
just
simple
statements,
or
while
loops
or
whatever,
and
each
time
it's
trying
to
insert
another
thing
it
randomly
chooses,
which
thing
to
insert
next
they've
done
a
number
of
things
like
I.
You
know
it's.
It's
only.
A
A
When
you
want
to
want
to
just
share
now
what
I
don't
actually
want
to
say
why
that's
useful?
That's
that's
just
useful
I'll
stop
there,
but
so
I
can
generate
random,
see,
source
files
and
then
what
I
can
do
with
them
is
try
compiling
them
with
GCC
or
clang
and
get
in
a
binary
out
and
I
can
run
that
and
I
can
see
what
it
does
and
I
can
also
translate
it.
A
So
I
I
now
have
a
little
little
python
script
in
the
crowed
repository
that
you
can
run.
If
you
want
to
that,
just
repeatedly
runs
c
smith,
I
tries
tries
this
testing
strategy
right,
see
whether
whether
both
versions,
both
binaries,
produce
the
same
output,
and
if
they
don't
well,
then
the
question
is:
how
do
I
find
this
bug?
I
now
have
I
wasn't
several
thousand
line
source
file
somewhere
in
it?
I
translated
something
wrong:
it's
not
just
that
several
thousand
lines
right.
A
Did
you
know
left
shift
wrong
again,
so
so
that's
where
the
second
piece
comes
in
from
the
same
people,
because
they
had
the
same
problem.
This
is
a
tool
called
see,
reduce
and
what
it
does
is.
It
goes
and
tries
to
leading
parts
of
the
program.
Just
just
delete
stuff,
the
big
biggest
thing
and
the
thing
is
spends
the
most
time
doing
is
just
randomly
choosing
lines
to
delete,
seeing
what
happens,
but
it
has
some
other
tricks.
A
It
does
to
be
a
little
more
efficient,
sometimes
so
the
trick
here
is,
you
know:
I
ran
Sue
Smith
I
got
a
program
that
failed
this.
This
test
of
the
two
different
programs
produce
different
results.
I
want
to
get
another
program
that
is
smaller,
but
fails
in
the
exact
same
way
and
figuring
out
how
to
specify
what
fails
in
the
same
way
means
gets
a
little
tricky,
but
but
once
you've
figured
out
how
to
specify
that,
then
you
just
give
see,
reduce
your
here's.
A
The
bug
I'm
looking
for
keep
deleting
things
until
you
don't
see
that
bug
anymore
and
then
back
off
and
try
deleting
other
things
right.
So
you
only
delete
things
that
weren't
important
to
the
bug
you
err
you're
facing,
and
this
has
been
super
helpful
in
in
helping
me
track
down.
You
know
going
from
those
several
thousand
line:
source
files,
20,
here's
the
five
lines
that
I
need
to
feed
corrode
to
get
a
wrong
output,
and
that
is
amazing
so
that
general
technique
is
called
Delta.
A
I've
been
testing
corrode
is
by
trying
to
take
the
muscle
c
library,
which
is
meant
to
be
a
small
lightweight
implementation
of
all
the
sorts
of
things
that
you
expect
normally
to
have
in
a
whole
sea
environment.
So
your
printf
implementation
and
your
mem
copy
and
add
exit
and
all
the
all
the
usual
sorts
of
things
that
the
C
standard
specifies,
or
that
POSIX
specifies
those
sorts
of
things.
A
A
That's
uninitialized
passing
it
by
reference
to
a
function
where
the
function
doesn't
read
that
variable
it
only
rights
to
it
and
then,
when
the
function
returns
then
they'll
read
it
and
rust
doesn't
know
how
to
how
to
deal
with
that.
So
Russ
just
says
this
looks
like
it
might
be.
Uninitialized
I
refuse
I
haven't
quite
decided.
What
I
want
to
do
about
that
there
are.
There
are
tricks
we
could
play
in
the
translation
using
weird
rust,
internals
things,
the
uninitialized
function
and
stuff,
but
but
I
kind
of
hate
to
do
that.
A
Try
to
remember
what
I
even
noted,
the
bugs
were
there's
some
problems
with
global
initializers.
Where
refuses
to.
Let
me
declare
something
that
you
know
it's,
it's
sort
of
obvious
what
its
value
should
be
at
compile
time,
but
rust
doesn't
believe
that
knows
what
its
value
is:
a
compile-time,
some
other
sorts
of
issues,
there's
some
bugs
in
the
translation
of
arrays
things
like
that,
but
and
then
there's
the
other.
A
The
other
point
that
I
haven't
actually
figured
out
how
to
get
all
of
the
resulting
object
files
to
link
and
to
muscle
to
see
that
I
can
actually
test
so
I,
don't
know
whether
any
of
that
code
is
translated
correctly,
but
you
know
it
seems
promising.
There's
there's
a
lot.
That's
already
working
there.
I
guess
is
my
point.
The
only
thing
to
note
about
muscle
lipsy
is
that
a
big
chunk
of
it
is
inline
assembly
and
since
I'm
not
translating
that
at
all
yet
and
that'll
be
a
pretty
substantial
chunk
of
the
remaining
eighty
percent.
A
H
A
A
A
E
E
B
B
B
F
A
Have
to
be
careful
when
you
write
your
when
you
see
reduce
you,
give
it
here's
a
usually
a
shell
script
or
something
I
happen
to
be
using
a
python
script
that
needs
to
exit
with
success.
If
this
is
a
version,
I
want
to
keep
or
failure
otherwise,
or
maybe
say
the
way
around,
that
that
would
got
very
confusing,
but.
F
A
I
wrote
a
little
script
that
tries
to
run
corrode
and
rust
see,
but
if
that
fails,
then
it
runs
GCC
with
the
original
arguments.
So
you
always
wind
up
with
an
object
file.
It
just
might
not
be
one
that
passed
to
corrode
so
right
now.
My
eye
I
stopped
at
I
need
to
get
the
implementation
of
the
rust
panic
function
from
somewhere.
A
One
of
the
things
that
I
really
wanted
out
of
this
project
was
I
wanted
to
get
get
other
people
involved
in
it.
That's
been
one
of
my
kegels
from
not
quite
the
start,
because
at
first
it
was
just
hey.
This
seems
fun.
Let's
try
and
see
how
far
I
could
get,
but
as
soon
as
I
started
discovering
that
it
was
actually
kind
of
working,
it
is
so
much
more
fun
if
you've
got
other
people.
Hacking
on
fun
stuff,
like
this
too
so
I
want.
A
B
A
A
41
pages
of
internal
documentation,
that's
executable
right.
This
is
the
implementation
and
I
can
throw
in
throw
in
snippets
of
cee
or
rust
source
to
illustrate
various
points
and
have
them
be
nicely
pretty
printed
and
everything
to
syntax
highlighted
I
mean
so
this
has
been
really
cool.
I
think
it's.
It's
encouraged
people
to
actually
keep
the
documentation
up
to
date
as
they're
working
on
features,
because
all
of
the
internals
documentation
is
right
there
in
the
source
that
they're
hacking
on
it's
been
helpful
for
people
trying
to
get
started.
A
A
And
I
think
people
should
try
using
literate
programming
more
often
I'm
hand
waving
a
little.
You
know
if
you
asked
Don
Knuth.
What
literate
programming
is
this
is
this
is
not
quite
everything
that
he
would
have
described
it
as,
but
but
this
has
been
enough
to
get
the
advantages
that
I
wanted
to
get
out
of
it.
A
Major
thing
that
I've
done
to
try
to
encourage
people
to
participate
is
I'm
using
github
is
my
my
source
hosting
and
github
has
a
reasonably
good
issue
tracking
thing
built
in
for
every
repository
and
so
I
just
created
some
issues
in
the
in
the
github
repository
and
added
a
tag
to
them.
That
said,
easy-
and
you
know
in
a
project
like
this
easy
as
a
relative
term,
but
but
I
tried
to
go
for
things
where
you
know.
A
So
this
is
a
great
way
to
in
whatever
open
source
project,
you're
doing
encourage
people
to
get
started,
and
then
once
they've
got
that
initial
momentum,
there
they're
much
more
likely
to
continue
on
and
contribute
greater
things
to
what
you're
doing
the
RUS
project.
Does
this
and
I
definitely
recommend
checking
out
a
you
know,
rust,
compiler
or
standard
library,
easy
tagged,
hugs
and
it's
the
thing
I
think
more
open
source
projects
should
do
so.
A
B
B
B
A
A
So
the
general
question
was,
you
know:
we
had
these
programming
languages,
the
early
programming
languages,
assembly,
languages
and
and
the
earliest
high-level
languages
that
were
built
sort
of
entirely
around
unstructured
control
flow
you'd
have
if
statements
and
go
tues,
and
that
was
kind
of
here
kind
of
all
you
got
and
then
people
started
arguing.
Well,
you
know,
go
tues
may
be
a
bad
idea,
we're
winding
up
with
all
this
messy
code.
E
A
E
A
For
example,
rust
and
Java
both
have
label
bloops,
so
you
can
break
out
of
a
loop,
that's
not
just
the
innermost
closing
loop
and
that
lets
you
capture
some
go
to
patterns
cleanly
that
you
can't
can't
easily
capture
otherwise,
and
so
some
papers
assume
that
your
language
has
that
others
don't
and
some
papers
talk
about.
Well,
these
are
the
kinds
of
programs
we
can
translate
and
for
anything
else
we
have
to
just
throw
up
our
hands
and
say
no
other
papers
say
well.
A
Alright,
if
you
decide,
you
still
want
to
translate
those
programs
that
have
what's
called
here,
reproduce
irreducible
control
flow.
Then
here
are
things
you
can
do.
You
can
duplicate
sections
of
code
or
you
can
add
boolean
variables
or
so
there's
there's
a
bunch
of
research
that
that
addresses
this
question
at.
How
do
we
do
this
and
it's
mostly
a
matter
of
someone
deciding
it's
it's
time
to
actually
do
it
in
corrode?
A
So
again,
there's
there's
sort
of
a
bunch
of
bookkeeping
to
do
to
get
all
of
this
right.
But
I
have
a
rough
idea.
How
to
do
that?
There's
an
open,
github
issue
on
corrode
with
a
whole
bunch
of
discussion
from
several
different
people
on
how
we
handle
go
tues
and
switch
and
I'd
love
to
see
someone
pick
it
up.
A
A
So
it
would
be
nice
maybe
to
have
some
kind
of
I'm,
not
even
quite
sure
what
this
looks
like
some
kind
of
more
clever
parser.
That
knows
how
to
deal
with
interleaved
c
preprocessor
tokens
and
and
actual
see,
tokens
right
and
so
I
thought
a
little
bit
about.
Maybe
it's
worth
rewriting
the
entire
sea
parser
to
do
that,
but
it's
certainly
not
worth
doing
soon.
A
Where
I
felt
rust
would
have
made
it
easier
to
write
corrode,
but
one
of
the
things
I've
been
trying
to
do
is
I've
been
trying
to
make
sure
that
I
can
at
least
have
a
hand,
wavy
justification
for
everything,
I
use
in
the
haskell,
where
I
could
say.
If
someone
who
knows
rust
came
to
me
and
asked
what
does
this
mean?
I
can
say.