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

More Related Content

PPTX
Lightning talk: Go
PDF
ExtJS勉強会@名古屋
PDF
Zsh shell-for-humans
PDF
Zsh & fish: better *bash* for hackers
PDF
Basic NLP with Python and NLTK
PDF
Linux system admin
PPTX
Unix - Shell Scripts
PPTX
Programming - Marla Fuentes
Lightning talk: Go
ExtJS勉強会@名古屋
Zsh shell-for-humans
Zsh & fish: better *bash* for hackers
Basic NLP with Python and NLTK
Linux system admin
Unix - Shell Scripts
Programming - Marla Fuentes

What's hot (20)

PDF
Tech talk 01.06.2017
PPT
01 linux basics
PDF
Crystal Rocks
PPTX
Scripting 101
PDF
Why Zsh is Cooler than Your Shell
PPT
Talk Unix Shell Script
PDF
Learning go for perl programmers
PDF
PDF
Understanding our code with tests, schemas, and types
PDF
PDF
Natural Language Processing(SupStat Inc)
PDF
The hacker choice
PDF
Rust All Hands Winter 2011
PDF
Why zsh is Cooler than Your Shell
PDF
Vim Hacks (OSSF)
PDF
Opa hackathon
DOC
How to send files to remote server via ssh in php
PPT
Chap06
PPT
Shell Scripts
PPT
Talk Unix Shell Script 1
Tech talk 01.06.2017
01 linux basics
Crystal Rocks
Scripting 101
Why Zsh is Cooler than Your Shell
Talk Unix Shell Script
Learning go for perl programmers
Understanding our code with tests, schemas, and types
Natural Language Processing(SupStat Inc)
The hacker choice
Rust All Hands Winter 2011
Why zsh is Cooler than Your Shell
Vim Hacks (OSSF)
Opa hackathon
How to send files to remote server via ssh in php
Chap06
Shell Scripts
Talk Unix Shell Script 1
Ad

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

PPT
2007 09 10 Fzi Training Groovy Grails V Ws
PPTX
How Secure Are Docker Containers?
PDF
Let's Play Dart
PPT
Unit 8
PDF
Discover Dart - Meetup 15/02/2017
PDF
Groovy on the Shell
PDF
Beautiful PHP CLI Scripts
PDF
Discover Dart(lang) - Meetup 07/12/2016
PDF
Nell’iperspazio con Rocket: il Framework Web di Rust!
ODP
Perl Moderno
PDF
Clean & Typechecked JS
PDF
Deep drive into rust programming language
PPTX
Twitter Author Prediction from Tweets using Bayesian Network
PDF
Linux system admin useful commands
PDF
Rust Intro @ Roma Rust meetup
PDF
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
PDF
Powershell notes
PPTX
C# to python
PDF
Static types on javascript?! Type checking approaches to ensure healthy appli...
PPTX
Building a friendly .NET SDK to connect to Space
2007 09 10 Fzi Training Groovy Grails V Ws
How Secure Are Docker Containers?
Let's Play Dart
Unit 8
Discover Dart - Meetup 15/02/2017
Groovy on the Shell
Beautiful PHP CLI Scripts
Discover Dart(lang) - Meetup 07/12/2016
Nell’iperspazio con Rocket: il Framework Web di Rust!
Perl Moderno
Clean & Typechecked JS
Deep drive into rust programming language
Twitter Author Prediction from Tweets using Bayesian Network
Linux system admin useful commands
Rust Intro @ Roma Rust meetup
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Powershell notes
C# to python
Static types on javascript?! Type checking approaches to ensure healthy appli...
Building a friendly .NET SDK to connect to Space
Ad

More from Juha-Matti Santala (20)

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

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Empathic Computing: Creating Shared Understanding
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Programs and apps: productivity, graphics, security and other tools
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Mobile App Security Testing_ A Comprehensive Guide.pdf
sap open course for s4hana steps from ECC to s4
Digital-Transformation-Roadmap-for-Companies.pptx
Understanding_Digital_Forensics_Presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Empathic Computing: Creating Shared Understanding
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

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