►
Description
Ruby is a wonderful language, but sometimes, you need a little extra oomph. While C extensions are a great way to improve performance-sensitive parts of your application, you can use other languages too. In this talk, Steve will show off the Rust programming language and how to integrate it with Ruby. Rust is a systems language focused on safety, speed, and concurrency, and compliments Ruby nicely.
A
Hi
everybody
I'm
Steve
I
am
standing
between
you
and
the
parties
so
I
apologize.
This
is
my
twitter
handle
you
probably
shouldn't
follow
me.
I
will
be
talking
today
about
two
programming
languages
that
are
both
very
near
and
dear
to
my
heart,
Ruby
and
rust,
and
how
to
make
the
two
of
them
play
together.
So
I
like
to
joke
that
I
only
work
in
languages
that
start
with
ru
nowadays.
So
that's
like
that's
what
I'll
be
doing
going
forward.
A
I
have
I
have
some
slides
here
that
I've
been
experimenting
with
different
ways
of
doing
presentations
over
the
years,
and
so
this
version
of
my
slides
is
called
raw
markdown
files
because
we're
programmers
and
we
read
lots
of
raw
markdown
files,
so
I
have
sort
of
slides
and
then
I'm
gonna
show
you
a
whole
pile
of
code
so
that
we're
gonna
start
off
with
this
and
then
sort
of
transition
to
that.
So
all
vim
for
this,
this
presentation,
basically
okay,
so
I
have
sort
of
three
three
different
things
here
that
we're
gonna
talk
about
today.
A
The
first
one
is
systems,
programming,
quote-unquote
and
the
second
one
is
rust
and
then
rust,
making
heart
eye
emojis
at
your
favorite
programming,
language,
I've
sort
of
done
some
variants
of
this
talk
at
like
a
node
conference
and
like
Python
stuff.
So
it's
not
just
about
Ruby
as
well,
although
because
we're
all
Rubeus
I'm
gonna,
ignore
those
languages
and
just
talk
about
Ruby,
but
the
fundamentals
apply
to
like
whatever
programming
language
that
you're
interested
in
okay.
A
So
there's
this
thing
called
systems
programming
and
nobody
knows
what
it
is,
and
everyone
then
misunderstands
each
other
and
argues
with
each
other.
Words
are
hard
I,
like
this
definition
of
system
programming
that
yahuda
why
cats
made
up,
which
basically
is
when
it
actually
does
matter
which
is
sort
of
nonsensical,
which
is
one
of
the
reasons
why
I
like
it.
We
in
Ruby
world
like
to
talk
a
lot
about
how
most
of
the
time
a
lot
of
things
don't
actually
matter
so
people
will
say:
Ruby
is
really
slow.
A
We're
like
cool
the
database
and
the
network
are
going
to
be
slower
than
rubies.
So
it
doesn't
matter
that
ruby
is
slow.
It
is
fast
enough,
Ruby
uses
a
lot
of
memory.
That's
okay.
Memory
is
cheap.
You
can
get
a
gigantic
x1
large
on
Amazon
or
whatever,
and
it's
fine,
but
a
lot
of
languages
or
a
lot
of
applications
or
things
that
you're
doing
with
computers.
It
does
actually
matter
so.
A
A
They're,
like
assembly
instructions,
do
exactly
what
it
says
on
the
tin.
It
only
does
these
eight
or
ten
things
you
take
a
markup
language
and
a
full
turn
complete
programming
language
and
a
styling
language
that
no
one
knows
how
to
use
and
wrap
them
up
and
send
them
over
the
internet.
To
someone
on
the
other
side
of
the
world,
that's
running
a
totally
different
computer
and,
like
you
think,
that's
easy
or
something
like
web
programming.
A
We
do
ourselves
a
disservice
when
we
say
that
like
web
programming
is
easy
because
it
is
actually
incredibly
incredibly
complicated,
and
so
you
might
also
find
that
if
you've
never
tried
lower
level
programming
before
or
system
style
programming
that
you
might
be
one
of
those
people
that
finds
it
to
be
actually
easy.
So
don't
get
discouraged.
A
So
we
as
sort
of
like
a
core
value,
really
really
appreciate
people
who
have
not
done
low-level
programming
before
and
we
want
you
to
have
rust,
be
your
first
experience
with
lower
level
programming
languages.
If
you
come
into
our
IRC
and
you
ask
a
question
that
is
basic,
we
will
answer
you
and
smile
rather
than
call
you
stupid,
because
nobody
likes
to
be
called
stupid.
Yet
here
we
are
Internet,
so
we're
not
here
in
the
internet
right
now,
but
whatever
it's
fine
so
anyway,
learning
this
stuff
is,
is
it's
fun?
It's
a
lot.
A
It's
a
good
time.
I
I
feel
like
I'm,
a
better
Ruby
programmer
after
having
done
systems
programming
for
the
last
couple
years.
So
whatever
it's
a
little
cut
off
is
fine,
so
we
say
the
rest
of
the
systems.
Languages
focused
on
three
things:
safety,
speed
and
concurrency,
and
one
way
of
thinking
about
programming
languages
I
have
this
little
ASCII
axis,
just
kind
of
hard
to
say
actually
ASCII
X
as
SK
axis,
between
there's
this
trade-off
that
we
have
between
speed
and
safety
or
control,
or
no
control,
danger,
assists
and
slowness.
A
What
I
mean
is
things
like
you
can't
get
seg
faults
in
Ruby
unless
you're
using
a
native
extension,
which
is
thing
we'll
be
talking
about
shortly
but
like
pure
Ruby
programs
cannot
seg
faults.
You
have
certain
kinds
of
other
like
memory
problems
and
that's
due
to
Ruby
having
a
garbage
collector,
but
that
also
means
that
Ruby
is
generally
a
slower
programming
language
and
that
doesn't
necessarily
mean
that
it's
bad,
that's
just
you
know
the
way
things
are,
and
you
don't
have
very
much
control
over
the
details
of
how
your
program
operates.
A
But
Java
is
like
this
weird
middle
ground
where,
like
it's,
definitely
more
safe
than
a
language
like
C
and
it's
a
little
more
slow,
but
it's
actually
still
pretty
speedy.
So
programming
languages
generally
fall
on
this
axis
somewhere
and
rust
goal
is
to
completely
destroy
this
axis,
so
we
want
a
language,
it's
the
safest,
ruby
wit,
that
is
as
fast
or
faster
than
C
and
there's
always
a
trade-off
so
like
if
I
tell
you
that
things
magically
are
just
better.
I
am
probably
lying
to
you.
A
So
the
trade-off
in
this
instance
is
that
we
have
lots
of
compile
time
checks
and
so
satisfiying.
The
compiler
is
a
little
tough
at
times
or
it's
a
struggle
as
a
new
programmer.
So
if
you
haven't
worked
in
a
statically
typed
language
before
the
amount
of
things
that
rest
checks
at
compile,
time
are
pretty
intense
and
that's
really
really
awesome,
because
it
means
that
we
can
generate
like
very
low
overheads
super
fast
code,
but
it
also
means
that
you'll
be
like
this
program
should
work
compiler.
A
Why
are
you
yelling
at
me
like
it
just
just
just
compiled
it,
damn
it,
and
so,
as
a
small
aside,
let's
people
like
to
call
this
fighting
with
the
compiler
when
they're
like
struggling.
This
is
like
a
very
common
intermediate
thing
in
Ruby
world.
It's
like
meta
programming
is
the
the
sort
of
test
of
your
an
intermediate
or
advanced
Ruby
programmer
to
me
like.
A
If
you've
read
meta
programming,
Ruby,
that's
when
you
like
level
up
when
you're
like
originally
writing
Ruby,
and
then
you
like
talk
about
eigen
classes
and
your
brain
melts
and,
like
you
know,
you
hopefully
come
out
on
the
other
side,
a
little
better.
So
in
rust.
If
this
fighting
with
a
compiler
phase,
that's
are
like
equivalent
of
meta
programming
and
a
lot
of
people
say
fighting
I,
don't
like
to
call
it
fighting,
because
I
think
that
that
sets
up
an
adversarial
relationship
is
not
true
I
like
to
think
of
it
as
more.
A
Your
good
friend
telling
you
that
you're
about
to
do
something
really
stupid,
and
you
probably
shouldn't
like
I,
know.
I
know
that
I've
had
friends.
Tell
me
like
hey
man,
that's
a
bad
decision.
You
probably
shouldn't
do
that
and
you're
like
okay.
Thank
you
for
looking
out
for
me.
That's
the
way
I
feel
about
the
rest.
Compiler
is
that
it's
not
fighting
with
me.
It's
telling
me
I'm
about
to
do
something
terrible
and
preventing
me
from
doing
so.
A
Okay,
so
I
have
I,
have
a
bunch
of
code
at
some
background
stuff
about
rust.
It's
hard
to
like
teach
a
programming
language
in
45
minutes,
so
I'm,
just
gonna
kind
of
randomly
explain
some
syntax
to
you
as
I
show
it
to
you.
But
this
is
not
really
so
much
a
tutorial
on
rust
as
it
is
like
integrating
ruby
with
weird
other
languages.
So
it's
not
really
about
the
details.
A
Let's
see
I'm
gonna
do
a
new
terminal
window.
Here.
I
forgot
to
set
up
my
second
terminal:
whoo
Oh,
F,
11,
yeah
I,
usually
use
X
Monad,
but
like
X,
Monad
and
multiple
projectors
is
sadness
so
prepare
for
me
to
miss
type,
a
lot
of
keyboard
shortcuts,
because
I
have
these
things
ingrained
in
my
head
and
now
I'm
in
Nome.
Instead,
so.
A
Okay,
so
I
have
sort
of
four
components
in
this
directory.
That
I'll
show
you
this
a
little
small
and
we
make
this
a
little
bit
bigger.
So
there
are
a
number
of
different
ways
to
integrate.
Ruby
and
rust,
and
part
of
this
is
because
essentially
Ruby
knows
how
to
talk
to
see.
A
lot
of
people
say
that
C
is
like
the
Latin
of
programming,
like
it's
sort
of
the
language
that
all
of
the
things
come
from,
and
so
basically
the
way
that
you
get
Ruby
to
talk
to
other
languages.
A
Is
you
make
those
languages
pretend
that
they're
C
so
Ruby
thinks
that
it's
talking
to
a
C
program,
but
actually
it's
talking
to
a
Russ
program
instead.
So
what
that
means
is
there's
sort
of
these
two
edges,
so
you
have
like
Ruby,
takes
it
stuff
and
converts
it
into
C
stuff
hands
it
over
to
rust.
Rust,
takes
that
C
stuff
and
converts
it
to
rust
stuff
and
then
vice
versa.
A
So
you
have
this
kind
of
like
bridge
effect
and
so
I'm
going
to
show
you
a
couple
of
different
ways
to
make
that
work
and
then
also
I
have
a
this
M
rusty
directory
is
about
M
Ruby,
so
M
Ruby,
super
cool,
isn't
me
played
with
them
Ruby
or
like
looked
into
it
later.
You
know
what
it
is.
Okay,
only
a
couple
people
M
Ruby
is
awesome.
A
A
A
I
was
a
good
time
making
lots
of
gems
and
so
there's
standard
conventions
that
depend
on
where
your
code
goes.
So
most
people
know
about
the
Lib
directory
is
where
your
Ruby
code
goes,
but
if
you
have
a
C
extension
as
what
they
call
them
in
Ruby
parlance,
there
is
also
this
ext
directory
inside
there.
So
the
actual
actual
source
code
of
this
gem
is
require
rust
example,
slash
rust
example.
Now
this
is
repeating
which
is
kind
of
a
little
weird,
but
it's
about
the
way
that
the
ruby
gems
compile
C
code.
A
When
you
have
a
C
extension,
it's
just
way
easier
to
follow
the
naming
conventions,
even
when
they
feel
a
little
dumb.
So
because
of
things
I'll
show
you
in
a
second,
so
this
is
literally
all
of
the
Ruby
code.
This
in
this
gem
is
require
this
stuff
that
actually
turns
out
that
it's
written
in
C,
I,
guess
I,
actually
strictly
I,
guess
I
lied,
it's
not
all
of
it.
There's
also
a
version.
Zero
point
two
point
O
and
there
as
well,
but
that's
all
of
the
Ruby
code.
A
Everything
else
happens
in
this
ext
directory,
so
I'm
gonna
go
into
there
and
so
in
the
ext
directory.
There
is
this
rust
example
folder,
which
is
conventional,
and
that's
why
the
require
line
said
require
rust
example.
Slash
rust
example
is
because
this
is
the
directory,
so
it
works
the
same
way
as
other
stuff
does
and
then
in
here
there
are
some.
There
are
some
files.
A
A
Is
this
DSL
and
it's
a
it's
a
DSL
that
was
originally
put
in
rubygems
and
what
it
does
is
you
require
mkmf
which
stands
for
make
make
file
clearly
obvious
from
that
abbreviation
and
then
you
say:
hey
I
have
a
particular
library,
just
like
all
Ruby
DSL.
This
is
actually
Ruby
code.
Even
though
it's
just
sort
of
calling
these
two
functions
so
I
have
a
I,
have
a
library
called
rust
example,
and
then
you
also
give
it
an
entry
point.
A
So
whenever
you
have
a
native
extension,
Ruby
calls
a
function
when
you
load
that
extension
up,
and
so
you
have
to
tell
it
what
the
name
of
it
is,
and
so
the
the
conventional
name
is
the
name
of
your
library
underscore
in
it.
So
we
say:
hey
here's,
this
library,
I'm
going
to
define
here's
the
function
to
initialize
it,
and
then
you
might
this.
You
write
this
create
make
file
line,
and
so
what
happens
is
when
you
actually
build
the
gem,
so
I'm
actually
gonna
go
up
Oh
directory.
A
So
if
I
do
rig
build,
for
example,
oh
I
already
did
it
so
that
doesn't
that
doesn't
show
cool
output.
You
know
when
you
install
a
gem
that
has
a
native
extension
and
it
says
something
like
building
native
extension
dot,
and
then
it
sits
for
a
while.
This
mkmf
stuff
is
what's
happening
when
that
dot
dot
is
is
going
on,
so
usually
that
output
is
totally
hidden
and
what
that
actually
does.
Is
this
e
FC
comped
on
RB
file?
A
You,
you
basically
run
it
and
it
it
makes
this
make
file,
and
so
those
couple
lines
generates
all
of
this
junk.
This
is
clearly
very
readable
and
debuggable.
If
you
get
it
wrong,
yeah
I'm
still
go
we're
30
percent
of
the
way
through
this
file,
it's
ridiculous,
and
so
all
that
that
does
is
it
tries
to
compile
this
rust
example.
Dot
see
file.
So
this
is
why
I
said
that
this
is
the
hard
way
so
bless
you
we're
actually
not
just
writing
some
rust
code
for
this
gem.
We're
also
writing
some
C
and
here's.
A
The
reason
why
Ruby
FFI
is
nice,
but
the
problem
is:
is
that
Ruby's
interface
isn't
so
much
like
a
well-designed
thoughtful
interface
and
how
to
interpret
with
Ruby
it's
more
like
here's.
The
header
file
for
the
interpreter
go
nuts
will
hopefully
not
break
any
of
your
stuff,
and
so
the
problem
is
is
that
there
are
a
whole
lot
of
macros
written
in
C
that
are
basically
just
easier
to
write
a
small
C
wrapper,
rather
than
trying
to
re,
implement
them
in
in
rust
directly.
A
Now
there
is
an
answer
to
that
which
is
sort
of
what
the
M
Ruby
stuff
is
about,
but
I'm
kind
of
showing
you
the
like
most
low-level
annoying
way
of
doing
it
first
and
then
we'll
get
like
better
in
the
future.
So
this
is
a
C
program
that
includes
Ruby,
dot,
H
and
then
defines
these
three
functions.
So
hello,
rust,
fill
slice
and
num
are
three
functions
that
are
going
to
be
defined
in
rust
world.
A
So
the
extern
keyword
in
C
says
this
is
an
external
function
from
somewhere
else,
so
we're
going
to
load
it
up
that
way
and
then
here
is
a
couple
of
these
functions
that
are
sort
of
implemented
in
C
kind
of
so
you
know
how,
in
Ruby
everything
returns
an
object
of
some
kind
right,
so
this
is
also
displayed
in
the
the
C
interface.
So
value
is
again
this
weird
C
macro
that
expands
a
bunch
of
C
code.
That
is
like
a
ruby
object,
so
this
C
return
type
is
actually
all
these
details
about
Ruby's
functions.
A
So
this
calls
our
hello
rust
function
and
then
prints
it
to
the
screen
and
returns
Q
nil,
which
is
nil
but
like
in
C
instead
of
in
Ruby.
So
that's
like
what
Ruby
calls
it
internally
and
so
I
have
some
other
functions
here.
They
don't
really
matter
that
much
at
the
moment,
but
here's
the
last
bit
of
anointest
about
making
a
ruby
c
extension.
So
remember
how
we
said
there
was
that
in
a
trust
example
function.
A
That
was
like
the
loading
point,
so
this
is
actually
defining
it
and
you
have
to
name
it
with
a
capital
I'
in
it
and
then
an
underscore
and
then
the
rest
of
your
stuff,
which,
just
like
looks
really
ugly
to
me.
It's
really
weird
because,
like
ruby
is
so
focused
on
aesthetics
most
of
the
time,
and
then
you
have
to
have
this
like
really
odd
naming
convention
but
whatever
so
here
we
have
these
couple
of
functions.
So
rust
example,
Eagles
are
be
defined,
module
rust
example.
A
So
I
don't
know
how
much
you've
dealt
with
binary
gems
before,
but
you
can
see
on
Ruby
gems
at
org
and
I
mean
you
could
see
if
the
font
wasn't
like
light
gray
on
white
on
this
projector
I
actually
really
like
the
new
rubygems.org
redesign,
but
I
just
realized.
It's
in
looks
like
tiny
font.
That
has
no
contrast
whatsoever,
and
so
you
can
actually
see
that
this
has
x86
64,
Linux
and
x86
64,
Darwyn,
13
and
so
like.
A
You
can
actually
have
this
stuff
precompiled
so
that
you
users
don't
need
to
do
the
compiling
themselves,
yadda
yadda,
and
so
that's
what
doing
it.
This
way
kind
of
enables-
and
it's
also
useful
if
you
want
to
distribute
it
to
other
people,
but
if
you're,
building
your
own
application
and
you're
not
trying
to
like
share
this
with
people
and
there's
it'd
be
much
easier
anyway.
I'm
gonna
show
you
some
rust
now
how
these
functions
are
actually
implemented.
A
A
Yeah
terminal,
okay,
so
in
rust
we
actually
have
very
similar
tooling
to
Ruby,
and
this
is
one
of
the
things
that
ends
up
being
awesome
about
rust.
We
basically
literally
paid
yahuda
to
write
bundler
for
rust
because
we're
just
like
we
love
bundler,
it's
a
great
package
management
system,
let's
just
like
steal
it
wholesale,
and
so
we
call
it
cargo
rather
than
bundler,
because
rust
calls
packages
crates.
So
cargo
is
how
you
ship
your
crates
to
other
people,
and
so
we
also
have
a
source
directory
just
like
in
Ruby.
A
In
cargo
dot
Tamil,
we
sort
of
just
like
we
defined
stuff
for
gems.
We
say
here
is
the
name
of
this
particular
package
and
some
authors
and
then
the
name
of
it,
and
in
this
case
we
want
a
static
library
and
a
dynamic
library,
because
I'm
gonna
be
showing
you
the
two
different
ways
of
making
these
things
and
then
any
dependencies
that
are
involved
and
okay.
A
So
here's
a
bunch
of
rust,
syntax,
I'm
gonna
turn
off
my
syntax,
highlighting
so
one
of
the
really
cool
things
about
rust
is
that
because
it
is
a
little
level
language,
you
can
basically
get
rid
of
the
standard
library
and
embed
it
in
almost
anything
like
I
said
it
pretends
to
be
C
literally,
and
so
what
this
means
is
we
can
add
these
annotations.
So
this
is
a
little
more
noisy
than
regular
rust
code,
because
we
have
to
basically
say
hey.
A
Please
pretend
that
you
receive
for
all
these
functions,
but
this
combination
of
no
mangle
and
extern
C
says
hey
this
function.
Hello,
rust
is
going
to
pretend
to
be
a
C
function
instead
of
a
rust
function
and
that's
what
like
enables
Ruby
to
be
able
to
know
how
to
call
the
rust
function
itself,
and
so
in
this
case
the
hello
rust
function
just
returns.
This
particular
string
as
a
pointer
and
we
need
a
null
and
because
of
C
and
there's
a
whole
bunch
of
other
stuff
in
here
it
doesn't
actually
matter
at
the
moments.
A
There
are
very,
very
simple
functions
that,
like
I
said
this
particular
one
returns.
This
string,
hello,
world
I,
wrote
some
documentation
for
this
one.
So
it's
a
little
complicated,
but
this
is
basically
just
a
copies
hello
world
into
another
string,
and
this
final
one
just
rich
the
number
five,
and
that's
because
this
is
a
demo
about
showing
how
they
communicate
rather
than
being
in
it.
Like
super
extensive
here's,
a
bunch
of
rust
stuff
later
we're
gonna
see
this
five
appear
in
a
rails,
app
actually
as
well
we're
just
kind
of
cool
okay.
A
A
It's
like
you've
already
built
the
thing.
Why
would
I
do
anything
else,
so
you
just
type
cargo
build
and
it
knows
how
to
build
and
generate
all
that
stuff.
So
you
don't
have
to
deal
with
make
files.
You
get
a
very
bundler
like
system
for
writing
your
arrest
code
instead
of
the
normal
sea
terribleness
slash
Gary,
Ness,
okay.
So
so
we
have
this
gem
now.
What
can
we
actually
do
with
it?
I'm
gonna
copy
and
paste
this,
because.
A
A
Yeah
I
forgot
the
or
on
the
Ruby.
Thank
you.
So
we
can.
We
can
actually
use
this
particular
gem
by
calling
Ruby
and
passing
the
I
to
include
the
Lib
in
ext
directories
and
then
are
requires
the
rust
example.
Gem
I
long
time
ago,
I
almost
thought
that
I
found
a
bug
in
Ruby.
So
if
you
go
to
Ruby's
source
code,
I'm
just
going
off
a
tangent
real,
quick
cuz
there's
my
favorite
stories.
A
It's
it's
here.
Rubygems
they
moved
it.
Okay,
so
there's
this
file
and
it's
called
ubi
gems,
Darby
and
I
was
like
I
was
like
that
has
to
be
a
typo.
What's
going
on
and
you
clicked
in
it
and
you
get
the
this
header.
That's
always
you
know.
Copyright
2006
by
Chad,
Fowler,
rich
Kim,
learn
Jim
Wyrick
and
others
like
it's
awesome,
but
all
it
does
is
requires
ruby,
gems
and
I
was
like
what
is
going
on.
This
has
to
be
a
mistake
and
it's
like
sort
of
almost
a
it's.
Almost
a
like
Easter
Egg.
A
So
we
can
do.
Is
you
can
say?
Ruby
are
and
then
require
a
gem,
but
if
you
type
Ruby
are
ruby
gems
to
do
require
ruby,
gems
that
looks
kind
of
like
dumb
in
a
certain
sense,
so
what
they
did
was
they
made
Ruby
gems.
So
it's
just
our
ruby
gems,
basically,
and
that's
actually
like
that's
like
in
Ruby.
So
that's
how
I
learned
about
this,
but
I,
like
literally,
tried
to
submit
a
patch
being
like
what
this
file
doing
here
anyway.
A
So
we
can
require
the
rust
example
gem
and
then
II
will
like
let
you,
instead
of
it
being
like
a
interpreter
or
a
repple.
It
will,
let
you
say,
execute
the
string.
So
in
this
case
now
you
defined
all
this
stuff.
Hooking.
These
things
up
the
rust
example
module
has
a
function,
hello
and
it
will
return
that
string.
A
A
A
Okay,
so
the
way
that
it
does
this
is
the
Lib
directory.
So
now
the
Lib
directory
and
a
rails
app
is
kind
of
just
like
I'm,
too
lazy
to
make
a
gem
out
of
this
already
kind
of
thing.
So
that's
what
I
did
so
there's
this
rust
example
that
RB
and
instead
of
doing
all
of
that
MK
MFC
mapping
header
file
shenanigans.
A
It
turns
out
that
there's
a
really
awesome
thing
in
the
Ruby
standard
library
called
fiddle
and
what
fiddle
lets
you
do
is
it
lets
you
basically
load
up,
AC
shared
object,
library
and
say
what
functions
are
actually
in
there
and
it
just
lets
you
call
them
as
Ruby
code.
So,
instead
of
all
of
that
C
crap,
you
could
instead
do
this.
You
define
a
rust
example
class
and
a
number
method.
A
Then
you
call
the
DL
open
method
a
fiddle,
and
you
point
it
at
where
the
Esso
is,
and
then
you
can
say
this
fiddle
function
is
called
rust
example
and
it
has
the
num
the
empty
array.
There
is
because
num
takes
no
arguments
and
then
fiddle
type
int
says
it
returns,
an
integer
back
and
then
the
fiddle
library
will
actually
handle
doing
all
of
that
wrapper
junk.
A
That
I
showed
you
a
couple
minutes
ago,
and
then
that
gives
you
back
a
proc
that
you
can
just
call,
and
so
this
ends
up
doing
the
same
thing
as
all
of
that,
but
is
way
way
easier,
but
I
like
to
understand
how
it
works
and
then
use
the
convenient
stuff
on
top.
So
that's
why
I
showed
you
the
hard
way
and
now
the
easy
way.
So
this
is
a
significantly
easier
way
that
you
could
integrate
rust
code
into
Ruby
code
and
do
stuff
this
way.
A
This
is
actually
how
doing
the
C
pre
compiling
thing
was
so
annoying
complicated,
yehuda
in
skylights
their
product.
They
sell
over
at
tilde,
it's
actually
written
in
R
in
rust,
their
ruby
gem
and
what
they
do.
Is
they
have
a
before
install
hook
that
downloads
the
shared
object
file
from
their
still
from
their
servers
and
then
uses
fiddle,
because
it
ends
up
being
a
little
more
reliable
than
the
like
low-level
stuff?
So
this
is
a
really
really
cool
way
of
integrating
ruby
with
again
anything
that
pretend
to
be
see
not
just
rust.
A
So
Phil
is
really
awesome.
Okay,
so
that's
the
rails
app
and
then
I
want
to
show
you
this
em
Ruby,
real
quick.
So
only
some
of
you
said
you
knew
about
em
Ruby,
em
Ruby
is
kind
of
like
Max's
new
project
to
a
certain
degree.
It's
what
he
focuses
a
lot
of
his
time
on
nowadays
and
basically,
M
Ruby
is
kind
of
like
it's
Ruby,
but
it's
more
lightweight,
so
it
doesn't
share
all
the
same
features
that
MRI
has.
But
the
the
key
thing
that's
cool
about.
A
M
Ruby
is
that
you
can
embed
it
inside
of
other
programming
languages.
So
you
know
people
use
Lua
where
they
like
embed
Lua
and
something
else
get
a
little
bit
of
scripting
into
your
app
so
M
Ruby
lets
you
do
that
with
Ruby
instead,
and
so
this
is
really
cool
and
useful,
and
so
it's
neat
because
it
like
it
is
Ruby
but
not
100%
of
Ruby,
but
it's
a
lot
smaller
and
it's
just
real
cool.
So
this
really
awesome
person
made
a
library
for
rust,
called
M
rusty
that
hooks
up
M
Ruby
to
rust.
A
So
what
this
means
is-
and
this
is
actually
one
area
where
I
think
that
M
Ruby
is
really
really
important.
So
we've
seen
a
number
of
companies
over
the
years
that
have
originally
used
Ruby
move
away
to
other
languages
because
they
need
to
distribute
command
line,
applications
and
I,
don't
know
if
you've
ever
tried
to
distribute
a
command
line
application
written
in
Ruby
before,
but
that
is
the
accurate
sound
you
should
be
making.
So
it's
the
the
two
big
ones
I
can
think
of
off.
The
top
of
my
head
are
Heroku
and
vagrants.
A
I
showed
you
before.
So
here's
how
this
works-
and
this
is
probably
the
most
rest
code
I'm
going
to
show
you
so
we
bring
in
our
projects
M
rusty
the
name
of
this,
the
name
of
this
package,
and
then
the
main
function
is
where
all
rest
code
starts.
Executing
I'm,
actually
gonna
turn
this
syntax
off
it's
harder
on
a
projector.
A
So
this
let
M
Ruby
equals
M,
Ruby
new
actually
makes
and
initializes
a
brand
new
M
Ruby
interpreter,
and
now
you
have
access
to
it
from
your
rest
code
and
when
you
install
this
extern
create
M
rusty,
it
actually
downloads
a
copy
of
the
M
Ruby
source
and
builds
it
for
you.
So
you
have
one
locally,
so
there's
no
dependencies
and
outside
things
at
all,
and
so
here
we
make
a
rust
structure
called
cons
for
container
and
it
just
holds
a
number
and
then
there's
some
shenanigans.
A
It's
actually
a
little
harder
without
syntax,
highlighting
and
because
this
font
is
so
big.
But
we
can
say:
I
have
this
class
and
I'm
going
to
use
that
rust
struck
to
define
this
Ruby
class.
It's
gonna
have
an
initialize
function
that
takes
a
number
32-bit
integer
and
it
starts
off
the
container
holding
that
value.
And
then
you
can
get
the
value
by
printing
out
a
fixnum
from
it,
and
then
it
actually
also
includes
an
R
Spec
style
macro
as
well.
A
So
you
can
actually
then
write
what
is
effectively
our
spec
code,
although
I
believe
the
M
Ruby
version
of
our
spec
doesn't
have
all
the
features
that
real
r-spec
does.
Sam
is
shaking
his
head,
as
he
usually
does,
and
so
you
can
also
test
your
stuff
here,
but
here's
what's
really
cool
so
that
M
Ruby
when
I
said
that
was
a
handle
to
a
Ruby
interpreter.
A
A
You
know
we
have
this
container
around
a3,
so
it's
going
to
print
out
the
three
again,
but
we
can
also
just
like
include
arbitrary
Ruby
code,
so
here
I
require
a
greeting
file
and
in
this
greeting
dot,
RB
I
just
defined
a
really
simple
class
that
says
hello
there,
and
so
you
can
like
write
all
of
your
files
in
Ruby
and
then
sort
of
bring
them
in
in
this
way,
and
it
actually
also
includes
a
repple.
So
you
can
actually
start
up
a
new
like
IRB
instance
inside
of
your
command
line
program.
A
If
you
want
and
so
I'm
going
to
compile
and
run
this,
you
can
see
it
taking
a
minute
compile,
but
basically,
what
this
ends
up
doing
is
ended
up
giving
you
a
single
program
that
has
almost
no
dependencies.
You
can
just
copy
onto
any
other
computer
and
run
that
stuff
and
so
I
think
this
is
a
really
exciting
way
of
bringing
Ruby
back
into
a
space
that
has
historically
done
really
bad
at
because
packaging
Ruby
up
for
command
line.
Things
is,
has
not
been
that
great.
A
So
so
anyway,
that's
a
couple
of
different
ways
to
integrate
rust
and
Ruby
together.
I
thought
this
yeah.
There
we
go
it's
finally
done.
I
was
like
come
on
compiler
three
and
hello
there,
so
you
can
see
rust
and
Ruby
working
together
in
that
fashion.
So,
in
conclusion,
close
this
one,
okay,
so
I,
really
love
Ruby.
A
I
literally,
have
a
ruby
tattooed
on
my
body,
I've
been
doing
more
Ruby
arrests
than
Ruby
like
in
the
last
couple
years,
but
that
doesn't
mean
that
I,
don't
like
Ruby
anymore,
and
so
one
of
the
things
that
I
think
that
is
awesome
about
learning
rust
is
that
you
don't
have
to
like
stop
using
your
old
programming
language,
there's
a
whole
lot
of
people.
That
think
that
you
can
like
only
use
one
language
at
a
time
for
some
reason.
A
A
I,
don't
often
do
questions,
but
I
guess
I'm
a
couple
minutes
early.
So
do
we
want
to
do
some
questions
cool?
What's
up?
It
is
it's
right
here.
So
I
got
this
Ruby,
but
it's
got
the
skeleton
holding
this
Ruby,
and
so,
when
I
originally
got
it.
I
also
have
a
pearl
camel
farther
up
my
arm
because
I
did
pearl
before
Ruby
people
have
been
asking
me
when
I'm
getting
a
rust
tattoo
and
I'm
a
joke
like
when
I
don't
program
it
anymore.
A
That's
what
I'm
gonna
get
the
tattoo,
but
when
I
originally
got
the
tattoo
and
it's
got
this
skeleton
holding
it
Geoffrey
Rosenbach
was
like
is
that
DHH
holding
that
Ruby
and
like
mentioned
him
in
the
tweet
or
whatever,
and
he
didn't
reply.
So
it's
not
confirmed
nor
deny
that
the
skeleton
DHH
tattooed
on
me
yeah
any
other
stuff
sweet.
Let's
go
party
or
whatever
it
wine-tasting,
/,
cruz,
/,
stuff,
yeah,.