Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Helix: Ruby Native Extensions Without Fear
Godfrey Chan
April 26, 2017
Programming
0
110
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
64
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
150
Virtual EmberConf 2020: Platform State of the Union
chancancode
1
290
Thinking in TypeScript
chancancode
0
190
The Lifecycle of a Rails Request
chancancode
3
9.7k
Dropping Down To The Metal™ (2018)
chancancode
0
72
Using Skylight to Solve Real-World Performance Problems
chancancode
1
160
Prying Open The Black Box (EmberConf 2018)
chancancode
0
200
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.3k
Other Decks in Programming
See All in Programming
A technique to implement DSL in Ruby
okuramasafumi
0
790
tfcon2022_Web3Dひとめぐり.pdf
emadurandal
0
1k
WindowsコンテナDojo:第2回 Windowsコンテナアプリのビルド、公開、デプロイ
oniak3ibm
PRO
0
150
Kotlin KSP - Intro
taehwandev
1
490
LOWYAの信頼性向上とNew Relic
kazumax55
4
360
スモールチームがAmazon Cognitoでコスパよく作るサービス間連携認証
tacke_jp
2
700
Licences open source : entre guerre de clochers et radicalité
pylapp
1
320
アプリのログをチーム外で活用してもらうためにやったこと
shotakashihara
0
190
About Type Syntax Proposal
quramy
1
1.2k
クリエイティブ系のウェブサイト制作で役立つCSS技法 / CSS for develop creative website
clockmaker
2
1.6k
You CANt teach an old dog new tricks
michaelbukachi
0
120
職場にPythonistaを増やす方法
soogie
0
320
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
225
120k
Making Projects Easy
brettharned
98
4.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
14
35k
Principles of Awesome APIs and How to Build Them.
keavy
113
15k
GraphQLとの向き合い方2022年版
quramy
16
8.1k
Testing 201, or: Great Expectations
jmmastey
21
5.4k
A Tale of Four Properties
chriscoyier
149
20k
Thoughts on Productivity
jonyablonski
43
2.2k
5 minutes of I Can Smell Your CMS
philhawksworth
196
18k
Designing Experiences People Love
moore
130
22k
Creatively Recalculating Your Daily Design Routine
revolveconf
206
10k
Robots, Beer and Maslow
schacon
152
7.1k
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