Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
rbs-inlineを使ってみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
a_fujisaki
September 12, 2024
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
rbs-inlineを使ってみた
a_fujisaki
September 12, 2024
More Decks by a_fujisaki
See All by a_fujisaki
自作マクロと型生成
aki19035vc
0
57
rails newと同時に型を書く
aki19035vc
6
1.3k
“Rails × 型”での2年間を振り返る
aki19035vc
2
1.2k
Emacs × LSP × Steep
aki19035vc
0
290
MiniMagickの型を生成したい
aki19035vc
0
170
最近追加した型の紹介とその振り返り
aki19035vc
0
910
Other Decks in Programming
See All in Programming
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
300
Intent as Code
shoppingjaws
6
1.1k
新卒PdEのリアル
ryu1013
1
510
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.1k
Security issues being discussed on Web Platforms
petamoriken
0
1k
wkhtmltopdfの次どうするか問題2026
willnet
2
1.6k
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
490
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
430
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.4k
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
230
Family mrubyの進捗
kishima
1
130
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Building an army of robots
kneath
307
46k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Prompt Engineering for Job Search
mfonobong
0
460
A better future with KSS
kneath
240
18k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Transcript
rbs-inlineを使ってみた Roppongi.rb#22 <2024-09-12> @aki19035vc
自己紹介 ❏ 藤崎 亮人 (a_fujisaki) ❏ @aki19035vc ❏ イタンジ株式会社 ❏
不動産会社向けのSaaSを提供 ❏ バックエンドエンジニア ❏ ほぼRails・たまにScala ❏ 物件基盤の開発責任者 ❏ Rails × 型 の話が好き ❏ 学生の頃(2016年くらい)からEmacs使ってます
今日話すこと ❏ rbs-inline を使ってみた話 ❏ どんな風に試したか ❏ 実際どうだったか (感想) ❏
良かったところ・気になったところなど ❏ 今後やること ※ rbsとかrbs-inlineとかsteepとかの詳しい解説はしません
rbs-inlineとは ❏ Rubyの型情報をソースコード内にコメントとして直接記述することで、 rbsファイルを別途作成せずに型情報を生成できるツール ❏ 詳しくはリポジトリとかRubyKaigi 2024 のセッションを見てください ❏ https://github.com/soutaro/rbs-inline
❏ https://rubykaigi.org/2024/presentations/soutaro.html
簡単な例
どんな風に試したか ❏ rbs_mini_magickという自作gemの型をrbs-inlineで生成するように変更 ❏ https://github.com/aki19035vc/rbs_mini_magick ❏ 元々はrbsとyardをどちらも書いていたため大変だった ❏ 今回は、全て手作業で rbs-inlineを使う形に書き写した
❏ 使用感とかを確かめるために頑張った ❏ rbsファイルをちゃんと書いていたので、そこからrbs-inlineのコメントを 機械的に付与することも検討はした ❏ yardコメントは全部消した
どうだったか (感想) ❏ コード内に型を直接書けるのは素晴らしい ❏ 今まではコードを書き終えた後、最後にまとめて型を書いてた ❏ rbs-inlineを使うと、コードを書くと同時にrbsを書けて効率が良い ❏ 機能的に足りないものなどは特になかった
❏ wikiに書き方が詳しく載っていたので特に困ることもなかった ❏ https://github.com/soutaro/rbs-inline/wiki/Syntax-guide
悩んでいること・気になること ❏ 書き方 ❏ `@rbs` を基本的に使い、attr_xxx, 定数などは `#:` で書くようにした ❏
yardスタイルの書き方はしない ❏ `#:`で統一しようかは迷っている ❏ 書き方を統一させるためのrubocopがあると嬉しい (rubocop-rbs-inline的な) ❏ rubocopで怒られる部分はひとまず無効化した ❏ rubocopにPRを出してくれる方がいるので、無事取り込まれれば無効化しなくても良くな りそう ❏ コード内に記述したrbsコメントが、生成後のrbsファイルにも含まれている ❏ 特に害はないが、なくても良いのでは?とは思った
今後の話 ❏ 業務で開発しているRailsアプリケーションにrbs-inlineを入れる予定 ❏ 型は(ほぼ)100%書いてある ❏ 人力で書き写すのは現実的ではない ❏ 既存のrbsからrbs-inlineのコメントを機械的に付与するスクリプトを作る予定 ❏
上手くいったら弊社のエンジニアブログで公開するつもり & LTもどこかでやり ます