Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Helix: Ruby Native Extensions Without Fear
Search
Godfrey Chan
April 26, 2017
Programming
0
200
Helix: Ruby Native Extensions Without Fear
Helix makes writing Ruby classes in Rust safe and fun. Find out how!
Godfrey Chan
April 26, 2017
Tweet
Share
More Decks by Godfrey Chan
See All by Godfrey Chan
Virtual EmberConf 2022: Platform State of the Union
chancancode
0
240
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
210
Virtual EmberConf 2020: Platform State of the Union
chancancode
1
320
Thinking in TypeScript
chancancode
0
260
The Lifecycle of a Rails Request
chancancode
3
14k
Dropping Down To The Metal™ (2018)
chancancode
0
110
Using Skylight to Solve Real-World Performance Problems
chancancode
1
350
Prying Open The Black Box (EmberConf 2018)
chancancode
0
360
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.7k
Other Decks in Programming
See All in Programming
Unlock the Potential of Swift Code Generation
rockname
0
250
プロフェッショナルとしての成長「問題の深掘り」が導く真のスキルアップ / issue-analysis-and-skill-up
minodriven
7
930
ComposeでWebアプリを作る技術
tbsten
0
110
RubyKaigi Dev Meeting 2025
tenderlove
1
160
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
160
Vibe Coding の話をしよう
schroneko
6
940
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.7k
KawaiiLT 登壇資料 キャリアとモチベーション
hiiragi
0
110
複雑なフォームの jotai 設計 / Designing jotai(state) for Complex Forms #layerx_frontend
izumin5210
3
970
監視 やばい
syossan27
6
3.2k
Make Parsers Compatible Using Automata Learning
makenowjust
1
4.7k
Fiber Scheduler vs. General-Purpose Parallel Client
hayaokimura
1
100
Featured
See All Featured
BBQ
matthewcrist
88
9.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.6k
Bash Introduction
62gerente
611
210k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
How to Ace a Technical Interview
jacobian
276
23k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
13
1.4k
We Have a Design System, Now What?
morganepeng
52
7.5k
Automating Front-end Workflow
addyosmani
1369
200k
Practical Orchestrator
shlominoach
186
11k
Transcript
Previously…
Ruby is slow… – Usually it doesn’t matter – Most
workload are I/O bound – But occasionally it does…
“Best of both worlds” – Native extensions – JSON gem
– Very fast – Transparent to the user – Date, Pathname, etc…
Turbo Rails…? – String#blank? – Sam Saffron’s fast_blank – 50
LOC in C – 20x speedup
But C… – Unsafe – Risky – segfaults! – Maintenance
burden – Contribution barrier
Skylight Agent – Started with Ruby – Too much overhead
– Native extension! – But C…
Meet Rust – Like C: compiled, statically typed, very fast
– Unlike C: enjoyable to use, guarantees safety – “If it compiles, it doesn’t crash” – Same guarantee as Ruby, but without GC
Zero-cost abstractions™ – In Ruby: tension between abstractions and performance
– Symbol#to_proc, Enumerable#map, etc – In Rust: no such tradeoff – Compiler is magic
fast_blank in Rust* * boilerplate not included
fast_blank in Helix
The vision – Keep writing the Ruby you love… –
…without the fear of eventually hitting a wall – Start with Ruby – Move to Helix when appropriate
Last year – Good proof-of-concept – Too hard to use
– Missing basic features
This year – Deploy to production – Polish, documentation –
Features – Focus on Rails
Demo! – End-to-end example – Deploy to Heroku – It
works!™
▶ http://chancancode.tv/helix
Good use cases – CPU-bound – Simple inputs – Avoid
chatty APIs
Good use cases
Good use cases – Use Rust libraries – Leverage Rust
web browser tech – Mailer, Background job, Action Cable
None
Roadmap – Greenfield project – Drop-in replacement – Reopen class
– Ship to production – Binary distribution – Non-traditional use-cases – Performance parity with C – Miscellaneous features and QoL improvements
usehelix.com