►
Description
PDXRust - Bridging Ruby and Rust
More on http://www.meetup.com/PDXRust/events/230908090/
Help us caption & translate this video!
http://amara.org/v/2Fi6/
A
B
A
B
A
Fortunately,
the
slides
are
pretty
much
documenting.
Forget
all
of
this
content.
The
other
announcement
that
I
have
is
that
the
DevOps
save
pdx
organizers,
I've,
offered.
A
B
Okay,
so
do
you
think
this
is
my
slides.
B
A
A
B
Is
that
ok,
so
I
am
Godfree
a
work
on
a
few
open
source
technologies
such
as
ruby
on
rails
or
ember.js?
If
you
would
like
to
talk
about
those
things
we
can
chat
after
you
can
find
me
on
the
Internet,
as
Chen
can
code
before
begin.
I
would
probably
tell
you
a
little
bit
about
myself.
I
am
a
professional
go
player
whatever
you
might
not
know
that
but
I?
Actually,
I
just
started
pretty
recently
and
I
already
made
it
to
a
very
pretty
high
level,
so
I'm
pretty
impressed
with
my
progress
so
far.
B
So
as
you
can
see,
I'm
a
professional
go
player.
I
am
so
as
I
as
I
mentioned.
I
really
I'm
really
excited
about
this
career
change.
That
happened
recently
because
part
of
its
like
I
I
could
do
what
I
love
for
work
and,
more
importantly,
I,
finally
have
a
reason
for
going
to
the
gym
every
day
and
that's
the
picture
of
meeting
you
into
the
gym.
B
Unfortunately,
oh,
that's
also
a
pretty
old
picture
by
the
way.
So
I'm
currently
it
I
believe
level
18
my
level
seven,
and
that
is
not
one
of
my
strongest
working
one
anymore
anyway,
the
the
port.
So
so
this
is
a
pretty
cool
gig
right,
but
then
it
could
also
be
pretty
frustrating
sometimes
and
the
most
frustrating
thing
about
being
a
professional
go
player
is
probably
this
screen.
A
B
Difficult
is
this
like
this
2016,
as
always,
we
figured
it
out
already
like
you
got
it,
you
got
to
catch
them
all
anyway,
so
that's
my
that's
my
day
job
and
when
I'm
not
catching
pokemon.
I
work
that
hi
my
hobby
is
a
software
engineer
at
a
local
company
called
Tilda
in
Portland.
Here
we
have
product
called
skylight
is
basically
a
monitoring
dashboard
for
for
your
rails
applications,
and
it
basically
gives
you
advice
on
how
you
can
improve
it.
B
B
Please
take
out
your
pen
and
paper
and
write
that
down.
Okay.
So
that's
that's
me,
but
out
any
wave,
your
if
you're
from
the
United
United,
States,
Citizenship
and
Immigration
Service,
that
was
a
joke.
I
do
work
at
tilter
has
a
full-time
employee.
So
please
don't
take
away.
Please
no!
Take
away
my
visa
also
a
year
from
the
IRS
for
the
CRA
in
Canada.
Please
note
that
skylight
credits
have
no
cash
value
and
they
should
not
be
considered
a
form
of
income
for
tax
purposes,
but.
B
Up,
even
if
you
don't
use
rails,
we
have
a
pretty
cool
insider
newsletter.
That's
one
of
those
newsletters
on
the
right,
and
we
basically
just
take
turns
talking
about
what
we
will
be
working
on
at
our
job
and
like
the
weird
problems
we
run
into,
and
sometimes
it's
like
Ruby.
Sometimes
it's
JavaScript
sometimes
like
when
we're
doing
bruh
sweet,
like
basically
I.
B
Have
this
really
frustrating
thing
today
and
if,
but
here
is
the
solution,
I
found
or
sometimes
we
look
like,
we
couldn't
find
a
solution,
but
the
next
day,
like
some
of
our
customers
on
the
mailing
list
with
I,
recently
ran
into
that
problem
and
here's
a
potential
solution.
So
it's
a
pretty
cool
newsletter.
If
you
would
like
to
get
an
insider
on
how
we
work,
so
you
need
to
basically
sign
up
with
or
without
that
referral
link.
B
But
once
you
sign
up,
you
can
go
into
your
email,
preference
and
change
your
email
preference
do
the
insider
panel
anyway.
That's
me
and
I
realize
this
is
a
rough
meet
up
that
today,
I'm
here
to
talk
about
Ruby.
If
you
didn't
know,
Ruby
is
a
scripting
language.
B
You
might
have
fun
like
I
guess,
some
of
this
closer
cousins
or
things
like
Python,
you
might
be
more
familiar
with
it,
Ruby's,
basically,
a
scripting
language
on
roughly
the
same
level
of
abstraction
and
has
a
lot
of
influence
from
things
like
small
talk,
pearl
and
it's
a
pretty
cool,
scripting
language
and
I
would
encourage
you
to
check
it
out.
If
you
have
been
played
with
it.
Basically
just
you
can
you
can
really
easily
install
it
and
you
can
get
into
an
interactive
console
and
start
playing
with
it.
B
So
there
there
are
a
lot
of
things
to
love
about
Ruby,
the
syntax
is
very
sweet
and
it's
like
really
focus
on
developer
productivity
and
developer
happiness.
That's
the
that's!
What
they
caught
and
the
ecosystem
is
very
mature
and,
for
example,
of
you,
if
you
use
rust,
you
probably
use
cargo
and
you're
probably
familiar
with
the
car
legal
system.
So
you
could
work
on
both
fondler,
which
is
the
like
the
version
of
carbon
in
Ruby
that
I
guess
came
before
Cargill
and
heavily
influenced
Carlos
design,
and
so
you
can.
B
You
can
perhaps
extrapolate
your
your
rust
ecosystem
experience
in.
There
are
a
lot
of
awesome
libraries
and
Ruby's
similar
and
the
the
community
and
Ruby
is
pretty
awesome
as
well.
So
there
are
a
lot
of
great
things
about
Ruby,
but
one
of
the
things
that
Ruby
is
not
particularly
known
for
as
being
a
fast
language
and
but
in
the
real
world
most
of
the
work
load
our
eye
open
right.
So
this
isn't
actually
an
amending
all
that
much
and
because
I
operations
are
so
much
slower
than
the
speed
of
computation.
B
The
performance
difference
isn't
really
a
bald.
A
knack
for
the
most
part,
especially
Ruby,
is
usually
used
for
writing
things
like
web
application,
and
you
can
imagine
most
of
the
things
you're
actually
doing
is,
like
you
know,
reading
from
the
hard
drive
talking
to
database
network
and
stuff
like
that,
so
even
though
most
of
the
work
load
in
in
the
sectors
that
Ruby
is
typically
used
for
is
I
bound.
There
are
still
plenty
of
CPU
bound
workload
in
the
world
floating
around
here
and
there,
and
you
might
occasionally
encounter
them
in
your
app.
B
So,
for
example,
you
might
need
to
crunch
some
numbers.
You
might
need
to
do
some
machine
learning
or
image,
processing,
video
compression,
etc,
etc,
and
sure
we
have
came,
we've
come
a
long
way
with
scripting
languages,
but
it's
still
usually
prohibitively
expensive
to
implement
these
kind
of
heavy
computational
algorithms
and
scripting
languages
like
Ruby.
On
the
other
end
of
the
spectrum.
There's
there
are
low-level
languages
like
C
right,
so
these
are
system
languages
and
they
do.
B
They
basically
have
almost
none
of
the
features
we
love
about
Ruby,
but
since
they
are
much
closer
to
the
metal,
so
this
week
you'll
be
able
to
squeeze
out
every
last
drop
of
performance
you
need
from
them
usually,
and
fortunately
you
can
actually
have
your
cake
and
eat
it
too
and
Ruby.
So
ruby
has
a
pretty
awesome
native
extension
API,
which
allows
you
to
implement
the
expensive
part,
the
computational
part
of
your
program
and
see,
but
expose
them
via
the
same
sweet,
sweet,
Ruby,
syntax
that
we're
we're
used
to
so
to
your
users.
B
Basically,
act
like
exactly
like
a
class
or
a
function
implement
in
Ruby
you
can't
tell
from
the
outside,
but
when
you
call
it
actually
calls
in
to
see
so,
for
example,
again,
this
is
roughly
the
same
source
cargo
when
you
install
a
gem,
is
basically
the
equivalent
of
a
crate
in
rustic.
So
if
you
do
jamming
stop
genes
on
what
you're
actually
getting
here,
you're
actually
getting
to
two
different
things
for
the
price
of
one.
B
So,
first
of
all,
including
the
bundle,
is
a
thing
called:
it's
a
module
called
JSON
Cullen
computer
and
that
basically
implements
the
JSON
encoding
and
decoding
API
in
pure
Ruby.
So
it
works
on
every
platform
that
Ruby
is
supported
and,
however
chances
are
that
you
will
not
actually
be
using
that
in
practice.
If
your
system
supports
it,
the
GM
will
also
compile
and
install
native
extension
called
JSON
colon
colon
txt,
which
basically
reimplement
exactly
the
same
API
in
NC.
B
So
when
you
do
chase
on
cars
and
Ruby,
basically
the
first
time
you
load
the
library
it
detects
out,
do
I
have
the
native
version
of
the
gem.
If
so
and
use
it,
so
you
load
the
native
version
right
and
when
you
do
json.parse
give
it
a
string
would
actually
call
you
see
and
do
the
parsing
and
nam
and
a
much
faster
native
version.
So,
needless
to
say,
the
C
implementation
is
much
faster
than
the
pure
ruby
version,
but
otherwise
there
are
no
notable
noticeable
differences
to
your
end
user.
B
So
I
mentioned
I
work
on
open
source
technology
called
Ruby
on
Rails,
it's
a
web
application
framework
and
just
like
ruby
rails
building
on
top
of
ruby,
also
inherited
a
lot
of
those
velocity
from
ruby,
particular,
particularly
around
programmer
happiness
right.
So
here's
a
quote
from
the
creator
of
ruby
and
rails,
and
I
think
I
will
extrapolate
a
little
bit.
Basically
we're
willing
to
jump
for
a
lot
of
Hoops
to
on
the
implementation
side
to
make
the
user
facing
API
feel
nice
in.
B
In
rails
and
I
think,
a
lot
of
that
spirit
is
shared
by
a
lot
of
the
rest,
libraries
or
what
rest
api
is
that
I
have
been
using
so
far.
So
this
is
one
example
of
the
kind
of
the
kind
of
sweet
api
you
find
in
rubies.
So
this
is
a
active
support.
Core
extension
method
call
screen
blank,
so
here
is
the
implementation
more
or
less
from
some
older
version.
The
difference
like
that,
if
you
go
to
master
date,
that
the
implementation
is
a
little
bit
different,
but
for
a
purpose
it
basically
doesn't
matter.
B
So
this
method,
as
you
would
expect
checks,
is
a
given
string
is
blank.
So
why
would
you
want
to
do
that?
So
actually,
if
you're
writing
web
application
a
lot
of
time,
you
want
to
check
if
an
input
field,
for
example,
user
input-
is
blank
right
like
if
you
submit
a
form,
but
the
only
you
didn't
put
anything
in
the
required
field,
or
you
only
put
white
spaces
in
there.
You
would
want
to
reject
the
form
and
show
an
error
message.
B
So
this
is
one
of
the
most
common
in
this
case,
but
it's
also
used
for
a
lot
of
purpose
and
since
Ruby
allow
us
to
reopen
core
classes,
we
can
basically
just
define
this
method
on
the
string
class,
so
you
can
do
double
pull
the
string,
double
quote
plant
?
and
it
would
work
and
you
don't
have
to
do
any
sort
of
so
it
just
feels
like
it's
part
of
the
core.
Api
ray
is
just
a
mess
it
on
on
the
on
a
string
class.
B
So
that's
pretty
sweet,
perhaps
because
this
method
is
so
the
syntax
is
so
nice,
and
this
is
so
handy.
This
method
is
used
very
extensively
in
all
of
rails
apps,
both
in
framework
code
and
also
in
user
code.
In
fact,
it's
apparently
popular
enough
to
be
one
of
the
performance
bottlenecks.
That's
not
a
bottleneck
per
se,
but
is
a
performant
hot
spot
for
a
lot
of
rails
apps.
So
if
I
mentioned
before,
ruby
has
a
native
extension
API.
So
why
don't
we
implement
this
method
in
C
to
make
it
faster?
B
That's
exactly
what
this
person
called
samsara.
Did
you
basically
made
a
gem
call
fast
blank?
All
you
need
to
do
is
basically
add
it
to
your
gem
file,
which
is
the
equivalent
of
the
car
gold
tunnel.
So
basically
include
this
library
in
your
application,
and
it
transparently
replaces
the
ruby
version
with
a
see
version
and
on
micro
benchmarks.
B
It
could
be
up
to
20
times
faster
and
apparently,
in
some
macro
benchmarks,
you
could
see
up
to
five
percent
improvement
on
the
application
site,
which
is
pretty
impressive
so
now
that
we
have
a
good
way
to
gracefully
you
speed
up
pieces
of
code
and
fall
back
to
peer
review
implementation
if
we
need
to
if
the
platform
doesn't
support
it
our
way
down
here,
why
don't
we
do
this
for
literally
everything
like?
Why?
Don't
we
write
rails
and
see
basically
well
there's
the
problem?
The
problem
is
a
me.
B
The
person
staying
right
here
you
see
mean
godfrey
the
rails,
core
team
member.
I
don't
really
consider
myself
a
system
programmer
sure
I
have
program
in
c
before,
but
I
consumers,
oh
I,
would
say,
I
know
just
enough
to
be
dangerous.
For
example,
if
you
give
me
a
pointer,
I
probably
would
know
how
to
add
enough
stars
to
make
the
compiler
happy.
If
it
doesn't
work,
you
can
try
more
stars
and
if
everything
else
fails,
you
can,
if
everything
fails,
there's
always
ampersand
well
but,
like
obviously
I'm
being
a
little
bit
hyperbolic
here.
B
But
my
point
is
system.
Programming
is
its
heart
rate.
Like
I,
don't
mean
it's
hard
to
learn.
I
don't
mean
the
syntax
it's
hard
to
write,
although
it
is
hard
to
learn
in
the
sin
taxes
hard
to
write.
But
what
I
mean
is
that
it's
hard
to
get
right,
one
small
mistake
in
your
code
and
you
could
soundly
crash
your
program
at
runtime
or
worse.
B
You
can
behave
unexpectedly
in
open
wild
security,
vulnerabilities
like
go
to
fails
and
things
like
that
and
those
people,
obviously
much
smarter
than
I
am
and
if
they
can
get
it
right.
I
have
mag
adults
that
I
want
to
spend
my
free
time.
Writing.
C
code
ships
and
a
lot
of
people's
applications
then
take
responsibility
for
that.
So
basically,
at
the
end
of
their
you
can
do
it.
B
You
have
the
capi
it's
available
to
you,
but
at
the
end
of
the
day,
there's
the
trade-off
is
like
if
the
performance
gain
really
worth
the
risk
right,
like
as
a
person
working
on
rails,
not
being
paid
to
do
it.
In
my
day,
job
am
I,
really
gonna.
Take
the
risk
and
do
that
or
even
even
though,
let's
say
I
am
willing
to
take
the
risk
and
do
it
am
I
really
able
to
find.
B
Of
time
at
Scylla,
we
had
to
face
the
same
trade-off
here
so
the
first
so
skylight
is
a
epic
performance
monitoring
tool
for
rails
applications.
So
we
have
a
agent
that
we
embed
in
kilos,
rails
apps
and
we
collect
basically
performance
information
at
runtime
and
we
send
them
back
to
a
server.
So
we
aggregate
them
and
show
you
a
dashboard
to
highlight
the
performance
promising
apps.
So
the
first
version
of
the
scylla
Adrian
was
written
Ruby.
B
So
that
was
that
that
was
a
natural
choice,
so
to
speak,
because
where
we
need
to
hook
into
your
rails
to
collect
those
performance
data
points.
So
writing
it.
Ruby
is
the
natural
thing
to
do
here,
so
that
solution
lasted
as
a
while
that
very
soon
we
start
running
to
performance
problems
and
memory
issues.
B
So
we
were
able
to
keep
more
or
less
than
in
control,
but
as
we
look
into
adding
more
advanced
performance
features
like
tracking
the
number
of
allocations,
or
maybe
even
the
CPU
profiling,
the
performance
penalty
of
doing
these
things
in
Ruby
is
getting
prohibitively
expensive
and
sometimes
like.
There's
no
even
know
API
for
you
to
do
it
in
pure
Ruby,
so
the
answer
for
this
problem
is
has
always
been.
Obviously
we
care
like.
We
are
a
performance
monitoring
thing,
so
we
obviously
care
about
performance
and
we
can't
slow
down
your
code.
B
So
we
should
just
do
the
right
thing
and
write
our
own
code
as
native
extension
for
our
customers,
but
the
same
question
from
before
remain
right,
even
though
our
engineers
do
understand
the
difference
between
a
reference,
the
reference,
the
reference
and
the
reference
operated.
Do
we
really
feel
comfortable
putting
our
C
code
and
our
customers
production
application
right?
One
small
mistake:
you
could
crash
the
app
or
you
could
be
responsible
for
some
crazy
thing
like
remote
code,
execution,
vulnerability
and
we've.
Do
we
really
trust
ourselves
enough
to
do
that?
B
Can
we
afford
the
risk
and
let's
say
we
ship
that
code?
Will
everyone
on
a
team
be
able
to
work
on
a
code
at
the
same
pace
as
before
and
keep
heading
shipping
new
features?
So
the
question
is:
could
there
be
an
alternative
to
c
or
c++
that
basically
give
us
the
best?
The
the
best
of
both
worlds-
and
I
think
since
you're
here
most
of
you
are
probably
familiar-
will
press,
but
in
case
you're
not
that
russ
is
the
answer
to
that
question
that
we
have
so
a
good
website.
B
Rest
is
the
system
programming
language
that
one's
placing
leaf
last
blah.
So
that's
a
lot
of
buzz
words,
but
I
think
for
me
it
basically
boils
down
to
a
few
things,
and
this
actually
is
in
taken
from
one
of
the
I
think
it's
probably
from
the
rest.
One
point
all
bottles,
but
the
features
for
me
is
first
there's
a
memory.
Safety
without
garbage
collector,
so
just
like
just
like
cers
is
a
compiled
steadily
type
feature,
sorry,
sickly
type,
language,
and
so
before
we
code
is
executed
in
case
you're,
not
in
case
you're.
B
Coming
from
Ruby
or
Python
background,
you
basically
have
to
run
your
code
screw
the
compiler,
which
do
a
lot
of
checks
for
you
and
basically
checks
for
a
large
amount
of
programming
error
and
instead
of
instead
of
allowing
them
to
double
up
at
runtime.
Basically
just
refused
you
compile
your
code
and
like
please
fix
this
before
it
begin
before.
I
will
make
that
work
and
I'm
Lexi
russ
has
a
sufficiently
advanced
type
system
and
a
carefully
designed
feature
set
to
allow
the
compiler,
basically
guarantee
run
primarily
safety.
B
So
in
other
words,
if
you
write
safe
code
and
rest
and
your
program
composite
basically
is
guaranteed
to
not
set
foot
at
runtime.
So
that's
pretty
cool.
The
other
thing
is
concurrency
which
I
won't
really
get
into
today,
but
on
the
so
the
safety
aspect
is
nice,
but
the
coolest
meta
feature
to
me
is
like
idea
of
cereal
call
subtraction,
which
is
a
slogan
you
might
have
heard
from
other
talks
or
rest
blog
posts
before.
B
But
the
idea
is
basically
in
in
high-level
language
like
Ruby,
there's
often
in
tension
between
using
between
writing
or
using
high-level
abstractions
and
performance.
So,
for
example,
it
would
be
nice
if
you
could
break
up
a
large
function,
a
method
into
smaller
pieces
like
smaller
methods,
but
method
calls
aren't
free,
it's
so
in
very
hot
path.
B
You
have
to
make
the
decision
of
what
do
I
really
want
to
incur
the
extra
cost
of
a
method
called
move
this
out
or
do
I
just
want
to
take
the
hit
on
readability
and
just
in
line
everything
here
myself,
and
there
are
also
high
level
things
like
functional
transform
like
that,
each
or
not
map
iterators
and
such
but
they're,
all
so
pretty,
like
they're,
also
slower
than
a
handcraft,
carefully
handcrafted
loop.
Even
if
you
write
it
in
pure
Ruby
right
because
method
calls
and
such
so
most
of
the
time
it
doesn't
matter.
B
Like
I,
said
most
of
time,
you're
found
on
Io
anyway,
so
you
can
do
whatever
you
want,
but
in
in
hot
paths,
you
basically
have
to
make
the
trade
off
and
in
rust
the
idea
is
you
don't
really
have
to
make
these
kind
of
trade
off
as
compiled
language?
The
rest
compiler
is
basically
able
to
use
all
the
type
information
that
I
mentioned
from
the
previous
slide
too
deeply
analyzed
your
code
and
basically
up
dude
those
kind
of
optimization
for
you,
instead
of
you
trying
to
do
it
by
hand.
B
So
in
fact
sometimes
the
rest
compiler
can
produce
faster
code
when
you
use
these
high-level
constructs,
for
example,
when
you
use
an
iterator
in
rest,
the
rest
compiler
can
see
that.
What
is
your
that
the
rest
kampala
can
see
into
the
intent
of
your
code
instead
as
opposed
to
writing
a
loop
and
rust
right?
B
So
if
you
use
iterators
in
rest,
the
rest
compiler
is
actually
able
to
eliminate
the
balance
check
because
it
is
in
control
of
doing
the
loop
instead
of
you
doing
whatever,
so
that
actually
produce
more
optimized
code
compared
to
you
can
carefully
handcrafting
I
begin
Russ.
So
that's
the
general
idea
and
if
you
would
like
to
learn
more
about
as
we
did,
a
talk
at
risk
on
rails
count
2015.
B
That
goes
into
more
details,
but
ok,
let's
go
back
to
fast
blank,
which
is,
if
you
still
remember
the
native
extension
for
making
the
rails
stringed
up
blank
method
faster
by
writing
it
see.
So
here
is
the
implementation,
see
you
probably
can't
read
it,
but
I.
Don't
worry,
I'll,
walk
it
walk
through
that
with
you.
B
So
the
this
is
basically
a
header
you,
if
you're
not
familiar
with
seeds,
basically
declaring
a
function.
Pod
I'll
bestir
blank,
so
this
is
basically
declaring
a
function
called
our
bestir
blank
and
the
value
after
static
is
the
return
type
and
the
value
inside
the
parentheses
is
the
the
type
of
the
argument
and,
as
you
can
see,
in
the
Ruby
capi,
basically
everything
every
Ruby
object
has
this
type
of
value
which
is
actually
typedef
to
avoid
pointer.
B
So
we
will
come
back
to
this,
but
one
of
the
problems
with
operating
at
the
Ruby
C
API
level
is
all
you
get
or
so
I
forgot
to
mention
and
Ruby
everything
is
an
object.
So
a
string
is
object.
A
number
is
an
object.
It's
not
necessarily
implemented
like
that
under
the
hood,
but
they're.
So
there's
a
some
smart
things
like
sometimes
you
notice,
the
integer
is
small
enough.
B
You
can
just
put
it
in
the
pointer
instead
of,
like
you
know
like,
instead
of
actually
allocating
object,
but
conceptually
everything
in
Ruby
is
an
object
and
therefore,
in
the
C
API
level.
Everything
you
thick
and
return
is
basically
this
value
type,
which
is
a
void
pointer.
So
unfortunately,
this
means
not
that
the
c
compiler
is
generally
good
this,
but
because
everything
is
a
void
pointer
to
c
compiler,
basically
have
no
ability
to
do
any
sort
of
check
for
you,
n.
You
would
have
to
remember
to
do
that
check
yourself
at
runtime.
B
Otherwise,
if
you,
if
you
think,
you're
getting
a
string
in
the
value
pointer,
but
it's
actually
a
number
for
some
reason,
then
things
would
go
horribly
wrong
in
your
extension
of
probably
seg
fault
or
do
something
really
strange.
So
that's
the
that's
the
header
of
the
function,
and
there
are
some
boilerplate
at
the
top
that
then
the
next
thing
is
basically
immediately.
B
It
caused
a
macro
called
our
string
length
and
if
the
string
is
empty
like
if
the
length
of
the
string
is
zero,
it
immediately
returned
free
because
I
empty
string
is
a
blank
shrink
right.
So
this
is
one
of
the
things
I'm
talking
about,
so
our
string
length.
Obviously
that
only
works
if
you
pass
a
ruby
string
to
it.
If
you
try
to
pass
a
ruby
object
or
try
to
pass
a
number,
it
will
probably
try
to
do.
B
I
would
probably
try
to
do
some
offset
from
that
pointer
and
look
into
some
weird
memory,
location
and
returns
a
complete,
like
maybe
a
negative
number
who
knows
right.
So
this
is
the
kind
of
dangerous
things
you
need
to
be
thinking
about.
You
need
to
be
really
sure
that
this
method,
this
function
is
getting
a
ruby
string
as
input.
Otherwise
this
line
right
here
could
probably
set
for
Europe,
see
extension
and
the
compiler
can
warn
you
about
that
because,
as
far
as
the
compiler
can
tell,
everything
is
a
void
pointer.
B
So
then
the
the
guts
of
the
program
is
basically
a
while
loop
and
because
all
the
strings
in
Ruby
is
utf-8
strings
based.
Actually,
that's
not
true,
but
in
practice
most
of
this
Ruby
strings
you're
dealing
with-
and
here
we
implicitly
making
an
assumption
that
this
is
a
unicode
utf-8
string.
So,
as
you
know,
utf-8
character
is
not
necessarily
fixed
length
in
terms
of
bytes,
so
you
cannot
just
do
it
for
full
loop
and
incremental
pointer.
B
So
this
is
why
this
is
a
while
loop
and
you
have
to
go
through
some
other
macros
to
check
whether
you're,
at
the
end
of
the
string
and
then
there's
some
more
bola
played
and
then
there's
basically
a
switch
statement
and
and
in
the
guts
of
the
switch
statements,
basically
in
enumeration
of
all
the
known
Unicode
whitespace
characters.
So
basically,
if
you,
if
you
saw
white
space
character,
you
can
continue
to
the
next
iteration
of
the
loop.
B
Otherwise
you
return
false
immediately,
so
you
saw
non
whitespace
characters
with
the
strings
is
not
blank
and
then,
finally,
if
you
got
to
the
end
of
the
string
and
all
you
have
seen
our
whitespace
characters,
then
you
can
return
true,
because
that
means
you're
assuring
is
blank.
So
this
is
the
implementation
of
the
sea
version
of
the
of
the
blank
method.
So
I
know
this
is
around
50
lines
of
code
and
ce4.
So
writing
50
lines
of
code
for
20
times
speedup.
B
B
So
that
is
not
necessarily
a
truthful
thing,
but
let's
take
care
of
that
for
us
and
then
we
call
the
DA
method,
which
takes
a
thing
that
looks
roughly
like
a
closure
and
you're
basically
saying
for
each
character
in
the
string
check
if
the
character
is
a
white
space
character
and
his
white
spaces
also
Stan
library
function
and
thus
that
basically
takes
care
of
the
hand
you
numerated
list
of
whitespace
characters
for
you,
so
in
case
unicode
decide
to
add
more
whitespace
characters.
You
are
good
here.
B
You
have
to
recompile
your
program,
but
you
don't
have
to
maintain
the
list
yourself.
So
actually,
if
you
still
remember
the
ruby
version,
I
skipped
a
bunch
of
satellites,
sorry
that
basically
this
is
pretty
straightforward.
So
so,
let's
see
how
they
compare.
So
surprisingly,
this
one
liner
thing
in
Rus,
it's
pre,
it's
pretty
fast,
it's
basically
in
the
same
ballpark
as
to
see
version.
B
B
So
that's
great,
but
I
have
a
confession
to
make.
I
have
not
been
completely
honest
with
you,
while
the
this,
the
rest,
one
liner,
is
much
shorter
than
the
sea
version.
That's
not
all
the
code.
You
need
to
write
the
native
extension
so
to
make
your
work,
you
have
to
write
plenty
of
glue
code,
both
in
the
sea
and
the
rest
version.
So,
let's
take
a
look.
The
highlighted
portions
was
on
the
left
is
the
rest,
the
full
body
of
the
rest
native
extension
and
on
the
right.
That's
a
sea
version.
B
The
highlighted
version
is
what
I've
shown
you
on
the
slides
in
the
previous
slides
and
the
not
highlighted
version
is
the
code
that
didn't
show
you
on
the
seaside.
You
can
see
it
even
though
the
actual
implementation
thing
is
very
long,
the
bowl
or
plate
is
there
like
it's
pretty
minimal
and
on
the
rough
side
you
can
see
that,
even
though
the
actual
implementation
is
very
short,
the
boilerplate
basically
add
up
to
the
same
amount
of
code
as
the
sea
thing.
B
So
this
is
not
all
bad
news
like
for
one
thing:
we
turn
to
rust
because
we
wanted
speed
and
safety.
So
if
we
got
both
of
them
and
that
is
achievable
with
the
same
amount
of
code,
that's
still
a
win,
but
furthermore,
the
if
you
think
about
it,
the
highlighted
portion
as
I
said,
is
the
implementation
of
the
extension
right.
So
that's
the
actual
logic
that
you're
trying
to
write.
So
you
have
to
write
that
code
every
single
time.
You
want
to
write
a
method,
because
that's
what
your
method
trying
to
do
right.
B
On
the
other
hand,
the
boilerplate
is
mostly
code
that
can
be
shared
across
extension,
you
just
have
to
write
the
same
kind
of
like
not
exactly
the
same
lines
of
polar
Piper.
You
roughly
read
the
same
kind
of
boilerplate
for
each
extension
and
they
can
be
shared
so
in
the
glue
code
is
shareable
whenever
you
eight,
if
someone
did
the
work
to
extract
them
in
the
library
and
I'm
very
glad
yes,
because
that's
what
you
and
I
have
been
working
on,
we
have
been
what
come
this
thing
called
helix.
B
You
can
talk
to
him
afterwards,
but
I
helix
is
basically
a
language
rich
between
Russ
on
Ruby,
so
currently
we're
focused
on
implementing
Ruby
code
in
rust
rates,
so
implementing
Ruby
classes
and
rest,
but
so
we're
not
super
focused
on
embedding
ruby
from
the
west
side
yet,
but
eventually
the
code
is
probably
shareable
for
both
purposes,
but
for
now
this
is
about
embedding
rust
code
like
rust
native
extension
inside
we
be
so
let's
look
at
how
you
would
implement
fast
blank
with
helix
and
this
time,
I
promise.
This
is
Otto
code
right.
B
So,
thanks
to
rust
macro
system,
we
were
able
to
abstract
away
most
of
the
velocity
and
distill
it
down
to
the
parts
that
you
actually
care
about
in
the
syntax.
That
should
be
pretty
similar
to
rubios,
and
we
should
thank
dave
herman
for
for
paving
the
way.
If
you
worked
on
a
thing
called
neon,
which
is
the
v8
binding
for
wrestling,
we
were
able
to
steal
a
lot
of
these
macros
from
them.
I
guess
I
will
quickly
walk
through
this,
although
I'm
running
out
of
time.
B
So
basically
we
have
a
declarar
types
macro
and
then
inside
there
we
say
we
open
class
Ruby
string
and
then
we
define
a
method,
and
this
is
based
roughly
the
same
syntax.
You
will
use
in
Ruby
and
inside
here.
Finally,
this
is
the
one-liner
we
saw
on
the
screen
earlier,
so
the
implementation
to
boilerplate
ratio.
Here
is
pretty
small
and
pretty
happy
about
that,
and
so
we
talked
about
how
in
the
review
capi
everything
is
a
void
pointer.
B
Basically-
and
this
is
prom
attic
because
we
like
with
with
that
kind
of
API,
we
we're
very
easily
we-
we
can
very
easily
read
code
that
was
sexual,
so
the
cool
thing
about
helix
here
is
because
the
rough
type
system
is
so
much
more
expressive.
We
can
actually
implicitly
encode
all
the
the
type
the
types
guarantee
that's
not
actually
found
in
the
original
really
API
into
the
type
system.
So
if
you
actually
say
that
you
take
the
string,
what
we
will
do
is
will
generate
the
will
will
take
it.
B
Unchecked
value
in
them
will
generate
like
helix.
Here.
Will
generate
the
code
that
do
the
runtime
check
to
confirm
that
is
actually
a
string
and
then,
if
it's
not
a
strangle
off
road
will
be
runtime
error
to
the
user
like
pretty
much
what
they
they're
used
to
derail.
If
we
call
method
with
the
wrong
argument,
you
would
get
a
runtime
argumenterror,
which
you
can
rescue
and
stuff,
but
we
basically
won't
hand
the
value
to
your
coat
if
it
doesn't
match
to
type.
B
B
Guess
we'll
do
I
plan
to
do
some
more
stuff
and
like
now
that
we
have
this
setup,
we
can
do
some
more
Bailes
features
like
we
can
experiment
with
doing
some
more
rails
features
in
in
russ,
and
that
would
be
pretty
cool,
and
you
can
also
write
some
of
your,
like
the
number-crunching
part
of
your
app
in
an
rust
that
will
be
pretty
cool
as
well.
I
actually
have
an
example
which
I
won't
have
time
to
go
into
today,
but
I
actually
wrote
a
blog
post
about
this.
B
A
B
We
will
talk
about,
although
I
didn't
actually
tell
you
what
the
code
is,
but
you
can
see,
as
you
can
see,
I've
made
a
graph
and
the
rest
thing
is
much
faster.
So
you
know
it's
like
you
see
a
graph,
so
you
know
it's
legit
anyway.
So
here
is
the
github
repo.
For
this
and
again
you
can
google
introducing
helix
and
you'll
find
a
blog
post
with
more
information.
B
So,
finally,
I
would
like
to
wrap
up
with
this
I'm.
Surprisingly,
scripting
languages
like
we
be
are
intrinsically
slower
than
system
languages
like
C
or
rust,
and
historically
scripting
languages
were
really
designed
to
be
used
as
a
coordination
layer
between
and
they
usually
delegate
to
the
heavier
tools
like
that's
written
in
some
languages.
B
So,
for
example,
you
might
write
a
bash
script
that
delegates
to
the
eunuch
utility
like
sword
and
grab
and
wc
those
all
written
in
system
languages
like
C,
so
you're,
basically
not
doing
a
lot
in
your
scripting
layer,
historically
and
they're,
just
basically
coordinating
the
heavier
tools
but
as
I
mentioned
before,
because
a
lot
of
the
real
world
workload
actually
turned
out
to
be
outbound.
Pure
performance
is
not
always
very
important
and
because
scripting
languages
tends
to
be
a
lot
more
pleasant
to
use
and
they're
easy
to
iterate
on
ins
and
so
on.
B
We
end
up
moving
a
lot
more
of
a
code
into
the
scripting
layer.
Instead
of
writing
everything
in
system
languages
and
since
web
applications
are
especially
I'll
heavy
that
worked
out
great
for
things
like
we're
being
red,
ruby
on
rails,
but
I
think
we're
now
entering
an
era
where
programming
languages
implementers
have
taken
more
and
more
of
the
ergonomics
side
of
things
from
scripting
languages
and
starting
to
add
those
features
back
to
performance,
critical
languages
like
rest
right.
B
So
our
goal
with
the
hill
expression
has
led
people
from
the
Ruby
community
to
keep
writing
the
Ruby
that
they're
used
to
in
love
and
without
fearing
that
eventually
they
will
hit
a
performance
wall.
So
what
Felix?
You
can
always
start
with
your
Ruby
app
and
whenever
you
realize
you
have
and
you'll
always
know
that
you
have
the
option
to
move
certain
parts
of
your
code
to
rust.
B
So
that's
basically
I'll
start
with
helix,
and
this
is
a
very,
very
early
preview
of
helix
and
there's
still
plenty
of
work
to
do
and
we're
just
working
on
it
this
weekend
actually,
and
we
have
a
lot
more
interesting
problems.
I
have
time
to
cover
here,
but
yeah.
I
think
the
the
future
for
this
kind
of
stuff
is
pretty
bright
and
it's
pretty
cool.
That
thus
is
enabling
us
to
do
these
kind
of
postings.
So
I
think
that
is
it
for
my
talk
and
we
can
chat
more
afterwards.
B
That
is
a
good
question,
so
I
can
tell
you
we're
not
quite
that
far
with
helix
yet,
but
we
do
actually
ship
a
skylit,
so
skylight
has
been
the
scott
GM.
The
style
agent
has
been
written
in
rust
for
probably
coming
to
two
years
or
something
like
that.
So
we've
been
shipping
that
two
plus
two
customers
apps
for
a
long
time
and
the
way
we
do
it.
It
is
really,
depending
on
the
scenario
of
your
deployment
right.