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
140
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
230
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
260
Prying Open The Black Box (EmberConf 2018)
chancancode
0
300
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.5k
Other Decks in Programming
See All in Programming
GitHub Copilot Tips and Tricks
yuichielectric
26
7.4k
Introduction for Open Source Swift Workshop
giginet
PRO
0
180
MySQL のインデックスの種類をおさらいしよう! / overviewing indexes in MySQL
okashoi
0
170
OpenTelemetry のサービスという概念について
azukiazusa1
1
390
PHPerKaigi 2024〜10年以上動いているレガシーなバッチシステムを Kubernetes(Amazon EKS) に移行する取り組み〜
tshinowpub
1
220
PHPでOfficeファイルを取り扱う! PHP Officeライブラリを プロダクトに組み込んだ話
hirobe1999
0
840
クソコード動画『カプセル化 Mk-II』 で考える 上手くカプセル化できない理由 / encapsulation2
minodriven
11
7.8k
Dockerで始めるAWS Lambda開発
stutkhd0709
13
2.5k
Parallel Socket Communication in Swift
s_shimotori
0
220
Go1.22からの疑似乱数生成器について/go-122-pseudo-random-generator
convto
1
160
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
1k
Building a Smaller App Binary
kateinoigakukun
2
200
Featured
See All Featured
Unsuck your backbone
ammeep
661
56k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
8
8.2k
KATA
mclloyd
14
11k
Why Our Code Smells
bkeepers
PRO
330
56k
Gamification - CAS2011
davidbonilla
76
4.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
12k
Optimizing for Happiness
mojombo
369
69k
Building Your Own Lightsaber
phodgson
97
5.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
10
4.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
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