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
220
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
260
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
220
Virtual EmberConf 2020: Platform State of the Union
chancancode
1
330
Thinking in TypeScript
chancancode
0
280
The Lifecycle of a Rails Request
chancancode
3
14k
Dropping Down To The Metal™ (2018)
chancancode
0
130
Using Skylight to Solve Real-World Performance Problems
chancancode
1
380
Prying Open The Black Box (EmberConf 2018)
chancancode
0
380
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.8k
Other Decks in Programming
See All in Programming
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
9
8.1k
Promise.tryで実現する新しいエラーハンドリング New error handling with Promise try
bicstone
2
390
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
29
11k
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
110
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
540
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3.1k
エンジニアに事業やプロダクトを理解してもらうためにやってること
murabayashi
0
140
ドメイン駆動設計のエッセンス
masuda220
PRO
15
7.8k
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
2
550
問題の見方を変える「システム思考」超入門
panda_program
0
190
KoogではじめるAIエージェント開発
hiroaki404
1
450
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
9
3.9k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.7k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.1k
How GitHub (no longer) Works
holman
315
140k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Six Lessons from altMBA
skipperchong
29
4.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
The Cost Of JavaScript in 2023
addyosmani
55
9.2k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
The World Runs on Bad Software
bkeepers
PRO
72
12k
BBQ
matthewcrist
89
9.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Code Review Best Practice
trishagee
72
19k
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