►
Description
The language that isn't: what Rust could be today, if it decided to reject its current constraints.
https://rustfest.global/session/58-el-lenguaje-que-no-es/
Español: https://www.youtube.com/watch?v=T1POpGXuYYs
A
Hello,
hello,
we
are
back.
How
did
you
find
what
santi
showed
us
earlier?
It
was
really
good
plus
I
have
the
big
screen,
so
I
was
able
to
see
the
entire
sequence
of
images
and
then
the
music-
I
don't
know
everybody
else,
but
whenever
I
see
something
like
this,
I
feel
like
I
want
to
create
something.
I
want
to
go
out
and
program
code,
something
that's
the
feeling
again.
Yes,
it's
like
inspiring
to
go
out
and
do
something
anything.
A
It
was
really
good,
so
if
you
want
to
follow
him,
you
know
you
can
find
him
on
twitter
and
we
are
ready
to
go
on
with
our
next
presentation
right.
Yes,
well,
what
can
I
tell
you?
All
of
the
presentations
have
been
great
and
I
think
this
one
is
going
to
be
really
really
interesting.
I
was
reading
a
little
about
what
we're
going
to
be
hearing
about
the
wrong
code.
That
federico
was
telling
us
about
earlier,
so
we're
going
to
have
esteban
curry
with
us.
A
He
is
a
member
of
the
gross
complex
compiler
recording
in
progress,
recording,
stop
multiple
engineer
in
amazon,
recording
in
progress,
so
he's
going
to
introduce
himself
before
he
starts
his
presentation,
but
I'm
excited
to
hear
everything
he
has
to
tell
us
it's
great
to
have
you
with
us
steven.
Thank
you.
B
B
B
B
B
B
If
we
translate
from-
and
it's
really
easy
to
learn,
even
if
you
do
not
know
the
language,
you
have
an
idea
of
what
this
code
does.
So
if
we
translate
that
to
rust,
the
compiler
is
not
going
to
be
happy.
This
code
is
missing
a
lot
of
things
to
be
valid.
The
arguments
have
to
have
a
type
the
return
type.
It's
not
present
is
the
unit,
so
we
have
to
have
something
there
and
finally,
to
be
able
to
print
the
value
of
the
function.
B
B
B
On
the
other
hand,
if
we
have
a
type
that
can
be
printed
in
the
python
version,
we
just
find
an
exclusion
data
exception
and
in
rust
that
failure
mode
is
impossible.
Okay.
Well,
it's
not
impossible,
but
it's
a
lot
less
common,
and
it's
not
going
to
happen
in
this
case,
but
if
we
want
the
same
flexibility
of
python
in
our
code,
what
can
we
do?
An
option
is
to
use
type
parameters
and
these
parameters
work
very
differently
from
python
or
for
the
same
case
as
java.
B
They
use
a
process
of
monomorphization.
This
is
a
very
complicated
work
word.
That
means
that
the
compiler
checks
all
the
uses
of
this
function
with
these
type
parameters
and
creates
the
machine
code
for
every
combination
that
it
sees
so
it
copies
and
pastes
the
same
function
of
many
times
replacing
the
parameters
with
the
types
that
were
used.
B
B
We
here
find
this
situation
in
which
rust
prefers
to
be
explicit.
Why?
Because
the
compiler
can
see
that
all
the
uses
of
the
function
of
the
t
function
implement
display
and
allow
it,
but
this
means
that
the
contract
of
the
api
in
the
function
is
implicit,
so
changes
in
the
body
of
the
function
can
cause
changes
in
the
contract
and
that
the
existing
code
stops
working,
certainly
or
allowing
code
that
should
be
rejected.
B
So
this
would
necessarily
mean
that
it
would
be
evaluated
all
the
types,
so
compilation
would
be
slower.
It
would
complement.
It
will
also
complement,
complicate
good
errors
of
compilation.
These
terrible
errors
of
c
plus
plus
are
usually
caused
when
you
incorrectly
use
an
api
of
a
function
that
it
is
behind.
The
template
templates
work
in
that
way
that
I
just
described
without
extra
information
about
restrictions.
B
B
B
B
They
allow
you
to
change
implementation
during
execution
and
to
have
only
one
implementation
in
the
algorithm,
while
different
types
are
ongoing.
So
the
algorithm
needs
to
know
how
to
find
the
different
methods
in
the
virtual
table
in
memory.
The
virtual
table
is
a
pointer
to
the
real
value
and
another
pointer
to
the
list
of
all
methods
that
this
value
has
with
a
consistent
formatting
that
does
not,
and
it
doesn't
matter
the
real
value.
B
So
this
is
very
flexible,
but
it
has
a
cost
now,
every
time
that
we
call
a
method
over
the
trade
object,
the
executable
has
to
go
after
pointers.
The
position
of
the
data
in
memory
can
be
anywhere
and
making
execution
or
running
very
slower
compilers
can
help
turning
virtual
calls
in
the
same
code.
That
would
have
parameters
that
are
monomorphized,
but
the
cost
should
be
paid
for,
on
the
other
hand,
in
most
cases,
the
speed
of
monomorphization
is
not
necessary,
so
we
can
use
trade
options.
B
There
are
also
restrictions
of
the
type
objects
of
the
trade
objects
about
which
ones
can
be
valid,
some
that
have
functions
that
are
associated
constant,
which
are
associated
or
types
which
are
not
representable
today,
as
trans
straight
options,
each
of
these
restrictions
have
the
same
underlying
reason.
How
do
we
represent
these
elements
in
memory
with
the
constants?
B
We
would
have
some
alternatives
of
implementation
for
associated
functions.
We
would
have
some
possibilities
and
as
users
nowadays
as
programmers,
we
can
transform
the
associated
function
in
a
method,
adding
a
self
method
that
the
implementation
does
not
use,
but
the
associated
types
is
more
complicated
because
any
representation
of
the
types
will
request
to
assess
types
during
the
execution
time.
Not
the
compilation,
time
and
rust
is
not
in
conditions
to
do
nowadays.
B
B
B
This
option
also
gives
us
flexibility.
We
can
leave
that
function
without
modification,
the
one
that
we
had
originally,
but
we
can
implement
the
corresponding
trait
for
the
enum.
But,
as
you
can
see,
it's
a
lot
of
work,
we
have
to
write
a
lot,
and
nowadays
this
repetition
we
can
eliminate
it
with
macros
or
procedural
macros.
B
But
how
would
the
language
be
if
this
pattern
would
were
easier?
A
proposal
that's
going
around
is
to
implement
anonymous
email
enums,
that's
to
restrict
the
types
that
are
accepted,
as
arguments
are
returned
with
function
with
heterogeneous
types
and
since
all
available
types
are
a
closed
group.
That
is
that
the
compiler
knows
exactly
what
types
are
possible
different
from
trades.
B
This
change
would
not
be
revolutionary.
None
of
this
is
very
complex
when
implementing
it,
and
I
can
bet
that
something
similar
to
this
will
exist
in
the
future
in
the
future.
And
if
you
look
at
the
syntax
that
I'm
proposing
here,
we
can
see
that
there's
a
direct
relationship
between
traits
and
enums
algebraic
groups
that
are
open
and
closed.
It's
the
same
concept
with
different
uses.
B
If
I
were
a
gambler,
which
I
am
not,
I
would
bet
that
in
the
future,
the
distinction
between
traits
and
enums
are
going
to
be
minimal
and
it
would
be
easy
to
trade
between
one
another,
but
while
you're
experimenting,
all
these
details
are
irrelevant.
Everything
that
you
want
to
achieve.
It
is
to
explore
the
different
designs
that
you
can
want,
depending
on
the
domain
that
you're
working
with.
B
B
B
B
B
B
One
of
the
cases
that
we
see
very
often
and
it
causes
confusion-
is
the
types
that
represent
text.
I'm
not
going
to
be
very
detailed
about
this.
This
would
be
a
talk
in
itself,
but
knowing
that
there
are
string,
slices
and
allocation
of
strings,
you
can
make
the
argument
that
the
type
of
string
by
default
would
have
to
be
copy
and
write.
B
So
this
type
by
having
two
screen
slices
and
mutating
them,
it
turns
into
an
allocated
string,
so
we
must
differentiate
between
both
of
them.
I
don't
think
this
is
a
change
that
is
going
to
occur
in
the
language
because
being
able
to
identify
when
we
are
allocating
memory
and
when
we
are
using
memory.
That's
already
allocated
it's
important
for
high
performance
programs,
but
at
the
same
time,
it's
very
easier
to
turn
a
slice
into
string
to
a
copy
on
right
stream.
B
B
Nowadays,
what
you
do
is
write
more
code
and,
let's
let
it
work
and
nightly
when
the
with
the
box
type
in
particular,
there
is
a
special
syntax
and
I
have
used
it
in
the
compiler,
it's
very
useful,
but
it
does
not
have
a
stabilization
path
right
now.
However,
there's
a
project
to
allow
pattern
matching
to
take
advantage
of
autodraf
in
all
the
container
types
or
at
least
those
from
the
standard
library
that
have
been
opted
in
the
syntax
is
not
finished
yet,
but
probably
that
probably
there
won't
be
new
syntax.
B
B
B
This
is
the
problem
that
I'm
going
to
mention
is
the
diamond
problem,
because
if
they
inherit,
they
have
a
lot
of
paths
to
the
same
origin.
They
have
a
strict
algorithm
for
the
super
class
members
and
others
force
you
to
specify
the
path
to
specify
the
superclass
when
the
case
is
ambiguous
or
just
not
allow
you
to
have
a
class
two
other
classes,
so
you
can
imagine
the
following
syntax,
but
it
does
not
exist.
B
B
B
B
B
B
So
I'm
convinced
that
in
the
next
year
we
are
going
to
be
able
to
use
translators,
to
write
iterations
implicitly
and
it's
similar
to
what
you
would
do
in
python.
This
code
is
equivalent
to
the
previous
one,
it's
exactly
the
same
and
they
compile.
To
the
same,
and
to
close,
I
would
like
to
talk
about
clone
when
we
call
clone.
B
B
So
this
is
one
of
the
cases
in
which
I
am
unsure,
but
I
think
that
in
the
next
two
editions
we
can
get
to
change
the
language
to
wrote
clone
less
so
now.
To
close,
I
just
showed
screenshots
from
different
parts
of
the
language
which
you
probably
knew
won
some
of
them,
but
perhaps
they
give
you
some
hope
that
perhaps
these
features
can
be
brought
down
a
bit
and
that
now
you
may
know
what
to
do
to
avoid
them.
Thank
you
very
much
for
your
time.
B
B
Probably
what
I
would
try
to
do
is
helping
matlab
and
all
the
people
that
are
working
at
rust,
analyzer
to
achieve
parity
in
the
way
that
we
show
errors,
because
the
compilers,
when
you
call
it
from
the
terminal
there
are
a
lot.
There
is
a
lot
of
effort
that
it
looks
somewhat
understandable,
regardless
of
your
experience
level,
but
in
rust,
analyzer,
which
makes
an
impressive
effort
to
be
useful.
B
Unfortunately,
presentation
is
not
the
same
quality
nowadays
and
part
of
that
is
the
apis
provided
by
visual
studio
code.
They
do
not
allow
us
they
do
not
allow
us
to
do
it.
There
are
some
alternatives
that
have
explored,
but
they
would
explain,
imply
a
lot
of
work
to
be
able
to
have
it.
So
that
would
be
the
first
thing
that
I
would
like
to
do
that
the
experience
in
id
is
even
better
than
what
it
is
in
the
terminal
so
and
also
things
such
as.
B
Making
the
compiler
stateful,
meaning
that
it
has
memory.
So
if
you're
calling
the
compiler
constantly
and
we
are
just
going
in
circles,
the
compiler
can
detect
that
and
tell
you
here.
Look
here:
you're,
just
trying
the
same
thing
all
over
and
over
maybe
try
something
else:
yeah
exactly
that
yeah.
I
think
that
this.
That
is
one
of
the
things
that
we
can
do,
and
there
are
a
lot
of
ideas.
B
B
B
B
B
B
B
And
the
slipped
chat
of
roslang
those
two
places
are
very
good
places
to
start.
So
can
you
do
me
a
giant
favor?
Are
you
on
twitter?
Yes,
I
am.
Can
you
please
tweet
this,
because
with
the
conference
account,
we
can
retweet
this
and
if
someone
who's
watching
is
just
inspired
to
see
you
and
well.
I
had
this
idea
for
months
and
I
want
to
share
it.
B
So
my
idea
is
to
take
any
idea
to
evolve
the
language
taking
it
to
those
two
languages
is
to
those
two
places
is
the
best
idea
to
get
it
to
people
who
think
like
you
and
to
receive
feedback
about.
What
can
you?
What
could
you
have
missed
because
you
are
sometimes
thinking
that
you
are
planning
for
months
and
somebody
else
tells
you
yeah.
Do
you
know
that
that
already
exists
yeah
that
happens
well.
Thank
you.
So
much.