SlideShare a Scribd company logo
Rust
Hack & Learn
Session #1
Robert “Bob” Reyes
14 Jun 2016
#MozillaPH
#RustPH
Check-in at Swarm &
Foursquare!
#MozillaPH
#RustPH
If you’re on social media, please use
our official hashtags for this event.
Agenda
• Mozilla in the Philippines
• Installing Rust
• Hello World, the Rust way
• Intro to Cargo
• IDE Support
• Variables & Constants
• Simple Arithmetic Functions
Target Audience
• People with some background in
programming (any language).
• People with zero or near-zero knowledge
about Rust (Programming Language).
• People who wants to learn a new
programming language.
What is
Mozilla?
#MozillaPH
History of Mozilla
On 23 Feb 1998,
Netscape Communications Corp.
created a project called
Mozilla (Mosaic Killer + Godzilla).
Mozilla was launched 31 Mar 1998.
The
Mozilla Manifesto
Mozilla’s Mission
To ensure the Internet
is a global public
resource, open &
accessible to all.
Get involved …
Firefox Student
Ambassadors (FSA)
http://fsa.mozillaphilippines.org
Internship
at Mozilla
https://careers.mozilla.org/university/
Some stuff that we
are working on …
MozillaPH Rust Hack & Learn Session 1
#MozillaPH
MozillaPH Rust Hack & Learn Session 1
How to be part of
MozillaPH?
Areas of Contribution
 Helping Users
(Support)
 Testing & QA
 Coding
 Marketing
 Translation &
Localization
 Web Development
 Firefox Marketplace
 Add-ons
 Visual Design
 Documentation &
Writing
 Education
http://join.mozillaph.org
Join MozillaPH now!
http://join.mozillaph.org
Co-work from
MozSpaceMNL
http://mozspacemnl.org
MozillaPH Rust Hack & Learn Session 1
Let’s get to know
each other first.
What is your name?
From where are you?
What do you do?
Why are you here?
Where are the
MENTORS?
Please feel free to approach & ask
help from them 
What is
Rust?
What is Rust?
• Rust is a systems programming language
that runs blazingly fast, prevents
segfaults, & guarantees thread safety.
• Compiles to Native Code like C++ & D.
• Strength includes memory safety &
correctness (just like in C).
“Rust is a modern native-code language
with a focus on safety.”
Why
Rust?
Top 10 IoT Programming
Languages
1. C Language
2. C++
3. Python
4. Java
5. JavaScript
6. Rust
7. Go
8. Parasail
9. B#
10.Assembly
• No particular order.
• Based on popularity & following.
Rust
vs Go
Rust vs Go
• Rust shares many of Go's qualities but
solves one major problem of Go:
• Go doesn't automatically share information between
different "channel" data structures
 "race condition"
• A runaway situation in which a system can spiral
out of control because different processes are
working at odds with one another.
• Rust includes functions that eliminate
race conditions, making it a less-risky
language than Go for highly concurrent
programs.
Low-Level
vs
High-Level
Low-Level Programming
• (CS) a programming language that
provides little or no abstraction from a
computer's instruction set architecture
• commands or functions in the language
map closely to processor instructions.
• generally referred as either machine
code or assembly language.
• E.g. Assembly Language
High-Level Programming
• (CS) a programming language with strong
abstraction from the details of the
computer.
• Compared to low-level programming
languages
• may use natural language elements.
• may automate (or even hide entirely)
significant areas of computing systems
(e.g. memory management).
• E.g. COBOL, Fortran, LISP, ALGOL
Programming Languages
Hardware
Machine Language
Assembly Language
High-Level Language
Fortran | C | Pascal
OO & Visual Languages
C++ | D | Rust
Mozilla &
Rust?
Mozilla ❤️ Rust
• Rust grew out of a personal project by
Mozilla employee Graydon Hoare.
• Rust is sponsored by Mozilla Research
since 2009 (announced in 2010).
Features of
Rust?
Features of Rust
• Zero-cost abstractions
• Move semantics
• Guaranteed memory safety
• Threads without data races
• Trait-based generics
• Pattern matching
• Type inference
• Minimal runtime
• Efficient C bindings
Projects using
Rust
Projects Using Rust
 Magic Pocket
 Dropbox's file storage system that powers their
Diskotech petabyte storage machines.
 Servo
 Mozilla's new parallel rendering engine developed
in collaboration with Samsung.
 OpenDNS
 Uses Rust in two of its components.
 Redox OS
 A microkernel operating system being developed
in Rust.
Installing
Rust
Installing Rust
• Installer for Windows, Mac OS X & Linux available via
https://www.rust-lang.org
• If you wish to run Rust on your local machine when
you’re offline.
• Rust Playground [https://play.rust-lang.org]
• If you are online, you may opt to use this one
instead.
• You may use ANY text editor to code in Rust.
• As a practice, please save your Rust code
using .rs file extension.
Function
Main()
Function main()
• Every Rust program must have at least one (01)
function.
• Simplest possible function declaration is named as
“main”
fn main() {
}
• Functions can also take arguments
fn print_number(x:i32) {
println!(“x is: {}”, x);
}
Hello World
in Rust
helloworld.rs
fn main()
{
println!(“Hello world in Rust!”);
}
Cargo
Cargo
• A tool that allows Rust projects to declare their various
dependencies & ensure that you’ll always get a
repeatable build.
• Cargo does:
1. Introduces two (02) metadata files with various bits
of project information.
2. Fetches & builds your project’s dependencies.
3. Invokes rustc or another build tool with the correct
parameters to build your project.
4. Introduces conventions to make working with Rust
projects easier.
Cargo
• To start a new project with Cargo, we invoke in the
command line:
cargo new hello_world --bin
• Cargo will generate the following files & folders:
 Cargo.toml [file]
 src [folder]
 main.rs [file]
• Acts as a manifest file
• Contains all of the metadata that Cargo needs to
compile your project.
TOML, what?!
TOML
• Tom’s Obvious, Minimal Language
(or some say, Tom’s Own Markup Language)
• Created by Tom Preston-Werner
• Aims to be a minimal configuration file format that's
easy to read due to obvious semantics.
• Designed to map unambiguously to a hash table.
• Should be easy to parse into data structures in a wide
variety of languages.
Cargo.toml
Cargo.toml
[package]
name = "hello_world”
version = "0.1.0”
authors = ["Your Name <you@example.com>"]
IDE Support
IDE Support
• Modern IDEs give developers a massive increase in
productivity.
• Several community projects have provided an excellent
start towards IDE support.
• Good IDE support requires a number of components:
• The compiler must be modified to operate in a
different mode.
• Must provide name & type information from the
compiler to the IDE.
• Must write plugins for the IDEs themselves so they
know what to do with Rust projects.
IDE Support
• Available IDE Plugins:
• Eclipse [https://github.com/RustDT/RustDT]
• Intellij IDEA [https://github.com/intellij-rust/intellij-rust]
• Visual Studio [https://github.com/PistonDevelopers/VisualRust]
• Editor Plugins:
• Atom [https://atom.io/packages/language-rust]
• Emacs [https://github.com/rust-lang/rust-mode]
• Sublime Text [https://packagecontrol.io/packages/Rust]
• Vim [https://github.com/rust-lang/rust.vim]
• Visual Studio Code
[https://github.com/saviorisdead/RustyCode]
More on IDE Support
https://www.rust-lang.org/ides.html
Types &
Variables
Variables
• Variable Declaration
fn main() {
let a:u8 = 123;
}
• Whereas
• a  variable
• u8  data type (unsigned; 0 or positive; 8-bit)
• 123  value of variable “a”
Numeric Data Types
• i8  8-bit signed integer
• i16  16-bit signed integer
• i32  32-bit signed integer
• i64  64-bit signed integer
• u8  8-bit unsigned integer
• u16  16-bit unsigned integer
• u32  32-bit unsigned integer
• u64  64-bit unsigned integer
• isize  pointer-size signed integer
• usize  pointer-size unsigned integer
• f32/f64  32/64-bit floating point
Mutability
in Rust
Mutability
• The ability to change something.
• Mutable variable binding.
• You’re allowed to change what the binding points to.
let x = 5;
x = 6;  will result to an error!
• We can use the mut keyword:
let mut x = 5;
x = 6;  no problem; no error!
Constants
• Aside from using variables, we can also declare
constants in Rust:
const PI:u8 = 3;
 no fixed memory address
 memory safety is NOT compromised
static X:i32 = 123;
Operators
in Rust
Arithmetic Operators
+  addition & array/string concatenation
-  subtraction
*  multiplication
/  quotient
%  remainder
Arithmetic Operators
• Rust DOES NOT support ++ and – used in other
programming languages.
• a = a+1; or
• a += 1;
• b = b-1; or
• b -= 1;
• You may also use the following in Rust
• *=
• /=
• %=
Arithmetic Operators
let mut a = 2+3*4;
println!(“Answer = {}.”, a);
let mut a = (2+3)*4;
println!(“Answer = {}.”, a);
Arithmetic Operators
let mut a = 10/3;
println!(“Answer = {}.”, a);
let mut a = 10%3;
println!(“Answer = {}.”, a);
let a=10;
println!(“Remainder of {} / {}
= {}”, a, 3, (a%3));
More Sample
(Try them out)
Arithmetic Operators (eg1)
fn main() {
let num1 = 20;
let num2 = 10;
println!(“The SUM of the numbers =
{}”, (num1 + num2));
println!(”The DIFFERENCE of the
numbers = {}”, (num1 – num2));
… and so on
Arithmetic Operators (eg2)
fn main() {
let num1 = 20;
let num2 = 10;
let sum = num1 + num2;
let dif = num1 – num2;
let pro = num1 * num2;
let quo = num1 / num2;
println!(“The SUM of the numbers =
{}”, sum);
… and so on
Q&A
References
facebook.com/groups/rustph
Reference Materials
• The Rust Programming Language Book
• https://doc.rust-lang.org/book/
• Rust by Example
• http://rustbyexample.com
• Rust User Forums
• https://users.rust-lang.org
• https://internals.rust-lang.org
What to expect
on Session #2?
Next: Session #2
• Rust Standard Library
• Functions
• Conditional Statements
• Loops
• Vectors
• Strings
• Concurrency
• Error Handling
Group Photo
Thank you!
Maraming salamat po!
http://www.mozillaphilippines.org
bob@mozillaph.org

More Related Content

What's hot (20)

ProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacementProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacement
Wei-Ning Huang
 
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
Codemotion
 
I believe in rust
I believe in rustI believe in rust
I believe in rust
Reidar Sollid
 
Introduction to fedora 20cat
Introduction to fedora   20catIntroduction to fedora   20cat
Introduction to fedora 20cat
Medo EL-Masry
 
FOSS, history and philosophy
FOSS, history and philosophyFOSS, history and philosophy
FOSS, history and philosophy
Ahmed Mekkawy
 
Making Gentoo Tick
Making Gentoo TickMaking Gentoo Tick
Making Gentoo Tick
Anant Narayanan
 
NSLogger - Cocoaheads Paris Presentation - English
NSLogger - Cocoaheads Paris Presentation - EnglishNSLogger - Cocoaheads Paris Presentation - English
NSLogger - Cocoaheads Paris Presentation - English
Florent Pillet
 
Intoduction to Linux
Intoduction to LinuxIntoduction to Linux
Intoduction to Linux
Anshul Sharma
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
Chris McEniry
 
Go for SysAdmins - LISA 2015
Go for SysAdmins - LISA 2015Go for SysAdmins - LISA 2015
Go for SysAdmins - LISA 2015
Chris McEniry
 
tizen-oshw-tds14sh
tizen-oshw-tds14shtizen-oshw-tds14sh
tizen-oshw-tds14sh
Phil www.rzr.online.fr
 
Open Source Everything
Open Source EverythingOpen Source Everything
Open Source Everything
OWASP Nagpur
 
Ubuntu Quick Guide
Ubuntu Quick GuideUbuntu Quick Guide
Ubuntu Quick Guide
Anuchit Chalothorn
 
Breaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StoryBreaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success Story
Sage Sharp
 
Fedora Introduction
Fedora IntroductionFedora Introduction
Fedora Introduction
Prima Yogi Loviniltra
 
D1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFD1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FF
Anthony Jose
 
Tizen platform-dev-tds14sh
Tizen platform-dev-tds14shTizen platform-dev-tds14sh
Tizen platform-dev-tds14sh
Phil www.rzr.online.fr
 
Python workshop
Python workshopPython workshop
Python workshop
Marie Behzadi
 
Introduction to FOSS world
Introduction to FOSS worldIntroduction to FOSS world
Introduction to FOSS world
Narendra Sisodiya
 
Foss-Free and Open Source Software
Foss-Free and Open Source SoftwareFoss-Free and Open Source Software
Foss-Free and Open Source Software
Manish Lonewolf
 
ProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacementProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacement
Wei-Ning Huang
 
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
Codemotion
 
Introduction to fedora 20cat
Introduction to fedora   20catIntroduction to fedora   20cat
Introduction to fedora 20cat
Medo EL-Masry
 
FOSS, history and philosophy
FOSS, history and philosophyFOSS, history and philosophy
FOSS, history and philosophy
Ahmed Mekkawy
 
NSLogger - Cocoaheads Paris Presentation - English
NSLogger - Cocoaheads Paris Presentation - EnglishNSLogger - Cocoaheads Paris Presentation - English
NSLogger - Cocoaheads Paris Presentation - English
Florent Pillet
 
Intoduction to Linux
Intoduction to LinuxIntoduction to Linux
Intoduction to Linux
Anshul Sharma
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
Chris McEniry
 
Go for SysAdmins - LISA 2015
Go for SysAdmins - LISA 2015Go for SysAdmins - LISA 2015
Go for SysAdmins - LISA 2015
Chris McEniry
 
Open Source Everything
Open Source EverythingOpen Source Everything
Open Source Everything
OWASP Nagpur
 
Breaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StoryBreaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success Story
Sage Sharp
 
D1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFD1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FF
Anthony Jose
 
Foss-Free and Open Source Software
Foss-Free and Open Source SoftwareFoss-Free and Open Source Software
Foss-Free and Open Source Software
Manish Lonewolf
 

Similar to MozillaPH Rust Hack & Learn Session 1 (20)

Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016
Robert 'Bob' Reyes
 
Rust 101 (2017 edition)
Rust 101 (2017 edition)Rust 101 (2017 edition)
Rust 101 (2017 edition)
Robert 'Bob' Reyes
 
Embedded Rust
Embedded RustEmbedded Rust
Embedded Rust
Jens Siebert
 
Introduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptxIntroduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptx
Knoldus Inc.
 
Rust
RustRust
Rust
Naga Dinesh
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
gslicraf
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
Linaro
 
Some wonderful Linux softwares for daily use
Some wonderful Linux softwares for daily useSome wonderful Linux softwares for daily use
Some wonderful Linux softwares for daily use
arun.arwachin
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
Akhil Kaushik
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languages
actanimation
 
ECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginnerECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginner
MahmoudElsamanty
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos
 
программное обеспечение (по)
программное обеспечение (по) программное обеспечение (по)
программное обеспечение (по)
victoria_4
 
Lisbon rust lang meetup#1
Lisbon rust lang meetup#1Lisbon rust lang meetup#1
Lisbon rust lang meetup#1
João Oliveira
 
Rust All Hands Winter 2011
Rust All Hands Winter 2011Rust All Hands Winter 2011
Rust All Hands Winter 2011
Patrick Walton
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189
Mahmoud Samir Fayed
 
Rust programming-language
Rust programming-languageRust programming-language
Rust programming-language
Mujahid Malik Arain
 
Script of Scripts Polyglot Notebook and Workflow System
Script of ScriptsPolyglot Notebook and Workflow SystemScript of ScriptsPolyglot Notebook and Workflow System
Script of Scripts Polyglot Notebook and Workflow System
Bo Peng
 
Rustbridge
RustbridgeRustbridge
Rustbridge
kent marete
 
Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016Mozilla + Rust at PCU Manila 02 DEC 2016
Mozilla + Rust at PCU Manila 02 DEC 2016
Robert 'Bob' Reyes
 
Introduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptxIntroduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptx
Knoldus Inc.
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
gslicraf
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
Linaro
 
Some wonderful Linux softwares for daily use
Some wonderful Linux softwares for daily useSome wonderful Linux softwares for daily use
Some wonderful Linux softwares for daily use
arun.arwachin
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
Akhil Kaushik
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languages
actanimation
 
ECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginnerECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginner
MahmoudElsamanty
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos
 
программное обеспечение (по)
программное обеспечение (по) программное обеспечение (по)
программное обеспечение (по)
victoria_4
 
Lisbon rust lang meetup#1
Lisbon rust lang meetup#1Lisbon rust lang meetup#1
Lisbon rust lang meetup#1
João Oliveira
 
Rust All Hands Winter 2011
Rust All Hands Winter 2011Rust All Hands Winter 2011
Rust All Hands Winter 2011
Patrick Walton
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189
Mahmoud Samir Fayed
 
Script of Scripts Polyglot Notebook and Workflow System
Script of ScriptsPolyglot Notebook and Workflow SystemScript of ScriptsPolyglot Notebook and Workflow System
Script of Scripts Polyglot Notebook and Workflow System
Bo Peng
 

More from Robert 'Bob' Reyes (20)

Localization at Mozilla
Localization at MozillaLocalization at Mozilla
Localization at Mozilla
Robert 'Bob' Reyes
 
Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)
Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)
Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)
Robert 'Bob' Reyes
 
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Robert 'Bob' Reyes
 
Challenges & Opportunities the Data Privacy Act Brings
Challenges & Opportunities the Data Privacy Act BringsChallenges & Opportunities the Data Privacy Act Brings
Challenges & Opportunities the Data Privacy Act Brings
Robert 'Bob' Reyes
 
Building a Rust Community from Scratch (COSCUP 2017)
Building a Rust Community from Scratch (COSCUP 2017)Building a Rust Community from Scratch (COSCUP 2017)
Building a Rust Community from Scratch (COSCUP 2017)
Robert 'Bob' Reyes
 
MozillaPH Localization in 2016
MozillaPH Localization in 2016MozillaPH Localization in 2016
MozillaPH Localization in 2016
Robert 'Bob' Reyes
 
Mozilla & Connected Devices
Mozilla & Connected DevicesMozilla & Connected Devices
Mozilla & Connected Devices
Robert 'Bob' Reyes
 
HTML 5 - The Future is Now
HTML 5 - The Future is NowHTML 5 - The Future is Now
HTML 5 - The Future is Now
Robert 'Bob' Reyes
 
Getting started on MDN (Mozilla Developer Network)
Getting started on MDN (Mozilla Developer Network)Getting started on MDN (Mozilla Developer Network)
Getting started on MDN (Mozilla Developer Network)
Robert 'Bob' Reyes
 
Mozilla & the Open Web
Mozilla & the Open WebMozilla & the Open Web
Mozilla & the Open Web
Robert 'Bob' Reyes
 
Firefox OS
Firefox OSFirefox OS
Firefox OS
Robert 'Bob' Reyes
 
MozTour University of Perpetual Help System - Laguna (Binan)
MozTour University of Perpetual Help System - Laguna (Binan)MozTour University of Perpetual Help System - Laguna (Binan)
MozTour University of Perpetual Help System - Laguna (Binan)
Robert 'Bob' Reyes
 
Firefox 101 (FSA Camp Philippines 2015)
Firefox 101 (FSA Camp Philippines 2015)Firefox 101 (FSA Camp Philippines 2015)
Firefox 101 (FSA Camp Philippines 2015)
Robert 'Bob' Reyes
 
FOSSASIA 2015: Building an Open Source Community
FOSSASIA 2015: Building an Open Source CommunityFOSSASIA 2015: Building an Open Source Community
FOSSASIA 2015: Building an Open Source Community
Robert 'Bob' Reyes
 
Welcome to MozSpaceMNL
Welcome to MozSpaceMNLWelcome to MozSpaceMNL
Welcome to MozSpaceMNL
Robert 'Bob' Reyes
 
MozillaPH Trainers Training
MozillaPH Trainers TrainingMozillaPH Trainers Training
MozillaPH Trainers Training
Robert 'Bob' Reyes
 
Mozilla Reps Program
Mozilla Reps ProgramMozilla Reps Program
Mozilla Reps Program
Robert 'Bob' Reyes
 
Women and the open web
Women and the open webWomen and the open web
Women and the open web
Robert 'Bob' Reyes
 
Mozilla in the Philippines & Online Privacy (Social Media Day 2013)
Mozilla in the Philippines & Online Privacy (Social Media Day 2013)Mozilla in the Philippines & Online Privacy (Social Media Day 2013)
Mozilla in the Philippines & Online Privacy (Social Media Day 2013)
Robert 'Bob' Reyes
 
Webmaker Presentation of Bob Reyes during WoMoz PHL Kick-off
Webmaker Presentation of Bob Reyes during WoMoz PHL Kick-offWebmaker Presentation of Bob Reyes during WoMoz PHL Kick-off
Webmaker Presentation of Bob Reyes during WoMoz PHL Kick-off
Robert 'Bob' Reyes
 
Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)
Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)
Firefox Dev Tools for WordPress Developers (WordCamp Iloilo 2019)
Robert 'Bob' Reyes
 
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Robert 'Bob' Reyes
 
Challenges & Opportunities the Data Privacy Act Brings
Challenges & Opportunities the Data Privacy Act BringsChallenges & Opportunities the Data Privacy Act Brings
Challenges & Opportunities the Data Privacy Act Brings
Robert 'Bob' Reyes
 
Building a Rust Community from Scratch (COSCUP 2017)
Building a Rust Community from Scratch (COSCUP 2017)Building a Rust Community from Scratch (COSCUP 2017)
Building a Rust Community from Scratch (COSCUP 2017)
Robert 'Bob' Reyes
 
MozillaPH Localization in 2016
MozillaPH Localization in 2016MozillaPH Localization in 2016
MozillaPH Localization in 2016
Robert 'Bob' Reyes
 
Getting started on MDN (Mozilla Developer Network)
Getting started on MDN (Mozilla Developer Network)Getting started on MDN (Mozilla Developer Network)
Getting started on MDN (Mozilla Developer Network)
Robert 'Bob' Reyes
 
MozTour University of Perpetual Help System - Laguna (Binan)
MozTour University of Perpetual Help System - Laguna (Binan)MozTour University of Perpetual Help System - Laguna (Binan)
MozTour University of Perpetual Help System - Laguna (Binan)
Robert 'Bob' Reyes
 
Firefox 101 (FSA Camp Philippines 2015)
Firefox 101 (FSA Camp Philippines 2015)Firefox 101 (FSA Camp Philippines 2015)
Firefox 101 (FSA Camp Philippines 2015)
Robert 'Bob' Reyes
 
FOSSASIA 2015: Building an Open Source Community
FOSSASIA 2015: Building an Open Source CommunityFOSSASIA 2015: Building an Open Source Community
FOSSASIA 2015: Building an Open Source Community
Robert 'Bob' Reyes
 
Mozilla in the Philippines & Online Privacy (Social Media Day 2013)
Mozilla in the Philippines & Online Privacy (Social Media Day 2013)Mozilla in the Philippines & Online Privacy (Social Media Day 2013)
Mozilla in the Philippines & Online Privacy (Social Media Day 2013)
Robert 'Bob' Reyes
 
Webmaker Presentation of Bob Reyes during WoMoz PHL Kick-off
Webmaker Presentation of Bob Reyes during WoMoz PHL Kick-offWebmaker Presentation of Bob Reyes during WoMoz PHL Kick-off
Webmaker Presentation of Bob Reyes during WoMoz PHL Kick-off
Robert 'Bob' Reyes
 

Recently uploaded (20)

Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 

MozillaPH Rust Hack & Learn Session 1

  • 1. Rust Hack & Learn Session #1 Robert “Bob” Reyes 14 Jun 2016 #MozillaPH #RustPH
  • 2. Check-in at Swarm & Foursquare!
  • 3. #MozillaPH #RustPH If you’re on social media, please use our official hashtags for this event.
  • 4. Agenda • Mozilla in the Philippines • Installing Rust • Hello World, the Rust way • Intro to Cargo • IDE Support • Variables & Constants • Simple Arithmetic Functions
  • 5. Target Audience • People with some background in programming (any language). • People with zero or near-zero knowledge about Rust (Programming Language). • People who wants to learn a new programming language.
  • 8. History of Mozilla On 23 Feb 1998, Netscape Communications Corp. created a project called Mozilla (Mosaic Killer + Godzilla). Mozilla was launched 31 Mar 1998.
  • 10. Mozilla’s Mission To ensure the Internet is a global public resource, open & accessible to all.
  • 14. Some stuff that we are working on …
  • 18. How to be part of MozillaPH?
  • 19. Areas of Contribution  Helping Users (Support)  Testing & QA  Coding  Marketing  Translation & Localization  Web Development  Firefox Marketplace  Add-ons  Visual Design  Documentation & Writing  Education http://join.mozillaph.org
  • 23. Let’s get to know each other first. What is your name? From where are you? What do you do? Why are you here?
  • 24. Where are the MENTORS? Please feel free to approach & ask help from them 
  • 26. What is Rust? • Rust is a systems programming language that runs blazingly fast, prevents segfaults, & guarantees thread safety. • Compiles to Native Code like C++ & D. • Strength includes memory safety & correctness (just like in C). “Rust is a modern native-code language with a focus on safety.”
  • 28. Top 10 IoT Programming Languages 1. C Language 2. C++ 3. Python 4. Java 5. JavaScript 6. Rust 7. Go 8. Parasail 9. B# 10.Assembly • No particular order. • Based on popularity & following.
  • 30. Rust vs Go • Rust shares many of Go's qualities but solves one major problem of Go: • Go doesn't automatically share information between different "channel" data structures  "race condition" • A runaway situation in which a system can spiral out of control because different processes are working at odds with one another. • Rust includes functions that eliminate race conditions, making it a less-risky language than Go for highly concurrent programs.
  • 32. Low-Level Programming • (CS) a programming language that provides little or no abstraction from a computer's instruction set architecture • commands or functions in the language map closely to processor instructions. • generally referred as either machine code or assembly language. • E.g. Assembly Language
  • 33. High-Level Programming • (CS) a programming language with strong abstraction from the details of the computer. • Compared to low-level programming languages • may use natural language elements. • may automate (or even hide entirely) significant areas of computing systems (e.g. memory management). • E.g. COBOL, Fortran, LISP, ALGOL
  • 34. Programming Languages Hardware Machine Language Assembly Language High-Level Language Fortran | C | Pascal OO & Visual Languages C++ | D | Rust
  • 36. Mozilla ❤️ Rust • Rust grew out of a personal project by Mozilla employee Graydon Hoare. • Rust is sponsored by Mozilla Research since 2009 (announced in 2010).
  • 38. Features of Rust • Zero-cost abstractions • Move semantics • Guaranteed memory safety • Threads without data races • Trait-based generics • Pattern matching • Type inference • Minimal runtime • Efficient C bindings
  • 40. Projects Using Rust  Magic Pocket  Dropbox's file storage system that powers their Diskotech petabyte storage machines.  Servo  Mozilla's new parallel rendering engine developed in collaboration with Samsung.  OpenDNS  Uses Rust in two of its components.  Redox OS  A microkernel operating system being developed in Rust.
  • 42. Installing Rust • Installer for Windows, Mac OS X & Linux available via https://www.rust-lang.org • If you wish to run Rust on your local machine when you’re offline. • Rust Playground [https://play.rust-lang.org] • If you are online, you may opt to use this one instead. • You may use ANY text editor to code in Rust. • As a practice, please save your Rust code using .rs file extension.
  • 44. Function main() • Every Rust program must have at least one (01) function. • Simplest possible function declaration is named as “main” fn main() { } • Functions can also take arguments fn print_number(x:i32) { println!(“x is: {}”, x); }
  • 47. Cargo
  • 48. Cargo • A tool that allows Rust projects to declare their various dependencies & ensure that you’ll always get a repeatable build. • Cargo does: 1. Introduces two (02) metadata files with various bits of project information. 2. Fetches & builds your project’s dependencies. 3. Invokes rustc or another build tool with the correct parameters to build your project. 4. Introduces conventions to make working with Rust projects easier.
  • 49. Cargo • To start a new project with Cargo, we invoke in the command line: cargo new hello_world --bin • Cargo will generate the following files & folders:  Cargo.toml [file]  src [folder]  main.rs [file] • Acts as a manifest file • Contains all of the metadata that Cargo needs to compile your project.
  • 51. TOML • Tom’s Obvious, Minimal Language (or some say, Tom’s Own Markup Language) • Created by Tom Preston-Werner • Aims to be a minimal configuration file format that's easy to read due to obvious semantics. • Designed to map unambiguously to a hash table. • Should be easy to parse into data structures in a wide variety of languages.
  • 55. IDE Support • Modern IDEs give developers a massive increase in productivity. • Several community projects have provided an excellent start towards IDE support. • Good IDE support requires a number of components: • The compiler must be modified to operate in a different mode. • Must provide name & type information from the compiler to the IDE. • Must write plugins for the IDEs themselves so they know what to do with Rust projects.
  • 56. IDE Support • Available IDE Plugins: • Eclipse [https://github.com/RustDT/RustDT] • Intellij IDEA [https://github.com/intellij-rust/intellij-rust] • Visual Studio [https://github.com/PistonDevelopers/VisualRust] • Editor Plugins: • Atom [https://atom.io/packages/language-rust] • Emacs [https://github.com/rust-lang/rust-mode] • Sublime Text [https://packagecontrol.io/packages/Rust] • Vim [https://github.com/rust-lang/rust.vim] • Visual Studio Code [https://github.com/saviorisdead/RustyCode]
  • 57. More on IDE Support https://www.rust-lang.org/ides.html
  • 59. Variables • Variable Declaration fn main() { let a:u8 = 123; } • Whereas • a  variable • u8  data type (unsigned; 0 or positive; 8-bit) • 123  value of variable “a”
  • 60. Numeric Data Types • i8  8-bit signed integer • i16  16-bit signed integer • i32  32-bit signed integer • i64  64-bit signed integer • u8  8-bit unsigned integer • u16  16-bit unsigned integer • u32  32-bit unsigned integer • u64  64-bit unsigned integer • isize  pointer-size signed integer • usize  pointer-size unsigned integer • f32/f64  32/64-bit floating point
  • 62. Mutability • The ability to change something. • Mutable variable binding. • You’re allowed to change what the binding points to. let x = 5; x = 6;  will result to an error! • We can use the mut keyword: let mut x = 5; x = 6;  no problem; no error!
  • 63. Constants • Aside from using variables, we can also declare constants in Rust: const PI:u8 = 3;  no fixed memory address  memory safety is NOT compromised static X:i32 = 123;
  • 65. Arithmetic Operators +  addition & array/string concatenation -  subtraction *  multiplication /  quotient %  remainder
  • 66. Arithmetic Operators • Rust DOES NOT support ++ and – used in other programming languages. • a = a+1; or • a += 1; • b = b-1; or • b -= 1; • You may also use the following in Rust • *= • /= • %=
  • 67. Arithmetic Operators let mut a = 2+3*4; println!(“Answer = {}.”, a); let mut a = (2+3)*4; println!(“Answer = {}.”, a);
  • 68. Arithmetic Operators let mut a = 10/3; println!(“Answer = {}.”, a); let mut a = 10%3; println!(“Answer = {}.”, a); let a=10; println!(“Remainder of {} / {} = {}”, a, 3, (a%3));
  • 70. Arithmetic Operators (eg1) fn main() { let num1 = 20; let num2 = 10; println!(“The SUM of the numbers = {}”, (num1 + num2)); println!(”The DIFFERENCE of the numbers = {}”, (num1 – num2)); … and so on
  • 71. Arithmetic Operators (eg2) fn main() { let num1 = 20; let num2 = 10; let sum = num1 + num2; let dif = num1 – num2; let pro = num1 * num2; let quo = num1 / num2; println!(“The SUM of the numbers = {}”, sum); … and so on
  • 72. Q&A
  • 75. Reference Materials • The Rust Programming Language Book • https://doc.rust-lang.org/book/ • Rust by Example • http://rustbyexample.com • Rust User Forums • https://users.rust-lang.org • https://internals.rust-lang.org
  • 76. What to expect on Session #2?
  • 77. Next: Session #2 • Rust Standard Library • Functions • Conditional Statements • Loops • Vectors • Strings • Concurrency • Error Handling
  • 79. Thank you! Maraming salamat po! http://www.mozillaphilippines.org [email protected]

Editor's Notes

  • #73: - IDE for Rust
  • #74: - IDE for Rust
  • #75: - IDE for Rust
  • #77: - IDE for Rust
  • #78: - image processing in rust - is rust OO