SlideShare a Scribd company logo
Introduction to
Rust
(Programming Language)
Robert “Bob” Reyes
08 Sep 2017
#MozillaPH
#RustPH
#MozillaPH
#RustPH
If you’re on social media, please use
our official hashtags for this talk.
About Me
• Mozilla Rep for the PHL since 2011
• Technopreneur at TurfSitePH.net
• Technology Columnist at MB.com.ph
• Team Manager at SIPFC.org
• Dad of Xeon & Haswell
Being an Open Source Dev
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.
Agenda
• Mozilla in the Philippines
• Installing Rust
• Hello World, the Rust way
• Intro to Cargo
• IDE Support
• Variables & Constants
• Simple Arithmetic Functions
What is
Mozilla?
#MozillaPH
History of Mozilla
On 23 Feb 1998,
Netscape Communications Corp.
created a project called
Mozilla (Mosaic + Godzilla).
Mozilla was launched 31 Mar 1998.
We have a NEW
brand identity…
We have a NEW
brand identity…
The
Mozilla Manifesto
Mozilla’s Mission
To ensure the Internet
is a global public
resource, open &
accessible to all.
Get involved …
Some stuff that we
are working on …
Rust 101 (2017 edition)
#MozillaPH
Rust 101 (2017 edition)
#MozillaPH
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
 Rust Development
http://join.mozillaph.org
Join MozillaPH now!
http://join.mozillaph.org
Internship
at Mozilla
https://careers.mozilla.org/university/
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Mozilla HQ
Rust 101 (2017 edition)
#MozillaPH
Rust 101 (2017 edition)
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.”
What is Rust?
• At present…
• Rust has more than 6.8K libraries, with
more than 85M downloads at crates.io
• More than 40 companies publically
using in production (Friends of Rust).
Mozilla &
Rust?
Mozilla ❤️ Rust
• Started as Mozillian Graydon Hoare’s
side project.
• He began working on Rust full time in 2009.
• Rust 1.0 released in 2015.
• New releases every six (06) weeks.
• Rust is Mozilla-supported, rather than
Mozilla-owned.
Rust &
Servo
Rust & Servo
• One part of Mozilla is working on
improving Rust.
• Another part is building a brand new web
rendering engine using Rust: Servo.
• High-level goals of Servo:
• Implement parallel layout.
• Experiment with alternative rendering design.
• Investigate feasibility of complete JS GC integration.
• Incubator for experiments that can be reintegrated
into Firefox.
Rust &
Firefox
Rust & Firefox
• We are already shipping Rust code in
Firefox (inside the media stack).
• The process of re-writing existing C++
code to Rust is called Oxidation.
• Some of the most challenging projects
related to Oxidation is part of the
Quantum project.
• The amount of Rust code in Firefox will
increase over time.
Rust & Firefox
Why
Rust?
Why Rust?
• Rust solves two core problems from
C++ & similar low-level programming
languages:
• Data races in multithreaded code.
• Use-after-free (UAF) errors.
• UAF’s are huge source of security
exploits in Firefox & other browsers.
• Both problems are addressed by making
“ownership” explicit.
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.
Low-Level
vs
High-Level
Programming Languages
Hardware
Machine Language
Assembly Language
High-Level Language
Fortran | C | Pascal
OO & Visual Languages
C++ | D | Rust
Ownership
in Rust
Ownership in Rust
• Encapsulates two (02) concepts:
• The lifetime of a value (i.e. when it is valid to
interact with it).
• Unique vs Shared Values.
• Leads to a few rules:
• Uniquely-owned values are destroyed when
they go out of scope.
• Only uniquely-owned values can be mutated.
• Borrowing a value means it is no longer
uniquely owned.
Ownership in Rust (Analogy)
• I have a coloring book, a marker & some
friends.
• If I leave, the coloring book & marker
leave with me.
• If a friend borrows the book, I can no
longer color it.
• My friends can also lend it to other friends.
• If someone leaves while my friends are
borrowing the book, they give it back before
leaving.
Ownership in Rust (Analogy)
• I can’t leave if the book is still borrowed.
• Either I wait, or I should have given it away.
• I can also lend someone the marker along with the
book, if they want to color in it.
How Does Ownership Help?
• Use-After-Free
• Can’t return/store pointer to an object that may
be deallocated before pointer.
• Can’t use immutable & mutable pointers to the
same object.
• Data Races
• Forced transfer ownership of data or copy when
using multiple threads.
• Only types that abide by compiler rules can be
shared – ensures type locking/atomic access is
used.
Race
Condition
Rust 101 (2017 edition)
What is Race Condition?
• A race condition is…
• An undesirable situation.
• Occurs when a device or system
attempts to perform two or more
operations at the same time.
• But because of the nature of the device
or system, the operations must be done
in the proper sequence to be done
correctly.
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.
Projects Using Rust
 Xi Editor
 The xi editor project is an attempt to build a high
quality text editor, using modern software
engineering techniques.
 GNU uutils coreutils
 uutils is an attempt at writing universal (as in cross-
platform) CLI utils in Rust. This repo is to
aggregate the GNU coreutils rewrites.
 Neon
 A safe Rust abstraction layer for native Node.js
modules.
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.
Rust Playground
Rust Playground (Run)
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!”);
}
helloworld.rs (Run)
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
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
facebook.com/groups/rustph
https://rustph.slack.com
To request an invite:
https://rustphslack.herokuapp.com
Thank you!
Maraming salamat po!
http://www.mozillaphilippines.org
bob@mozillaph.org
Ad

More Related Content

What's hot (20)

Embedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devicesEmbedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devices
Lars Gregori
 
Embedded Rust on IoT devices
Embedded Rust on IoT devicesEmbedded Rust on IoT devices
Embedded Rust on IoT devices
Lars Gregori
 
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
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
Matt Stine
 
JRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherJRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform Further
Charles Nutter
 
Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014
Charles Nutter
 
AV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkAV Evasion with the Veil Framework
AV Evasion with the Veil Framework
VeilFramework
 
Veil-Ordnance
Veil-OrdnanceVeil-Ordnance
Veil-Ordnance
VeilFramework
 
OpenZFS Developer Summit Introduction
OpenZFS Developer Summit IntroductionOpenZFS Developer Summit Introduction
OpenZFS Developer Summit Introduction
Matthew Ahrens
 
Programming The Arduino Due in Rust
Programming The Arduino Due in RustProgramming The Arduino Due in Rust
Programming The Arduino Due in Rust
kellogh
 
Php core. get rid of bugs and contribute
Php core. get rid of bugs and contributePhp core. get rid of bugs and contribute
Php core. get rid of bugs and contribute
Pierre Joye
 
An Intro to Js & Node.js
An Intro to Js & Node.jsAn Intro to Js & Node.js
An Intro to Js & Node.js
Premchand Kumar
 
Posladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript aPosladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript a
Peter A. Pirc
 
Portable PHP
Portable PHPPortable PHP
Portable PHP
weltling
 
Devcon hh-2012
Devcon hh-2012Devcon hh-2012
Devcon hh-2012
Pierre Joye
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
Kyle Drake
 
Pharo Update
Pharo Update Pharo Update
Pharo Update
ESUG
 
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
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Codemotion
 
Introduction to ethereum_public
Introduction to ethereum_publicIntroduction to ethereum_public
Introduction to ethereum_public
antitree
 
Embedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devicesEmbedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devices
Lars Gregori
 
Embedded Rust on IoT devices
Embedded Rust on IoT devicesEmbedded Rust on IoT devices
Embedded Rust on IoT devices
Lars Gregori
 
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
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
Matt Stine
 
JRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherJRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform Further
Charles Nutter
 
Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014
Charles Nutter
 
AV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkAV Evasion with the Veil Framework
AV Evasion with the Veil Framework
VeilFramework
 
OpenZFS Developer Summit Introduction
OpenZFS Developer Summit IntroductionOpenZFS Developer Summit Introduction
OpenZFS Developer Summit Introduction
Matthew Ahrens
 
Programming The Arduino Due in Rust
Programming The Arduino Due in RustProgramming The Arduino Due in Rust
Programming The Arduino Due in Rust
kellogh
 
Php core. get rid of bugs and contribute
Php core. get rid of bugs and contributePhp core. get rid of bugs and contribute
Php core. get rid of bugs and contribute
Pierre Joye
 
An Intro to Js & Node.js
An Intro to Js & Node.jsAn Intro to Js & Node.js
An Intro to Js & Node.js
Premchand Kumar
 
Posladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript aPosladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript a
Peter A. Pirc
 
Portable PHP
Portable PHPPortable PHP
Portable PHP
weltling
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
Kyle Drake
 
Pharo Update
Pharo Update Pharo Update
Pharo Update
ESUG
 
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
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Codemotion
 
Introduction to ethereum_public
Introduction to ethereum_publicIntroduction to ethereum_public
Introduction to ethereum_public
antitree
 

Similar to Rust 101 (2017 edition) (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
 
How to get started in Open Source!
How to get started in Open Source!How to get started in Open Source!
How to get started in Open Source!
Pradeep Singh
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
elliando dias
 
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
Akihiro Suda
 
sl slides-unit-1.pptx
sl slides-unit-1.pptxsl slides-unit-1.pptx
sl slides-unit-1.pptx
SRAVANTHISALLARAM1
 
Stop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal developmentStop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal development
kaspergarnaes
 
How to create/improve OSS product and its community (revised)
How to create/improve OSS product and its community (revised)How to create/improve OSS product and its community (revised)
How to create/improve OSS product and its community (revised)
SATOSHI TAGOMORI
 
The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196
Mahmoud Samir Fayed
 
Robot operating system [ROS]
Robot operating system [ROS]Robot operating system [ROS]
Robot operating system [ROS]
Abrar Mohamed
 
Open Source Software
Open Source Software Open Source Software
Open Source Software
Ali Yavari
 
The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30
Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31
Mahmoud Samir Fayed
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
gslicraf
 
Markup languages and warp-speed documentation
Markup languages and warp-speed documentationMarkup languages and warp-speed documentation
Markup languages and warp-speed documentation
Lois Patterson
 
Lois Patterson: Markup Languages and Warp-Speed Documentation
Lois Patterson:  Markup Languages and Warp-Speed DocumentationLois Patterson:  Markup Languages and Warp-Speed Documentation
Lois Patterson: Markup Languages and Warp-Speed Documentation
Jack Molisani
 
GoOpen 2010: David Elboth
GoOpen 2010: David ElbothGoOpen 2010: David Elboth
GoOpen 2010: David Elboth
Friprogsenteret
 
Dart presentation
Dart presentationDart presentation
Dart presentation
Lucas Leal
 
Go: What's Different ?
Go: What's Different ?Go: What's Different ?
Go: What's Different ?
Tarun Vashisth
 
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
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
Amal Mohan N
 
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
 
How to get started in Open Source!
How to get started in Open Source!How to get started in Open Source!
How to get started in Open Source!
Pradeep Singh
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
elliando dias
 
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
FILEgrain: Transport-Agnostic, Fine-Grained Content-Addressable Container Ima...
Akihiro Suda
 
Stop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal developmentStop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal development
kaspergarnaes
 
How to create/improve OSS product and its community (revised)
How to create/improve OSS product and its community (revised)How to create/improve OSS product and its community (revised)
How to create/improve OSS product and its community (revised)
SATOSHI TAGOMORI
 
The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196
Mahmoud Samir Fayed
 
Robot operating system [ROS]
Robot operating system [ROS]Robot operating system [ROS]
Robot operating system [ROS]
Abrar Mohamed
 
Open Source Software
Open Source Software Open Source Software
Open Source Software
Ali Yavari
 
The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30
Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31
Mahmoud Samir Fayed
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
gslicraf
 
Markup languages and warp-speed documentation
Markup languages and warp-speed documentationMarkup languages and warp-speed documentation
Markup languages and warp-speed documentation
Lois Patterson
 
Lois Patterson: Markup Languages and Warp-Speed Documentation
Lois Patterson:  Markup Languages and Warp-Speed DocumentationLois Patterson:  Markup Languages and Warp-Speed Documentation
Lois Patterson: Markup Languages and Warp-Speed Documentation
Jack Molisani
 
GoOpen 2010: David Elboth
GoOpen 2010: David ElbothGoOpen 2010: David Elboth
GoOpen 2010: David Elboth
Friprogsenteret
 
Dart presentation
Dart presentationDart presentation
Dart presentation
Lucas Leal
 
Go: What's Different ?
Go: What's Different ?Go: What's Different ?
Go: What's Different ?
Tarun Vashisth
 
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
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
Amal Mohan N
 
Ad

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
 
MozillaPH Rust Hack & Learn Session 2
MozillaPH Rust Hack & Learn Session 2MozillaPH Rust Hack & Learn Session 2
MozillaPH Rust Hack & Learn Session 2
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
 
Connected Devices, MozVR & Firefox Developer Tools
Connected Devices, MozVR & Firefox Developer ToolsConnected Devices, MozVR & Firefox Developer Tools
Connected Devices, MozVR & Firefox Developer Tools
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
 
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
 
MozillaPH Rust Hack & Learn Session 2
MozillaPH Rust Hack & Learn Session 2MozillaPH Rust Hack & Learn Session 2
MozillaPH Rust Hack & Learn Session 2
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
 
Connected Devices, MozVR & Firefox Developer Tools
Connected Devices, MozVR & Firefox Developer ToolsConnected Devices, MozVR & Firefox Developer Tools
Connected Devices, MozVR & Firefox Developer Tools
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
 
Ad

Recently uploaded (20)

Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 

Rust 101 (2017 edition)

  • 1. Introduction to Rust (Programming Language) Robert “Bob” Reyes 08 Sep 2017 #MozillaPH #RustPH
  • 2. #MozillaPH #RustPH If you’re on social media, please use our official hashtags for this talk.
  • 3. About Me • Mozilla Rep for the PHL since 2011 • Technopreneur at TurfSitePH.net • Technology Columnist at MB.com.ph • Team Manager at SIPFC.org • Dad of Xeon & Haswell
  • 4. Being an Open Source Dev
  • 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.
  • 6. Agenda • Mozilla in the Philippines • Installing Rust • Hello World, the Rust way • Intro to Cargo • IDE Support • Variables & Constants • Simple Arithmetic Functions
  • 9. History of Mozilla On 23 Feb 1998, Netscape Communications Corp. created a project called Mozilla (Mosaic + Godzilla). Mozilla was launched 31 Mar 1998.
  • 10. We have a NEW brand identity…
  • 11. We have a NEW brand identity…
  • 13. Mozilla’s Mission To ensure the Internet is a global public resource, open & accessible to all.
  • 15. Some stuff that we are working on …
  • 20. How to be part of MozillaPH?
  • 21. Areas of Contribution  Helping Users (Support)  Testing & QA  Coding  Marketing  Translation & Localization  Web Development  Firefox Marketplace  Add-ons  Visual Design  Documentation & Writing  Education  Rust Development http://join.mozillaph.org
  • 47. 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.”
  • 48. What is Rust? • At present… • Rust has more than 6.8K libraries, with more than 85M downloads at crates.io • More than 40 companies publically using in production (Friends of Rust).
  • 50. Mozilla ❤️ Rust • Started as Mozillian Graydon Hoare’s side project. • He began working on Rust full time in 2009. • Rust 1.0 released in 2015. • New releases every six (06) weeks. • Rust is Mozilla-supported, rather than Mozilla-owned.
  • 52. Rust & Servo • One part of Mozilla is working on improving Rust. • Another part is building a brand new web rendering engine using Rust: Servo. • High-level goals of Servo: • Implement parallel layout. • Experiment with alternative rendering design. • Investigate feasibility of complete JS GC integration. • Incubator for experiments that can be reintegrated into Firefox.
  • 54. Rust & Firefox • We are already shipping Rust code in Firefox (inside the media stack). • The process of re-writing existing C++ code to Rust is called Oxidation. • Some of the most challenging projects related to Oxidation is part of the Quantum project. • The amount of Rust code in Firefox will increase over time.
  • 57. Why Rust? • Rust solves two core problems from C++ & similar low-level programming languages: • Data races in multithreaded code. • Use-after-free (UAF) errors. • UAF’s are huge source of security exploits in Firefox & other browsers. • Both problems are addressed by making “ownership” explicit.
  • 58. 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.
  • 60. Programming Languages Hardware Machine Language Assembly Language High-Level Language Fortran | C | Pascal OO & Visual Languages C++ | D | Rust
  • 62. Ownership in Rust • Encapsulates two (02) concepts: • The lifetime of a value (i.e. when it is valid to interact with it). • Unique vs Shared Values. • Leads to a few rules: • Uniquely-owned values are destroyed when they go out of scope. • Only uniquely-owned values can be mutated. • Borrowing a value means it is no longer uniquely owned.
  • 63. Ownership in Rust (Analogy) • I have a coloring book, a marker & some friends. • If I leave, the coloring book & marker leave with me. • If a friend borrows the book, I can no longer color it. • My friends can also lend it to other friends. • If someone leaves while my friends are borrowing the book, they give it back before leaving.
  • 64. Ownership in Rust (Analogy) • I can’t leave if the book is still borrowed. • Either I wait, or I should have given it away. • I can also lend someone the marker along with the book, if they want to color in it.
  • 65. How Does Ownership Help? • Use-After-Free • Can’t return/store pointer to an object that may be deallocated before pointer. • Can’t use immutable & mutable pointers to the same object. • Data Races • Forced transfer ownership of data or copy when using multiple threads. • Only types that abide by compiler rules can be shared – ensures type locking/atomic access is used.
  • 68. What is Race Condition? • A race condition is… • An undesirable situation. • Occurs when a device or system attempts to perform two or more operations at the same time. • But because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly.
  • 70. 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
  • 72. 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.
  • 73. Projects Using Rust  Xi Editor  The xi editor project is an attempt to build a high quality text editor, using modern software engineering techniques.  GNU uutils coreutils  uutils is an attempt at writing universal (as in cross- platform) CLI utils in Rust. This repo is to aggregate the GNU coreutils rewrites.  Neon  A safe Rust abstraction layer for native Node.js modules.
  • 75. 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.
  • 79. 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); }
  • 83. Cargo
  • 84. 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.
  • 85. 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.
  • 87. 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.
  • 91. 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.
  • 92. 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]
  • 93. More on IDE Support https://www.rust-lang.org/ides.html
  • 95. 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”
  • 96. 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
  • 98. 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!
  • 99. 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;
  • 101. Arithmetic Operators +  addition & array/string concatenation -  subtraction *  multiplication /  quotient %  remainder
  • 102. 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 • *= • /= • %=
  • 103. Arithmetic Operators let mut a = 2+3*4; println!(“Answer = {}.”, a); let mut a = (2+3)*4; println!(“Answer = {}.”, a);
  • 104. 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));
  • 106. 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
  • 107. 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
  • 108. Q&A
  • 110. 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
  • 112. https://rustph.slack.com To request an invite: https://rustphslack.herokuapp.com
  • 113. Thank you! Maraming salamat po! http://www.mozillaphilippines.org [email protected]

Editor's Notes

  • #5: Hackers and governments using the web browser as vectors to steal data from users. Huge numbers of these (exploits) released every year. Mozilla addressed this issue by creating a new programming language.
  • #55: Servo is being built from ground-up. Firefox is not enough today. There were design decisions for Firefox made more than a decade ago, that are very difficult to change now. It will involve tons of work to re-design Firefox, so we thought of creating a new web browser engine instead. Servo serves as a playground for us to experiment with things that we could do better in Firefox.
  • #57: Quantum is not a new web browser. Quantum is Mozilla's project to build the next-generation web engine for Firefox users, building on the Gecko engine as a solid foundation. Quantum will leverage the fearless concurrency of Rust and high-performance components of Servo to bring more parallelization and GPU offloading to Firefox.
  • #58: Quantum is not a new web browser. Quantum is Mozilla's project to build the next-generation web engine for Firefox users, building on the Gecko engine as a solid foundation. Quantum will leverage the fearless concurrency of Rust and high-performance components of Servo to bring more parallelization and GPU offloading to Firefox.
  • #60: Hackers and governments using the web browser as vectors to steal data from users. Huge numbers of these (exploits) released every year. Mozilla addressed this issue by creating a new programming language.
  • #117: - IDE for Rust
  • #118: - IDE for Rust
  • #120: - IDE for Rust
  • #121: - IDE for Rust
  • #122: - IDE for Rust