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
150
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
200
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
190
Virtual EmberConf 2020: Platform State of the Union
chancancode
1
300
Thinking in TypeScript
chancancode
0
240
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
270
Prying Open The Black Box (EmberConf 2018)
chancancode
0
310
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.5k
Other Decks in Programming
See All in Programming
Goのエラースタックトレースの歴史と今後
sonatard
10
2k
Three ways to use AI on Android: The Good, the Bad and the Ugly
marxallski
0
110
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
290
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
1.1k
Try creating your own orderedmap
kazamori
1
270
WebGLで始める コンピュータグラフィックス入門
heller77
0
350
Node.js v22 で変わること
yosuke_furukawa
PRO
12
4.1k
Go製Webアプリケーションのエラーとの向き合い方大全、あるいはやっぱりスタックトレース欲しいやん / Kyoto.go #50
utgwkk
6
1.9k
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
700
GitHub Copilotのススメ
marcy731
1
240
PostmanでAPIの動作確認が楽になった話
h455h1
0
190
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
480
Featured
See All Featured
Writing Fast Ruby
sferik
622
60k
10 Git Anti Patterns You Should be Aware of
lemiorhan
649
58k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
A Tale of Four Properties
chriscoyier
153
22k
Git: the NoSQL Database
bkeepers
PRO
423
63k
The Power of CSS Pseudo Elements
geoffreycrofte
62
5k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Adopting Sorbet at Scale
ufuk
69
8.6k
Ruby is Unlike a Banana
tanoku
96
10k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.7k
A Modern Web Designer's Workflow
chriscoyier
689
190k
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