SlideShare une entreprise Scribd logo
1  sur  83
Télécharger pour lire hors ligne
API Days Paris
Zacaria Chtatar - December 2023
https://havesome-rust-apidays.surge.sh
Forget TypeScript
Forget TypeScript
Choose Rust
Forget TypeScript
Choose Rust
to build
Forget TypeScript
Choose Rust
to build
Robust, Fast and Cheap APIs
Some context
2009
JS lives in the browser
Until Nodejs
V8 engine, modules system & NPM
modules
boom of easy to reuse code
fullstack JS : Easy to start with, hard to master
Fullstack
paradigm clash between static and dynamic
JS doesn't help you follow strict API interfaces
Fullstack
paradigm clash between static and dynamic
JS doesn't help you follow strict API interfaces
TypeScript
Benefits:
IDE Developer experience
OOP patterns
compiler checks
type system
=> better management of big codebase
Pain points
does not save you from dealing with JS
adds types management
adds static layer onto dynamic layer
Pain points
does not save you from dealing with JS
adds types management
adds static layer onto dynamic layer
JSDoc answers to the precise problem of hinting types without getting in
your way
New stakes, new needs
Stakes Needs
worldwide scale
privacy
market competition
environment
human lives
scalability
security
functionality
computation time
memory footprint
safety
Stakes Needs
worldwide scale
privacy
market competition
environment
human lives
scalability
security
functionality
computation time
memory footprint
safety
TypeScript is not enough
Introducing Rust
Fast, Reliable, Productive: pick three
Stable
enums
struct FakeCat {
alive: bool,
hungry: bool,
}
let zombie = FakeCat { alive: false, hungry: true }; // ???
enums
struct FakeCat {
alive: bool,
hungry: bool,
}
let zombie = FakeCat { alive: false, hungry: true }; // ???
Rust makes it easy to make invalid state
unrepresentable
enums
struct FakeCat {
alive: bool,
hungry: bool,
}
let zombie = FakeCat { alive: false, hungry: true }; // ???
Rust makes it easy to make invalid state
unrepresentable
enum RealCat {
Alive { hungry: bool }, // enums can contain structs
Dead,
}
let cat = RealCat::Alive { hungry: true };
let dead_cat = RealCat::Dead;
Option enum
// full code of the solution to the billion dollar mistake
// included in the standard library
enum Option<T> {
None,
Some(T),
}
let item: Option<Item> = get_item();
match item {
Some(item) => map_item(item),
None => handle_none_case(), // does not compile if omitted
}
What is wrong with this function ?
function getConfig(path: string): string {
return fs.readFileSync(path);
}
What is wrong with this function ?
function getConfig(path: string): string {
return fs.readFileSync(path);
}
There is no hint that readFileSync can throw an error under some conditions
Result enum
enum Result<T, E> {
Ok(T),
Err(E),
}
fn get_config(path: &str) -> Result<String, io::Error> {
fs::read_to_string(path)
}
// That's a shortcut, don't send me to prod !
fn dirty_get_config(path: &str) -> String {
fs::read_to_string(path).unwrap() // panics in case of error
}
Result enum
enum Result<T, E> {
Ok(T),
Err(E),
}
fn get_config(path: &str) -> Result<String, io::Error> {
fs::read_to_string(path)
}
// That's a shortcut, don't send me to prod !
fn dirty_get_config(path: &str) -> String {
fs::read_to_string(path).unwrap() // panics in case of error
}
We need to clarify what can go wrong
Result enum
enum Result<T, E> {
Ok(T),
Err(E),
}
fn get_config(path: &str) -> Result<String, io::Error> {
fs::read_to_string(path)
}
// That's a shortcut, don't send me to prod !
fn dirty_get_config(path: &str) -> String {
fs::read_to_string(path).unwrap() // panics in case of error
}
We need to clarify what can go wrong
It's even better when it's embedded in the language
2016 : Do you remember the ?
le -pad incident
Source
crates.io
no crate (package) unpublish
can disable crate only for new projects
Linux: The Kernel
Linux: The Kernel
attract young devs
Linux: The Kernel
attract young devs
2/3 of vunerabilities come from memory management
Linux: The Kernel
attract young devs
2/3 of vunerabilities come from memory management
Kernel is in C and Assembly
Linux: The Kernel
attract young devs
2/3 of vunerabilities come from memory management
Kernel is in C and Assembly
Linus Torvalds : C++
Fast
2017 : Energy efficiency accross programing languages
Github:
45 million repos
28 TB of unique content
Code Search index
Github:
45 million repos
28 TB of unique content
Code Search index
several months with Elasticsearch
36h with Rust and Kafka
640 queries /s
Cloudflare: HTTP proxy
Cloudflare: HTTP proxy
nginx not fast enough
Cloudflare: HTTP proxy
nginx not fast enough
hard to customize in C
Cloudflare: HTTP proxy
nginx not fast enough
hard to customize in C
allows to share connections between threads
Cloudflare: HTTP proxy
nginx not fast enough
hard to customize in C
allows to share connections between threads
= 160x less connections to the origins
Cloudflare: HTTP proxy
nginx not fast enough
hard to customize in C
allows to share connections between threads
= 160x less connections to the origins
= 434 years less handshakes per day
Discord: Message read service
Discord: Message read service
cache of a few billion entries
Discord: Message read service
cache of a few billion entries
every connection, message sent and read...
Discord: Message read service
cache of a few billion entries
every connection, message sent and read...
latences every 2 minutes because of Go Garbage Collector
Discord: Message read service
cache of a few billion entries
every connection, message sent and read...
latences every 2 minutes because of Go Garbage Collector
Cheap
cpu & memory
less bugs
learning curve
less cases to test
Attractive
Attractive
Most admired language according to for 8 years !
StackOverflow
Attractive
Most admired language according to for 8 years !
StackOverflow
Only place where there is more devs available than offers
Growing community
Features
static types
compiled
no GC
compiler developed in Rust
low and high level : zero cost abstraction
no manual memory management : Ownership & Borrow checker
Features
static types
compiled
no GC
compiler developed in Rust
low and high level : zero cost abstraction
no manual memory management : Ownership & Borrow checker
=> There is no blackbox between you and the machine
Features
static types
compiled
no GC
compiler developed in Rust
low and high level : zero cost abstraction
no manual memory management : Ownership & Borrow checker
=> There is no blackbox between you and the machine
=> Better predictability
Features
static types
compiled
no GC
compiler developed in Rust
low and high level : zero cost abstraction
no manual memory management : Ownership & Borrow checker
=> There is no blackbox between you and the machine
=> Better predictability
=> Awesome developer experience
Ownership rules
Ownership rules
Only one variable owns data at a time
Ownership rules
Only one variable owns data at a time
Multiple readers or one writer
Ownership rules
Only one variable owns data at a time
Multiple readers or one writer
=> Memory is freed as soon as variable is out of scope
Ownership rules
Only one variable owns data at a time
Multiple readers or one writer
=> Memory is freed as soon as variable is out of scope
It's like a fundamental problem has been solved
The compiler
fn say(message: String) {
println!("{}", message);
}
fn main() {
let message = String::from("hey");
say(message);
say(message);
}
Tools
cargo test : Integration Tests, Unit Ttests
cargo fmt
cargo bench
clippy : lint
bacon : reload
rust-analyzer : IDE developer experience
Cargo doc stays up to date
cargo doc --open
/// Formats the sum of two numbers as a string.
///
/// # Examples
///
/// ```
/// let result = mycrate::sum_as_string(5, 10);
/// assert_eq!(result, "15");
/// ```
pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() }
1
2
3
4
5
6
7
8
9
Cargo doc stays up to date
cargo doc --open
/// Formats the sum of two numbers as a string.
///
/// # Examples
///
/// ```
/// let result = mycrate::sum_as_string(5, 10);
/// assert_eq!(result, "15");
/// ```
pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() }
1
2
3
4
5
6
7
8
9
/// let result = mycrate::sum_as_string(5, 10);
/// assert_eq!(result, "15");
/// Formats the sum of two numbers as a string.
1
///
2
/// # Examples
3
///
4
/// ```
5
6
7
/// ```
8
pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() }
9
Cargo doc stays up to date
cargo doc --open
/// Formats the sum of two numbers as a string.
///
/// # Examples
///
/// ```
/// let result = mycrate::sum_as_string(5, 10);
/// assert_eq!(result, "15");
/// ```
pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() }
1
2
3
4
5
6
7
8
9
/// let result = mycrate::sum_as_string(5, 10);
/// assert_eq!(result, "15");
/// Formats the sum of two numbers as a string.
1
///
2
/// # Examples
3
///
4
/// ```
5
6
7
/// ```
8
pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() }
9
/// Formats the sum of two numbers as a string.
///
/// # Examples
///
/// ```
/// let result = mycrate::sum_as_string(5, 10);
/// assert_eq!(result, "15");
/// ```
pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() }
1
2
3
4
5
6
7
8
9
Possible struggles
projects move slower
embrace the paradigm
takes 3 to 6 months to become productive
build time
work with external libraries
ecosystem calmer than JS
Project lifetime
In other languages simple things are easy and complex
things are possible, in Rust simple things are possible
and complex things are EASY.
Get started as dev
- reference
- condensed reference
- exercises
- quick walkthrough
- complete walkthrough
- quick videos
- longer videos
- Youtube & paid bootcamp - not sponsored
- keywords discovery
- keywords discovery
Rust book
Rust by example
Rustlings
A half-hour to learn Rust
Comprehensive Rust by Google
Noboilerplate
Code to the moon
Let's get rusty
Awesome Rust
Roadmap
Get started as manager
Get started as manager
find dev interested in Rust: there are a lot
Get started as manager
find dev interested in Rust: there are a lot
start with simple projects:
CLI
lambdas
microservice
network app
devops tools
Get started as manager
find dev interested in Rust: there are a lot
start with simple projects:
CLI
lambdas
microservice
network app
devops tools
Make the world a safer, faster and sustainable place
Thank you
Slides :
-
https://havesome-rust-apidays.surge.sh
@ChtatarZacaria havesomecode.io
Q&A
Governance
Release every 6 weeks
Backward compatibility
Breaking changes are opt-in thanks to
Rust Project
Rust Foundation
editions

Contenu connexe

Similaire à Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and Cheap APIs, Zacaria Chtatar, HaveSomeCode

Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Codemotion
 
Node.js - Advanced Basics
Node.js - Advanced BasicsNode.js - Advanced Basics
Node.js - Advanced BasicsDoug Jones
 
Node js presentation
Node js presentationNode js presentation
Node js presentationmartincabrera
 
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Amazon Web Services
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandrarantav
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMManuel Bernhardt
 
Fluentd unified logging layer
Fluentd   unified logging layerFluentd   unified logging layer
Fluentd unified logging layerKiyoto Tamura
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016 Databricks
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container EraSadayuki Furuhashi
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingMax Kleiner
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardSV Ruby on Rails Meetup
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the restgeorge.james
 
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...HostedbyConfluent
 

Similaire à Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and Cheap APIs, Zacaria Chtatar, HaveSomeCode (20)

A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
 
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
 
Node.js - Advanced Basics
Node.js - Advanced BasicsNode.js - Advanced Basics
Node.js - Advanced Basics
 
Node js presentation
Node js presentationNode js presentation
Node js presentation
 
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
 
Odp
OdpOdp
Odp
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
 
C tutorials
C tutorialsC tutorials
C tutorials
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
 
Fluentd unified logging layer
Fluentd   unified logging layerFluentd   unified logging layer
Fluentd unified logging layer
 
Book
BookBook
Book
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container Era
 
MLflow with R
MLflow with RMLflow with R
MLflow with R
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage coding
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
 
jvm goes to big data
jvm goes to big datajvm goes to big data
jvm goes to big data
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the rest
 
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
 

Plus de apidays

Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...apidays
 
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...apidays
 
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...apidays
 
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...apidays
 
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...apidays
 
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...apidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...apidays
 
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...apidays
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...apidays
 
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...apidays
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...apidays
 
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...apidays
 
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...apidays
 
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBMApidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBMapidays
 
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...apidays
 
Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...apidays
 
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...apidays
 

Plus de apidays (20)

Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
 
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
 
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
 
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
 
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
 
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
 
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
 
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
Apidays Singapore 2024 - Harnessing Green IT by Jai Prakash and Timothée Dufr...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
Apidays Singapore 2024 - Creating API First Engineering Team by Asim Suvedi, ...
 
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
Apidays Singapore 2024 - Designing a Scalable MLOps Pipeline by Victoria Lo, ...
 
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
Apidays Singapore 2024 - The 5 Key Tenets of a Multiform API Management Strat...
 
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBMApidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
Apidays Singapore 2024 - APIs in the world of Generative AI by Claudio Tag, IBM
 
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
Apidays Singapore 2024 - Banking: From Obsolete to Absolute by Indra Salim, a...
 
Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...Apidays Singapore 2024 - Application and Platform Optimization through Power ...
Apidays Singapore 2024 - Application and Platform Optimization through Power ...
 
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
Apidays Singapore 2024 - Shift RIGHT to Better Product Resilience by Abhijit ...
 

Dernier

dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 

Dernier (20)

dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 

Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and Cheap APIs, Zacaria Chtatar, HaveSomeCode

  • 1. API Days Paris Zacaria Chtatar - December 2023 https://havesome-rust-apidays.surge.sh
  • 2.
  • 6. Forget TypeScript Choose Rust to build Robust, Fast and Cheap APIs
  • 8. 2009 JS lives in the browser
  • 9. Until Nodejs V8 engine, modules system & NPM modules boom of easy to reuse code fullstack JS : Easy to start with, hard to master
  • 10. Fullstack paradigm clash between static and dynamic JS doesn't help you follow strict API interfaces
  • 11. Fullstack paradigm clash between static and dynamic JS doesn't help you follow strict API interfaces
  • 12. TypeScript Benefits: IDE Developer experience OOP patterns compiler checks type system => better management of big codebase
  • 13. Pain points does not save you from dealing with JS adds types management adds static layer onto dynamic layer
  • 14. Pain points does not save you from dealing with JS adds types management adds static layer onto dynamic layer JSDoc answers to the precise problem of hinting types without getting in your way
  • 16. Stakes Needs worldwide scale privacy market competition environment human lives scalability security functionality computation time memory footprint safety
  • 17. Stakes Needs worldwide scale privacy market competition environment human lives scalability security functionality computation time memory footprint safety TypeScript is not enough
  • 18. Introducing Rust Fast, Reliable, Productive: pick three
  • 20.
  • 21. enums struct FakeCat { alive: bool, hungry: bool, } let zombie = FakeCat { alive: false, hungry: true }; // ???
  • 22. enums struct FakeCat { alive: bool, hungry: bool, } let zombie = FakeCat { alive: false, hungry: true }; // ??? Rust makes it easy to make invalid state unrepresentable
  • 23. enums struct FakeCat { alive: bool, hungry: bool, } let zombie = FakeCat { alive: false, hungry: true }; // ??? Rust makes it easy to make invalid state unrepresentable enum RealCat { Alive { hungry: bool }, // enums can contain structs Dead, } let cat = RealCat::Alive { hungry: true }; let dead_cat = RealCat::Dead;
  • 24. Option enum // full code of the solution to the billion dollar mistake // included in the standard library enum Option<T> { None, Some(T), } let item: Option<Item> = get_item(); match item { Some(item) => map_item(item), None => handle_none_case(), // does not compile if omitted }
  • 25. What is wrong with this function ? function getConfig(path: string): string { return fs.readFileSync(path); }
  • 26. What is wrong with this function ? function getConfig(path: string): string { return fs.readFileSync(path); } There is no hint that readFileSync can throw an error under some conditions
  • 27. Result enum enum Result<T, E> { Ok(T), Err(E), } fn get_config(path: &str) -> Result<String, io::Error> { fs::read_to_string(path) } // That's a shortcut, don't send me to prod ! fn dirty_get_config(path: &str) -> String { fs::read_to_string(path).unwrap() // panics in case of error }
  • 28. Result enum enum Result<T, E> { Ok(T), Err(E), } fn get_config(path: &str) -> Result<String, io::Error> { fs::read_to_string(path) } // That's a shortcut, don't send me to prod ! fn dirty_get_config(path: &str) -> String { fs::read_to_string(path).unwrap() // panics in case of error } We need to clarify what can go wrong
  • 29. Result enum enum Result<T, E> { Ok(T), Err(E), } fn get_config(path: &str) -> Result<String, io::Error> { fs::read_to_string(path) } // That's a shortcut, don't send me to prod ! fn dirty_get_config(path: &str) -> String { fs::read_to_string(path).unwrap() // panics in case of error } We need to clarify what can go wrong It's even better when it's embedded in the language
  • 30. 2016 : Do you remember the ? le -pad incident Source
  • 31. crates.io no crate (package) unpublish can disable crate only for new projects
  • 34. Linux: The Kernel attract young devs 2/3 of vunerabilities come from memory management
  • 35. Linux: The Kernel attract young devs 2/3 of vunerabilities come from memory management Kernel is in C and Assembly
  • 36. Linux: The Kernel attract young devs 2/3 of vunerabilities come from memory management Kernel is in C and Assembly Linus Torvalds : C++
  • 37. Fast
  • 38. 2017 : Energy efficiency accross programing languages
  • 39. Github: 45 million repos 28 TB of unique content Code Search index
  • 40. Github: 45 million repos 28 TB of unique content Code Search index several months with Elasticsearch 36h with Rust and Kafka 640 queries /s
  • 42. Cloudflare: HTTP proxy nginx not fast enough
  • 43. Cloudflare: HTTP proxy nginx not fast enough hard to customize in C
  • 44. Cloudflare: HTTP proxy nginx not fast enough hard to customize in C allows to share connections between threads
  • 45. Cloudflare: HTTP proxy nginx not fast enough hard to customize in C allows to share connections between threads = 160x less connections to the origins
  • 46. Cloudflare: HTTP proxy nginx not fast enough hard to customize in C allows to share connections between threads = 160x less connections to the origins = 434 years less handshakes per day
  • 48. Discord: Message read service cache of a few billion entries
  • 49. Discord: Message read service cache of a few billion entries every connection, message sent and read...
  • 50. Discord: Message read service cache of a few billion entries every connection, message sent and read... latences every 2 minutes because of Go Garbage Collector
  • 51. Discord: Message read service cache of a few billion entries every connection, message sent and read... latences every 2 minutes because of Go Garbage Collector
  • 52. Cheap
  • 53. cpu & memory less bugs learning curve less cases to test
  • 55. Attractive Most admired language according to for 8 years ! StackOverflow
  • 56. Attractive Most admired language according to for 8 years ! StackOverflow Only place where there is more devs available than offers
  • 58. Features static types compiled no GC compiler developed in Rust low and high level : zero cost abstraction no manual memory management : Ownership & Borrow checker
  • 59. Features static types compiled no GC compiler developed in Rust low and high level : zero cost abstraction no manual memory management : Ownership & Borrow checker => There is no blackbox between you and the machine
  • 60. Features static types compiled no GC compiler developed in Rust low and high level : zero cost abstraction no manual memory management : Ownership & Borrow checker => There is no blackbox between you and the machine => Better predictability
  • 61. Features static types compiled no GC compiler developed in Rust low and high level : zero cost abstraction no manual memory management : Ownership & Borrow checker => There is no blackbox between you and the machine => Better predictability => Awesome developer experience
  • 63. Ownership rules Only one variable owns data at a time
  • 64. Ownership rules Only one variable owns data at a time Multiple readers or one writer
  • 65. Ownership rules Only one variable owns data at a time Multiple readers or one writer => Memory is freed as soon as variable is out of scope
  • 66. Ownership rules Only one variable owns data at a time Multiple readers or one writer => Memory is freed as soon as variable is out of scope It's like a fundamental problem has been solved
  • 67. The compiler fn say(message: String) { println!("{}", message); } fn main() { let message = String::from("hey"); say(message); say(message); }
  • 68. Tools cargo test : Integration Tests, Unit Ttests cargo fmt cargo bench clippy : lint bacon : reload rust-analyzer : IDE developer experience
  • 69. Cargo doc stays up to date cargo doc --open /// Formats the sum of two numbers as a string. /// /// # Examples /// /// ``` /// let result = mycrate::sum_as_string(5, 10); /// assert_eq!(result, "15"); /// ``` pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() } 1 2 3 4 5 6 7 8 9
  • 70. Cargo doc stays up to date cargo doc --open /// Formats the sum of two numbers as a string. /// /// # Examples /// /// ``` /// let result = mycrate::sum_as_string(5, 10); /// assert_eq!(result, "15"); /// ``` pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() } 1 2 3 4 5 6 7 8 9 /// let result = mycrate::sum_as_string(5, 10); /// assert_eq!(result, "15"); /// Formats the sum of two numbers as a string. 1 /// 2 /// # Examples 3 /// 4 /// ``` 5 6 7 /// ``` 8 pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() } 9
  • 71. Cargo doc stays up to date cargo doc --open /// Formats the sum of two numbers as a string. /// /// # Examples /// /// ``` /// let result = mycrate::sum_as_string(5, 10); /// assert_eq!(result, "15"); /// ``` pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() } 1 2 3 4 5 6 7 8 9 /// let result = mycrate::sum_as_string(5, 10); /// assert_eq!(result, "15"); /// Formats the sum of two numbers as a string. 1 /// 2 /// # Examples 3 /// 4 /// ``` 5 6 7 /// ``` 8 pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() } 9 /// Formats the sum of two numbers as a string. /// /// # Examples /// /// ``` /// let result = mycrate::sum_as_string(5, 10); /// assert_eq!(result, "15"); /// ``` pub fn sum_as_string(a: i32, b: i32) -> String { (a + b).to_string() } 1 2 3 4 5 6 7 8 9
  • 72.
  • 73. Possible struggles projects move slower embrace the paradigm takes 3 to 6 months to become productive build time work with external libraries ecosystem calmer than JS
  • 75. In other languages simple things are easy and complex things are possible, in Rust simple things are possible and complex things are EASY.
  • 76. Get started as dev - reference - condensed reference - exercises - quick walkthrough - complete walkthrough - quick videos - longer videos - Youtube & paid bootcamp - not sponsored - keywords discovery - keywords discovery Rust book Rust by example Rustlings A half-hour to learn Rust Comprehensive Rust by Google Noboilerplate Code to the moon Let's get rusty Awesome Rust Roadmap
  • 77. Get started as manager
  • 78. Get started as manager find dev interested in Rust: there are a lot
  • 79. Get started as manager find dev interested in Rust: there are a lot start with simple projects: CLI lambdas microservice network app devops tools
  • 80. Get started as manager find dev interested in Rust: there are a lot start with simple projects: CLI lambdas microservice network app devops tools Make the world a safer, faster and sustainable place
  • 82. Q&A
  • 83. Governance Release every 6 weeks Backward compatibility Breaking changes are opt-in thanks to Rust Project Rust Foundation editions