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
contributing-to-spinel
Search
yamasaki
May 13, 2026
Programming
49
0
Share
contributing-to-spinel
RubyKaigi 2026 アフターイベント〜初参加LT・スポンサー4社のパネル〜
https://mybest.connpass.com/event/392055/
yamasaki
May 13, 2026
More Decks by yamasaki
See All by yamasaki
YJITのBenchmarksに貢献した話
sacckey
0
60
Other Decks in Programming
See All in Programming
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
2
250
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
410
Road to RubyKaigi: Play Hard(ware)
makicamel
1
540
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
140
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
180
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
180
【26新卒研修】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
140
Agent Skills を社内で育てる仕組み作り
jackchuka
1
1.3k
AIと共に生きる技術選定 2026
sgash708
0
120
Explore CoroutineScope
tomoeng11
0
160
tRPCの概要と少しだけパフォーマンス
misoton665
2
260
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
110
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
WCS-LA-2024
lcolladotor
0
570
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
160
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
290
Google's AI Overviews - The New Search
badams
0
1k
エンジニアに許された特別な時間の終わり
watany
106
240k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
200
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
330
Transcript
Spinelに貢献した話
note inc. ⾃⼰紹介 Yamasaki sacckey • 2020/04 note⼊社 • サーバーサイドエンジニア
◦ 最近は物語投稿サイトTALESの実装 • 個⼈開発/ピアノ/⿇雀 2
note inc. Matz Keynote 3
note inc. Spinel 4 • RubyのAOTコンパイラ • Ruby (.rb) →
parse → type inference → C (.c) → native binary • Rubyプログラムの実⾏速度とポータビリティの向上
note inc. さっそくSpinelを使ってみる % make deps % make % cat
> hello.rb <<'RUBY' def fib(n) n < 2 ? n : fib(n - 1) + fib(n - 2) end puts fib(34) RUBY % ./spinel hello.rb % ./hello # prints 5702887 (instantly) 5
note inc. Ruby Boy (https://github.com/sacckey/rubyboy) • Rubyで動くGame Boyのエミュレーター • ruby.wasmによってブラウザでも動く
◦ https://sacckey.github.io/rubyboy/ • 画⾯描画なしのベンチマークがある ◦ → Spinelでコンパイルしたい ◦ → コンパイル失敗 ◦ → 失敗箇所ごとにPR作成 6
note inc. Spinelに貢献する 7 Contributingを翻訳して抜粋 貢献を歓迎します。課題追跡システムはロードマップとしても機能します。未解決の問題であれば何でも 対象となります。最も有⽤なエントリーポイントは、再現⼿順を⽰すバグ報告(Spinelでは失敗するが CRubyでは成功する5⾏のRubyコードなど)と、そのような報告を解決するコード⽣成による修正です。 • コンパイルに失敗するコードを⼩さく切り出し、CRubyでは動くがSpinelでは落ちるテストを作る
• それを通るようにする
note inc. 貢献1: M::C.new対応 8 # コンパイルできるようになったコード module M class
C def initialize puts "init" end end end M::C.new M::C のような名前空間つきクラスに対して .new できなかった ConstantPathNode がレシーバーになる ケースに対応
note inc. 貢献2: インスタンス変数名とCキーワードの衝突回避 9 # コンパイルできるようになったコード class KeywordIvar def
initialize @if = 40 @iv_if = 1 end def value @if + @iv_if + 1 end end puts KeywordIvar.new.value @if をCコードに変換すると、 Cの if と衝突してしまっていた 生成されるCのフィールド名に iv_ prefixを付 けた 例: @if → iv_if @iv_if → iv_iv_if
note inc. その他の貢献 10 • nested ConstantPath reads • ConstantPath
receiverへのclass method dispatch • polymorphic returnのbox • constructor initialize pathのGC save重複排除
note inc. まとめ • SpinelでRuby Boyをコンパイルしようとしたら、まだ動かないRubyコードが⾒つかった ◦ ⼤きな機能追加ではなく、最⼩再現テストにすることが貢献になった • 「CRubyでは動くがSpinelでは落ちる5⾏のRuby」を⾒つけたら貢献のチャンス
◦ Spinelで遊んで、動かないコードを⾒つけたらPRを出そう! 11
note inc. 12 noteでは仲間を募集中です! https://note.jp/n/nc0fe1a230633 募集職種: • サーバーサイドエンジニア • サーバーサイドエンジニア
(次世代リーダー候補 / 第⼆新卒歓迎) • AIプラットフォームエンジニア 採⽤情報
None