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
180
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
230
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
210
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
14k
Dropping Down To The Metal™ (2018)
chancancode
0
100
Using Skylight to Solve Real-World Performance Problems
chancancode
1
330
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
VisionProで部屋の明るさを反映させるシェーダーを作った話
segur
0
100
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
Rubyでつくるパケットキャプチャツール
ydah
0
150
Flatt Security XSS Challenge 解答・解説
flatt_security
0
700
rails newと同時に型を書く
aki19035vc
5
700
2025.01.17_Sansan × DMM.swift
riofujimon
2
450
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
160
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
7
1.4k
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
550
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
180
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
380
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.7k
Featured
See All Featured
Fireside Chat
paigeccino
34
3.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Six Lessons from altMBA
skipperchong
27
3.5k
A designer walks into a library…
pauljervisheath
205
24k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Designing Experiences People Love
moore
139
23k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
It's Worth the Effort
3n
183
28k
Being A Developer After 40
akosma
89
590k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
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