SlideShare a Scribd company logo
RUSTED RUBY
Ian Pointer (@carsondial)
July 11th 2017
WHAT'S RUST?
"Rust is a systems programming language that runs
blazingly fast, prevents segfaults, and guarantees
thread safety."
Developed by Mozilla as alternative to C++ for future
browser cores
WHAT'S WRONG WITH C?
Writing good, portable C code is hard.
Lack of modern standard library (that is also good &
portable)
So many ways to leave potential attack vectors in
your code
WHY ANOTHER
LANGUAGE??
Rust offers memory safety without GC
Zero-cost abstractions - use all your fancy modern
constructs!
Taking the scariness out of systems programming!
AND MORE!
cargo - packages ("crates") built from lessons of
gems and npm
Taking the safety off with unsafe
Friendly community!
OUR FIRST RUST
PROGRAM
fn main() {
let hello = "hello world";
println!("{:?}", hello)
}
THE COMPILER WILL SEE
YOU NOW
fn change(some_string: String) -> String {
String::from("hello, world")
}
fn main() {
let s = String::from("hello");
let t = change(s);
println!("{:?}", s);
println!("{:?}", t)
}
TAKEAWAYS
Immutability by default
There is a learning curve!
EXTENSIONS IN RUBY
Used fairly o en in the Ruby world
e.g. psych, mysql2, ruby-pg, nokogiri
Almost certainly written in C
WHAT COULD POSSIBLY
GO WRONG?
SO, RUST, THEN…
Rust loves working with C/C++-based programs
rust-bindgen produces Rust bindings from
C/C++
Give it a .h file and watch it go!
BOY, THAT'S A LOT OF
BOILERPLATE
Gaze and despair!
ENTER HELIX
Created by Godfrey Chan and Yehuda Katz
Rust macros and scaffolding
Takes care of all that boilerplate so you don't have
to!
Generates Rust crates that are also Ruby gems
LET'S BUILD AN
EXTENSION!
Pathname.absolute?
Perhaps used more than you'd think (e.g. in
Sprockets)
EXTENSIONS!
Add gem 'helix-rails' & bundle install
$ rails generate helix:crate helix_example
DEMO
Example Helix Rails app
CAVEATS
Getting access to self can be a hassle
You can (and may need to) write more Rust
supporting code
Lots of magic going on!
THINGS (HOPEFULLY!) TO
TAKE AWAY
Rust is not scary! (mostly)
Writing Rust extensions in Helix is easy!
You don't need to rewrite everything in Rust
Profile your code (e.g. with stackprof)
Use the samples to identify methods that might gain
from Rust
LINKS
(friendly!)
Rust
The Rust Book
Helix
Example Helix Rails app
faster_path
Rust Reddit
Triangle Rustaceans

More Related Content

PDF
A small introduction to rust language
KEY
REDStudy#1
PDF
Sinatra: прошлое, будущее и настоящее
PDF
Intro to introducing rust to ruby
PPT
Introduction to java new
PPT
Introduction to java new
PDF
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
PPTX
A small introduction to rust language
REDStudy#1
Sinatra: прошлое, будущее и настоящее
Intro to introducing rust to ruby
Introduction to java new
Introduction to java new
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016

Similar to Rusted Ruby (20)

PPTX
A Slice Of Rust - A quick look at the Rust programming language
PPTX
Legacy of Void*
PDF
Introduction to Google's Go programming language
PDF
Intro to Rust 2019
PPTX
Rust Hack
PDF
Easy native wrappers with SWIG
KEY
node.js: Javascript's in your backend
PDF
XSS Without Browser
PDF
Ruby for Java Developers
PPTX
Intro to Rust for Solana.pptx
PDF
IronRuby for the Rubyist
PDF
The Rust Programming Language
PPTX
Serverless in action
PDF
Introduction to Rust
PPTX
Rust programming-language
PDF
Mario heiderich. got your nose! how to steal your precious data without using...
PPTX
Why Rust? by Edd Barrett (codeHarbour December 2019)
PDF
Ruby is dying. What languages are cool now?
PDF
MMT 29: "Hab Dich!" -- Wie Angreifer ganz ohne JavaScript an Deine wertvollen...
PPTX
MozillaPH Rust Hack & Learn Session 1
A Slice Of Rust - A quick look at the Rust programming language
Legacy of Void*
Introduction to Google's Go programming language
Intro to Rust 2019
Rust Hack
Easy native wrappers with SWIG
node.js: Javascript's in your backend
XSS Without Browser
Ruby for Java Developers
Intro to Rust for Solana.pptx
IronRuby for the Rubyist
The Rust Programming Language
Serverless in action
Introduction to Rust
Rust programming-language
Mario heiderich. got your nose! how to steal your precious data without using...
Why Rust? by Edd Barrett (codeHarbour December 2019)
Ruby is dying. What languages are cool now?
MMT 29: "Hab Dich!" -- Wie Angreifer ganz ohne JavaScript an Deine wertvollen...
MozillaPH Rust Hack & Learn Session 1
Ad

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
System and Network Administraation Chapter 3
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administration Chapter 2
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ai tools demonstartion for schools and inter college
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Digital Strategies for Manufacturing Companies
PPTX
Essential Infomation Tech presentation.pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
Odoo POS Development Services by CandidRoot Solutions
System and Network Administraation Chapter 3
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administration Chapter 2
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Understanding Forklifts - TECH EHS Solution
ai tools demonstartion for schools and inter college
Odoo Companies in India – Driving Business Transformation.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
CHAPTER 2 - PM Management and IT Context
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
VVF-Customer-Presentation2025-Ver1.9.pptx
Digital Strategies for Manufacturing Companies
Essential Infomation Tech presentation.pptx
L1 - Introduction to python Backend.pptx
Design an Analysis of Algorithms II-SECS-1021-03
Ad

Rusted Ruby