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
250
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
290
Virtual EmberConf 2021: Platform State of the Union
chancancode
0
220
Virtual EmberConf 2020: Platform State of the Union
chancancode
1
360
Thinking in TypeScript
chancancode
0
300
The Lifecycle of a Rails Request
chancancode
3
14k
Dropping Down To The Metal™ (2018)
chancancode
0
150
Using Skylight to Solve Real-World Performance Problems
chancancode
1
410
Prying Open The Black Box (EmberConf 2018)
chancancode
0
400
Bending The Curve: Putting Rust in Ruby with Helix
chancancode
2
2.9k
Other Decks in Programming
See All in Programming
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
150
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
120
AI活用のコスパを最大化する方法
ochtum
0
320
SourceGeneratorのマーカー属性問題について
htkym
0
210
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
990
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
180
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
170
Feature Toggle は捨てやすく使おう
gennei
0
330
飯MCP
yusukebe
0
320
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
160
Windows on Ryzen and I
seosoft
0
380
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
180
Navigating Team Friction
lara
192
16k
Automating Front-end Workflow
addyosmani
1370
200k
My Coaching Mixtape
mlcsv
0
85
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
400
Un-Boring Meetings
codingconduct
0
240
Rails Girls Zürich Keynote
gr2m
96
14k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
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