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
170
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
220
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
260
The Lifecycle of a Rails Request
chancancode
3
13k
Dropping Down To The Metal™ (2018)
chancancode
0
97
Using Skylight to Solve Real-World Performance Problems
chancancode
1
320
Prying Open The Black Box (EmberConf 2018)
chancancode
0
350
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.7k
Other Decks in Programming
See All in Programming
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
450
MCP with Cloudflare Workers
yusukebe
2
220
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
260
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
선언형 UI에서의 상태관리
l2hyunwoo
0
140
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
layerx_20241129.pdf
kyoheig3
2
290
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
900
Featured
See All Featured
Navigating Team Friction
lara
183
15k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Being A Developer After 40
akosma
87
590k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Adopting Sorbet at Scale
ufuk
73
9.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building Applications with DynamoDB
mza
91
6.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
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