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
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
480
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
270
testcontainers のススメ
sgash708
1
120
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
970
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
470
Beyond ORM
77web
7
810
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
GitHub's CSS Performance
jonrohan
1030
460k
We Have a Design System, Now What?
morganepeng
51
7.3k
How to Ace a Technical Interview
jacobian
276
23k
A better future with KSS
kneath
238
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Typedesign – Prime Four
hannesfritz
40
2.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building an army of robots
kneath
302
44k
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