(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
Rust meetup delhi nov 18
1. Let’s Get Rusty
License: CC BY-SA 4.0 International. You are free to share and adapt.
Nov 23, 2018 | Rust Community Meet-up 2018 | Delhi NCR
Abhiram Ravikumar | Mozilla Tech Speaker | ML Research Fellow, SAP Labs India
@abhi12ravi
2. Hi there!
Abhiram Ravikumar
• Mozilla Tech Speaker
• Open Source Evangelist
• Data Science Research Fellow
• Lynda Instructor
• Software Developer, SAP Labs
India
Questions / Feedback - @abhi12ravi
3. Agenda
• Why Rust?
• Rust features – (what have you?)
• FFIs (Foreign Function Interfaces) demo
• Rust Uses and Applications
@abhi12ravi
11. Memory management – The Good Stuff
• Concept of mutability
• Ownership &
Borrowing
12. Concept of mutability – the why
• Variables are immutable by
default
• Add keyword mut to make it
mutable
• Future readers know the value is
going to change
• Less prone to unwanted changes
in the variable’s value
fn main() {
let mut x = 5;
println!(“X is {}“, x);
x = 6;
println!(“X is {}“, x);
}
// X is 5
// X is 6
13. Memory allocation - Fundamentals
1. The memory must be requested from the operating
system at runtime.
2. We need to return this memory to the operating system
when we’re done with our usage.
14. Returning memory to the OS
Other programming languages:
• Garbage Collector (GC)
• W/o GC – programmer’s responsibility
Challenges:
• Need to pair exactly one allocate with exactly one free
15. In Rust
{
let s = String::from("hello"); // s is valid from this point forward
// do stuff with s
} // this scope is now over, and s is no longer valid
Memory is automatically returned once variable goes out of
scope.
19. Python Python
• Strong Ecosystem
• Fast iterations
• Robust interpreter
• Powerful meta programming
(APIs)
• Library support - fantastic
• Really slow
• Performance issues
• Far from metal
• Poor multi-threading
support
20. Rust Python
• Speed – fast ⚡
• Compile time ⬇️
• Stable environment (Reliability)
• Crash handling functionality ✔️
• Closer to metal
• Really slow
• Performance issues
• Far from the metal
• Poor multi-threading
support
23. Sample Problem Statement
String Processing use-case
• Count the pairs of repeated characters in the given string
• How many subsequent-repeated groups of chars are in the
given string?
26. “Innovation is a necessity now,
and the faster your programs run,
the faster you innovate!”
Abhiram Ravikumar
27. References
1. The Rust book
2. Rust Python Example by Rocha C Bruno
3. Armin Ronacher: A Python and Rust love story
4. Dan Callahan - My Python's a little Rust-y - PyCon 2015
5. Extending Python with Rust (Samuel Cormier-Iijima)
6. All you need to know about FFI