Bending the curve
A personal tutor at your fingertips
Esteban Küber
he / him
@ekuber
@estebank
Bending the curve
A personal tutor at your fingertips
Esteban Küber
he / him
@ekuber
@estebank
Bending the curve
A personal tutor at your fingertips
Esteban Küber
he / him
@ekuber
@estebank
Bending the curve
So you want to write a programming language
A personal tutor at your fingertips
that people use
Esteban Küber
he / him
@ekuber
@estebank
Explore
Mental map
[pizza place pic next to red house]
[fancy pizza shop]
[city bus pic in the background with travel card in the foreground]
[intentionally left blank]
[pizza place pic next to red house]
[CODE]
Why design a
programming language?
Why design a
programming language?
Objectives
[copyrighted character missing]
Objectives
[crate and code showing file split]
Don’t try to read this 🙃
Objectives
Objectives
Language design
Type[ParamA, ParamB]
Type<ParamA, ParamB>
Type[ParamA, ParamB]
Type<ParamA, ParamB>
Type::<ParamA, ParamB>
null
Steve Klabnik
Don’t try to read this 🙃
Arc<RefCell<T>>
TL;DR:
Many things affect how easy to learn a language
💸
Many things affect how easy to learn a language
Many things affect how easy to learn a language
“Introducing a new tool to aid your learning”
“Introducing a new tool to aid your learning”
Tuto.rs
“Introducing a new tool to aid your learning”
Tuto.rs
“Introducing a new tool to aid your learning”
Tuto.rs
[citation needed]
Types of errors
[Extra > in path]
Type ascription
Types of errors
[Cartesian space IN/OUT b&w]
[Cartesian space IN/OUT b&shades of grey]
the tutor needs context,�knowledge of the tutee
the tutor needs context,�knowledge of the tutee
the tutor needs context,�knowledge of the tutee
and it has it
[contextless error that we already handle]
[“oracle” diagnostics paper front or conclussions page]
&str vs String
String
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
len | ptr |
12 | |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
capacity | len | ptr |
12 | 12 | |
&str
str
this is in the heap!
std::string::
&str vs String
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
this is in the heap!
String
capacity | len | ptr |
12 | 12 | |
std::string::
&str vs String
len | ptr |
2 | |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
&str
&str
this is in the heap!
len | ptr |
5 | |
&str
len | ptr |
12 | |
String
capacity | len | ptr |
12 | 12 | |
std::string::
&str vs String
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
len | ptr |
12 | |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
&str
str
this is in the heap!
String
capacity | len | ptr |
12 | 12 | |
std::string::
&str vs String
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
len | ptr |
12 | |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
&str
str
this is in the heap!
Vec<u8>
Vec<char>
Utf-8�Utf-16
utf-32
&String
impl Deref<Target=&str> for &String
OsString
Path�\0
Sized
?Sized
‘a
String
capacity | len | ptr |
12 | 12 | |
std::string::
&str vs String
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
len | ptr |
12 | |
| | | | | | | | | | | |
h | e | l | l | o | , | | w | o | r | l | d |
&str
str
this is in the heap!
If you’re coming from Java,
this is a StringBuffer
If you’re coming from C,
this is string literal in your binary
If you’re coming from C++,
this is string_view
String
capacity | len | ptr |
12 | 12 | |
std::string::
Don’t try to read this 🙃
Don’t try to read this 🙃
Don’t try to read this 🙃
[XML vs JSON: simplicity of the language has a benefit]
To summarize