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
160
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
210
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
200
Virtual EmberConf 2020: Platform State of the Union
chancancode
1
310
Thinking in TypeScript
chancancode
0
250
The Lifecycle of a Rails Request
chancancode
3
13k
Dropping Down To The Metal™ (2018)
chancancode
0
95
Using Skylight to Solve Real-World Performance Problems
chancancode
1
300
Prying Open The Black Box (EmberConf 2018)
chancancode
0
330
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.6k
Other Decks in Programming
See All in Programming
Some more adventure of Happy Eyeballs
coe401_
2
190
Developer Joy == Developer Productivity (really!)
hollycummins
1
220
令和トラベルにおけるLLM活用事例:社内ツール開発から得た学びと実践
ippo012
0
210
オートマトン学習しろ / Do automata learning
makenowjust
3
130
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
1k
GoのIteratorに詳しくなってしまう
inatonix
1
200
Google Sign-inの移行から始めるCredential Manager活用
clockvoid
0
310
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
4
90k
o1モデルのプロンプトエンジニアリングって?
ktc_wada
0
270
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
420
watsonx.ai Dojo #2 生成AIを使ったアプリ開発入門編
oniak3ibm
PRO
0
190
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Gamification - CAS2011
davidbonilla
79
5k
How to train your dragon (web standard)
notwaldorf
85
5.6k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.6k
For a Future-Friendly Web
brad_frost
174
9.3k
Done Done
chrislema
180
16k
KATA
mclloyd
27
13k
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.8k
Side Projects
sachag
451
42k
Practical Orchestrator
shlominoach
185
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
32k
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