SlideShare a Scribd company logo
Learning Rust
experiences from a Python/Javascript developer
Rust Denver
“The value of another’s experience
is to give us hope, not to tell us
how or whether to proceed”
Rust Denver
“The Answer to How is Yes”
by Peter Block
Rust Denver
Hi, I’m Juhis!
from Helsinki, Finland 🇫🇮
(it’s 3.30 am here)
Developer Advocate at Futurice
I build developer communities
https://hamatti.org
twitter.com/hamatti
Python & Javascript
Rust Denver
Dom Weldon’s talk in PyCon Estonia 2019
Rust Denver
Rust Denver
Advent of Code 2020
Rust Denver
fn main() ->- io:::Result<()> {
let mut buffer = String:::new();
io:::stdin().read_to_string(&mut buffer)?;
let input: Vec<i32> = buffer
.split('n')
.filter(|inp| inp !!= &"")
.map(|num| num.parse().unwrap())
.collect();
let input2: Vec<i32> = input.clone();
match find_double(input) {
Some(result) =>= println!("Part 1: {}", result),
None =>= panic!("Oh no!"),
}
match find_triplet(input2) {
Some(result) =>= println!("Part 2: {}", result),
None =>= panic!("Oh no!"),
}
Ok(())
}
Advent of Code #1: Getting Started
Advent of Code #2: Borrows, unwraps
and lots of compiler errors
Advent of Code #3: Slowing down
I started to build a CLI tool
Rust Denver
235
NHL results on
command line
https://crates.io/crates/nhl-235
❤ Things I really like, #1 ❤
Rust Denver
Pattern Matching
Rust Denver
for pair in score_iter {
match pair {
Both(l, r) =>= print_full(l, r),
Left(l) =>= print_left(l),
Right(r) =>= print_right(r),
}
}
Pattern Matching
Rust Denver
❤
We’re getting it
in Python too this year
https://www.python.org/dev/peps/pep-0634/
🙈 Things I struggle with, #1
Rust Denver
Static typing
(esp. when nesting custom types)
Rust Denver
##[derive(Debug, Serialize, Deserialize)]
pub struct APIResponse {
pub date: DateResponse,
pub games: Vec<GameResponse>,
pub errors: Option<HashMap<String, serde_json:::Value>>>,
}
##[derive(Debug, Serialize, Deserialize)]
pub struct DateResponse {
pub raw: Option<String>,
pub pretty: String,
}
What I’ve done
Rust Denver
##[derive(Debug, Serialize, Deserialize)]
pub struct APIResponse {
pub date: {
pub raw: Option<String>,
pub pretty: String,
},
pub games: Vec<GameResponse>,
pub errors: Option<HashMap<String, serde_json:::Value>>>,
}
What I’d like to do
❤ Things I really like, #2 ❤
Rust Denver
rustdoc & doctests
Rust Denver
impl Person {
///// Returns a person with the name given them
/////
///// # Arguments
/////
///// * `name` - A string slice that holds the name of the person
/////
///// # Examples
/////
///// ```
///// /// You can have rust code between fences inside the comments
///// /// If you pass ---test to `rustdoc`, it will even test it for you!
///// use doc:::Person;
///// let person = Person:::new(“Juhis");
///// assert_eq!(person.name, String:::from(“Juhis”));
///// ```
pub fn new(name: &str) ->- Person {
Person {
name: name.to_string(),
}
}
}
🙈 Things I struggle with, #2
Rust Denver
Ownership, borrows,
lifetime, references
Rust Denver
The Rust Borrow Checker: A Deep Dive - Nell Shamrell-Harrington
Rust Denver
Rust Denver
“The Rust compiler is very kind and I tweeted last
week about how the language matters. When I'm
stressed about all the red in my terminal, a kind
tone of voice the compiler has definitely makes it
easier to deal with.” “Advent of Code #2: Borrows,
unwraps and lots of compiler errors”
by me
🙈 Things I struggle with, #3
Rust Denver
Verbosity and cascade
of error handling
❤ Things I really like, #3 ❤
Rust Denver
Rustaceans
Rust Denver
Learning Rust
A monthly blog series
https://hamatti.org/blog/
#1: Pattern Matching
#2: Option & Result
#3: crates.io
#4: Parsing JSON with strong types
#5: Rustlings
+ new one every first Wed of the month
Rust Denver
codebase
Livestream on Youtube
https://hamatti.org/codebase
#1: Accessible forms with HTML
#2: Backend with Clojure
#3: PHP is awesome
#4: Frontend with Web Components
+ new one every month
Rust Denver
Thanks for having me!
Time for Q&A!
For more of me
@hamatti in Twitter
hamatti.org
Ad

Recommended

PPTX
Lightning talk: Go
Evolve
 
PDF
ExtJS勉強会@名古屋
Tsuyoshi Yamamoto
 
PDF
Zsh shell-for-humans
Juan De Bravo
 
PDF
Zsh & fish: better *bash* for hackers
Ruslan Sharipov
 
PDF
Basic NLP with Python and NLTK
Francesco Bruni
 
PDF
Linux system admin
Mohammed Zainul Abiddin
 
PPTX
Unix - Shell Scripts
ananthimurugesan
 
PPTX
Programming - Marla Fuentes
mfuentessss
 
PDF
Tech talk 01.06.2017
AboutYouGmbH
 
PPT
01 linux basics
Robson Levi
 
PDF
Crystal Rocks
Brian Cardiff
 
PPTX
Scripting 101
ohardebol
 
PDF
Why Zsh is Cooler than Your Shell
jaguardesignstudio
 
PPT
Talk Unix Shell Script
Dr.Ravi
 
PDF
Learning go for perl programmers
Fred Moyer
 
PDF
bash
Gaurav Saxena
 
PDF
Understanding our code with tests, schemas, and types
Mark Godfrey
 
PDF
Bash 4
Pieter Colpaert
 
PDF
Natural Language Processing(SupStat Inc)
Vivian S. Zhang
 
PDF
The hacker choice
Flavio Castelli
 
PDF
Rust All Hands Winter 2011
Patrick Walton
 
PDF
Why zsh is Cooler than Your Shell
brendon_jag
 
PDF
Vim Hacks (OSSF)
Lin Yo-An
 
PDF
Opa hackathon
Henri Binsztok
 
DOC
How to send files to remote server via ssh in php
Andolasoft Inc
 
PPT
Chap06
Dr.Ravi
 
PPT
Shell Scripts
Dr.Ravi
 
PPT
Talk Unix Shell Script 1
Dr.Ravi
 
PPT
2007 09 10 Fzi Training Groovy Grails V Ws
loffenauer
 
PPTX
How Secure Are Docker Containers?
Ben Hall
 

More Related Content

What's hot (20)

PDF
Tech talk 01.06.2017
AboutYouGmbH
 
PPT
01 linux basics
Robson Levi
 
PDF
Crystal Rocks
Brian Cardiff
 
PPTX
Scripting 101
ohardebol
 
PDF
Why Zsh is Cooler than Your Shell
jaguardesignstudio
 
PPT
Talk Unix Shell Script
Dr.Ravi
 
PDF
Learning go for perl programmers
Fred Moyer
 
PDF
bash
Gaurav Saxena
 
PDF
Understanding our code with tests, schemas, and types
Mark Godfrey
 
PDF
Bash 4
Pieter Colpaert
 
PDF
Natural Language Processing(SupStat Inc)
Vivian S. Zhang
 
PDF
The hacker choice
Flavio Castelli
 
PDF
Rust All Hands Winter 2011
Patrick Walton
 
PDF
Why zsh is Cooler than Your Shell
brendon_jag
 
PDF
Vim Hacks (OSSF)
Lin Yo-An
 
PDF
Opa hackathon
Henri Binsztok
 
DOC
How to send files to remote server via ssh in php
Andolasoft Inc
 
PPT
Chap06
Dr.Ravi
 
PPT
Shell Scripts
Dr.Ravi
 
PPT
Talk Unix Shell Script 1
Dr.Ravi
 
Tech talk 01.06.2017
AboutYouGmbH
 
01 linux basics
Robson Levi
 
Crystal Rocks
Brian Cardiff
 
Scripting 101
ohardebol
 
Why Zsh is Cooler than Your Shell
jaguardesignstudio
 
Talk Unix Shell Script
Dr.Ravi
 
Learning go for perl programmers
Fred Moyer
 
Understanding our code with tests, schemas, and types
Mark Godfrey
 
Natural Language Processing(SupStat Inc)
Vivian S. Zhang
 
The hacker choice
Flavio Castelli
 
Rust All Hands Winter 2011
Patrick Walton
 
Why zsh is Cooler than Your Shell
brendon_jag
 
Vim Hacks (OSSF)
Lin Yo-An
 
Opa hackathon
Henri Binsztok
 
How to send files to remote server via ssh in php
Andolasoft Inc
 
Chap06
Dr.Ravi
 
Shell Scripts
Dr.Ravi
 
Talk Unix Shell Script 1
Dr.Ravi
 

Similar to Learning Rust - experiences from a Python/Javascript developer (20)

PPT
2007 09 10 Fzi Training Groovy Grails V Ws
loffenauer
 
PPTX
How Secure Are Docker Containers?
Ben Hall
 
PDF
Let's Play Dart
Jana Moudrá
 
PPT
Unit 8
siddr
 
PDF
Discover Dart - Meetup 15/02/2017
Stéphane Este-Gracias
 
PDF
Groovy on the Shell
sascha_klein
 
PDF
Beautiful PHP CLI Scripts
Jesse Donat
 
PDF
Discover Dart(lang) - Meetup 07/12/2016
Stéphane Este-Gracias
 
PDF
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
 
ODP
Perl Moderno
Tiago Peczenyj
 
PDF
Clean & Typechecked JS
Arthur Puthin
 
PDF
Deep drive into rust programming language
Vigneshwer Dhinakaran
 
PPTX
Twitter Author Prediction from Tweets using Bayesian Network
Hendy Irawan
 
PDF
Linux system admin useful commands
ali98091
 
PDF
Rust Intro @ Roma Rust meetup
Claudio Capobianco
 
PDF
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Codemotion
 
PDF
Powershell notes
Carlos Amorim
 
PPTX
C# to python
Tess Ferrandez
 
PDF
Static types on javascript?! Type checking approaches to ensure healthy appli...
Arthur Puthin
 
PPTX
Building a friendly .NET SDK to connect to Space
Maarten Balliauw
 
2007 09 10 Fzi Training Groovy Grails V Ws
loffenauer
 
How Secure Are Docker Containers?
Ben Hall
 
Let's Play Dart
Jana Moudrá
 
Unit 8
siddr
 
Discover Dart - Meetup 15/02/2017
Stéphane Este-Gracias
 
Groovy on the Shell
sascha_klein
 
Beautiful PHP CLI Scripts
Jesse Donat
 
Discover Dart(lang) - Meetup 07/12/2016
Stéphane Este-Gracias
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
 
Perl Moderno
Tiago Peczenyj
 
Clean & Typechecked JS
Arthur Puthin
 
Deep drive into rust programming language
Vigneshwer Dhinakaran
 
Twitter Author Prediction from Tweets using Bayesian Network
Hendy Irawan
 
Linux system admin useful commands
ali98091
 
Rust Intro @ Roma Rust meetup
Claudio Capobianco
 
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Codemotion
 
Powershell notes
Carlos Amorim
 
C# to python
Tess Ferrandez
 
Static types on javascript?! Type checking approaches to ensure healthy appli...
Arthur Puthin
 
Building a friendly .NET SDK to connect to Space
Maarten Balliauw
 
Ad

More from Juha-Matti Santala (20)

PDF
Debugging Django @ HelPy, Juha-Matti Santala 24.5.2022
Juha-Matti Santala
 
PDF
Contemporary Documentation @ PyAmsterdam, 2021-03-10
Juha-Matti Santala
 
PDF
Contemporary Documentation @ sthml.js
Juha-Matti Santala
 
PDF
Contemporary Documentation, Django Day Copenhagen
Juha-Matti Santala
 
PDF
Debugging Python - Python Users Berlin 14.5.2020
Juha-Matti Santala
 
PDF
Debugging Javascript - Munich Frontend Developers 13.5.2020
Juha-Matti Santala
 
PDF
HelsinkiJS: 11ty + Ghost: Static Sites with Great Editor UX
Juha-Matti Santala
 
PDF
PyCon Estonia: Contemporary Documentation
Juha-Matti Santala
 
PDF
Contemporary Documentation - HelsinkiJS
Juha-Matti Santala
 
PDF
Contemporary Documentation - TampereJS
Juha-Matti Santala
 
PDF
The Art of Side Projects
Juha-Matti Santala
 
PDF
“Graphical Perception and Graphical Methods for Analyzing Scientific Data” - ...
Juha-Matti Santala
 
PDF
PyCon CZ 2019 Lightning Talk: 7 Days to Ostrava
Juha-Matti Santala
 
PDF
I teach, therefore I learn
Juha-Matti Santala
 
PDF
Inspiration, Learning and Experimentation in Codepen
Juha-Matti Santala
 
PDF
You should have FOMO: What you're missing out if you're still using Python 2.7
Juha-Matti Santala
 
PDF
OuluES Human Accelerator: Dream Workshop
Juha-Matti Santala
 
PDF
Minimum Viable Product: the workshop
Juha-Matti Santala
 
PDF
Stockholm syndrome: or how I learned to love the editor
Juha-Matti Santala
 
PDF
Happy Little Accidents - The Art of Debugging
Juha-Matti Santala
 
Debugging Django @ HelPy, Juha-Matti Santala 24.5.2022
Juha-Matti Santala
 
Contemporary Documentation @ PyAmsterdam, 2021-03-10
Juha-Matti Santala
 
Contemporary Documentation @ sthml.js
Juha-Matti Santala
 
Contemporary Documentation, Django Day Copenhagen
Juha-Matti Santala
 
Debugging Python - Python Users Berlin 14.5.2020
Juha-Matti Santala
 
Debugging Javascript - Munich Frontend Developers 13.5.2020
Juha-Matti Santala
 
HelsinkiJS: 11ty + Ghost: Static Sites with Great Editor UX
Juha-Matti Santala
 
PyCon Estonia: Contemporary Documentation
Juha-Matti Santala
 
Contemporary Documentation - HelsinkiJS
Juha-Matti Santala
 
Contemporary Documentation - TampereJS
Juha-Matti Santala
 
The Art of Side Projects
Juha-Matti Santala
 
“Graphical Perception and Graphical Methods for Analyzing Scientific Data” - ...
Juha-Matti Santala
 
PyCon CZ 2019 Lightning Talk: 7 Days to Ostrava
Juha-Matti Santala
 
I teach, therefore I learn
Juha-Matti Santala
 
Inspiration, Learning and Experimentation in Codepen
Juha-Matti Santala
 
You should have FOMO: What you're missing out if you're still using Python 2.7
Juha-Matti Santala
 
OuluES Human Accelerator: Dream Workshop
Juha-Matti Santala
 
Minimum Viable Product: the workshop
Juha-Matti Santala
 
Stockholm syndrome: or how I learned to love the editor
Juha-Matti Santala
 
Happy Little Accidents - The Art of Debugging
Juha-Matti Santala
 
Ad

Recently uploaded (20)

PPTX
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
PDF
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
PPTX
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
PDF
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
PDF
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
PPTX
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PDF
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
PDF
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
PDF
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
PDF
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
PDF
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
PDF
Python Conference Singapore - 19 Jun 2025
ninefyi
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 

Learning Rust - experiences from a Python/Javascript developer

  • 1. Learning Rust experiences from a Python/Javascript developer Rust Denver
  • 2. “The value of another’s experience is to give us hope, not to tell us how or whether to proceed” Rust Denver “The Answer to How is Yes” by Peter Block
  • 3. Rust Denver Hi, I’m Juhis! from Helsinki, Finland 🇫🇮 (it’s 3.30 am here) Developer Advocate at Futurice I build developer communities https://hamatti.org twitter.com/hamatti
  • 5. Dom Weldon’s talk in PyCon Estonia 2019 Rust Denver
  • 7. Advent of Code 2020 Rust Denver fn main() ->- io:::Result<()> { let mut buffer = String:::new(); io:::stdin().read_to_string(&mut buffer)?; let input: Vec<i32> = buffer .split('n') .filter(|inp| inp !!= &"") .map(|num| num.parse().unwrap()) .collect(); let input2: Vec<i32> = input.clone(); match find_double(input) { Some(result) =>= println!("Part 1: {}", result), None =>= panic!("Oh no!"), } match find_triplet(input2) { Some(result) =>= println!("Part 2: {}", result), None =>= panic!("Oh no!"), } Ok(()) } Advent of Code #1: Getting Started Advent of Code #2: Borrows, unwraps and lots of compiler errors Advent of Code #3: Slowing down
  • 8. I started to build a CLI tool Rust Denver 235 NHL results on command line https://crates.io/crates/nhl-235
  • 9. ❤ Things I really like, #1 ❤ Rust Denver Pattern Matching
  • 10. Rust Denver for pair in score_iter { match pair { Both(l, r) =>= print_full(l, r), Left(l) =>= print_left(l), Right(r) =>= print_right(r), } } Pattern Matching
  • 11. Rust Denver ❤ We’re getting it in Python too this year https://www.python.org/dev/peps/pep-0634/
  • 12. 🙈 Things I struggle with, #1 Rust Denver Static typing (esp. when nesting custom types)
  • 13. Rust Denver ##[derive(Debug, Serialize, Deserialize)] pub struct APIResponse { pub date: DateResponse, pub games: Vec<GameResponse>, pub errors: Option<HashMap<String, serde_json:::Value>>>, } ##[derive(Debug, Serialize, Deserialize)] pub struct DateResponse { pub raw: Option<String>, pub pretty: String, } What I’ve done
  • 14. Rust Denver ##[derive(Debug, Serialize, Deserialize)] pub struct APIResponse { pub date: { pub raw: Option<String>, pub pretty: String, }, pub games: Vec<GameResponse>, pub errors: Option<HashMap<String, serde_json:::Value>>>, } What I’d like to do
  • 15. ❤ Things I really like, #2 ❤ Rust Denver rustdoc & doctests
  • 16. Rust Denver impl Person { ///// Returns a person with the name given them ///// ///// # Arguments ///// ///// * `name` - A string slice that holds the name of the person ///// ///// # Examples ///// ///// ``` ///// /// You can have rust code between fences inside the comments ///// /// If you pass ---test to `rustdoc`, it will even test it for you! ///// use doc:::Person; ///// let person = Person:::new(“Juhis"); ///// assert_eq!(person.name, String:::from(“Juhis”)); ///// ``` pub fn new(name: &str) ->- Person { Person { name: name.to_string(), } } }
  • 17. 🙈 Things I struggle with, #2 Rust Denver Ownership, borrows, lifetime, references
  • 18. Rust Denver The Rust Borrow Checker: A Deep Dive - Nell Shamrell-Harrington
  • 20. Rust Denver “The Rust compiler is very kind and I tweeted last week about how the language matters. When I'm stressed about all the red in my terminal, a kind tone of voice the compiler has definitely makes it easier to deal with.” “Advent of Code #2: Borrows, unwraps and lots of compiler errors” by me
  • 21. 🙈 Things I struggle with, #3 Rust Denver Verbosity and cascade of error handling
  • 22. ❤ Things I really like, #3 ❤ Rust Denver Rustaceans
  • 23. Rust Denver Learning Rust A monthly blog series https://hamatti.org/blog/ #1: Pattern Matching #2: Option & Result #3: crates.io #4: Parsing JSON with strong types #5: Rustlings + new one every first Wed of the month
  • 24. Rust Denver codebase Livestream on Youtube https://hamatti.org/codebase #1: Accessible forms with HTML #2: Backend with Clojure #3: PHP is awesome #4: Frontend with Web Components + new one every month
  • 25. Rust Denver Thanks for having me! Time for Q&A! For more of me @hamatti in Twitter hamatti.org