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
210
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
250
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
210
Virtual EmberConf 2020: Platform State of the Union
chancancode
1
330
Thinking in TypeScript
chancancode
0
270
The Lifecycle of a Rails Request
chancancode
3
14k
Dropping Down To The Metal™ (2018)
chancancode
0
120
Using Skylight to Solve Real-World Performance Problems
chancancode
1
360
Prying Open The Black Box (EmberConf 2018)
chancancode
0
370
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.8k
Other Decks in Programming
See All in Programming
単体テストの始め方/作り方
toms74209200
0
510
Gleamという選択肢
comamoca
6
740
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
540
AIネイティブなプロダクトをGolangで挑む取り組み
nmatsumoto4
0
120
Java on Azure で LangGraph!
kohei3110
0
160
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
120
社内での開発コミュニティ活動とモジュラーモノリス標準化事例のご紹介/xPalette and Introduction of Modular monolith standardization
m4maruyama
1
130
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
290
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
170
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
250
C++20 射影変換
faithandbrave
0
500
Benchmark
sysong
0
220
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Writing Fast Ruby
sferik
628
61k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
660
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
Scaling GitHub
holman
459
140k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Building an army of robots
kneath
306
45k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Music & Morning Musume
bryan
46
6.6k
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