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
Introduce Sub::Meta
Search
Kenta Kobayashi
May 21, 2021
Technology
0
65
Introduce Sub::Meta
Kenta Kobayashi
May 21, 2021
Tweet
Share
More Decks by Kenta Kobayashi
See All by Kenta Kobayashi
Perlの生きのこり - エンジニアがこの先生きのこるためのカンファレンス2025
kfly8
4
2.4k
Tシャツに書かれたコードを読む
kfly8
0
1.3k
研修はイベントでなくコミュニティ作り
kfly8
0
2.1k
明日からできる新人のオンボーディングガイド
kfly8
0
830
メンター成長のためのふりかえり会
kfly8
0
1.3k
Interfaces in Perl5 at The Perl Conference 2019 in Pittsburgh
kfly8
0
3k
経験から効率よく学習する
kfly8
0
430
Interfaces in Perl5
kfly8
1
960
p5-Lodash!
kfly8
2
830
Other Decks in Technology
See All in Technology
Azure AI Foundryでマルチエージェントワークフロー
seosoft
0
180
Witchcraft for Memory
pocke
1
220
Claude Code Actionを使ったコード品質改善の取り組み
potix2
PRO
6
2.1k
Amazon S3標準/ S3 Tables/S3 Express One Zoneを使ったログ分析
shigeruoda
3
460
AWS テクニカルサポートとエンドカスタマーの中間地点から見えるより良いサポートの活用方法
kazzpapa3
2
500
mrubyと micro-ROSが繋ぐロボットの世界
kishima
2
150
Microsoft Build 2025 技術/製品動向 for Microsoft Startup Tech Community
torumakabe
2
250
ひとり情シスなCTOがLLMと始めるオペレーション最適化 / CTO's LLM-Powered Ops
yamitzky
0
420
[TechNight #90-1] 本当に使える?ZDMの新機能を実践検証してみた
oracle4engineer
PRO
3
170
CSS、JSをHTMLテンプレートにまとめるフロントエンド戦略
d120145
0
280
監視のこれまでとこれから/sakura monitoring seminar 2025
fujiwara3
11
3.8k
フィンテック養成勉強会#54
finengine
0
170
Featured
See All Featured
Scaling GitHub
holman
459
140k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
Rails Girls Zürich Keynote
gr2m
94
14k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Automating Front-end Workflow
addyosmani
1370
200k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
The World Runs on Bad Software
bkeepers
PRO
69
11k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Designing Experiences People Love
moore
142
24k
Transcript
Introduce Sub::Meta kobaken a.k.a @kfly8 Perlͷ։ൃମݧΛྑ͍͖ͯ͘͠💪
ࣗݾհ • kobaken a.k.a @kfly8 • ϞόΠϧϑΝΫτϦʔ • ΤϯδχΞ৫։ൃऀ •
Ωʔϫʔυ: ODHDɺίʔνϯάɺ 1on1ɺDevOpsɺJobDescription • Japan Perl Association ཧࣄ • ࠷ۙɺ່̑ࡀʹUNOͰෛ͚Δ
Perlͷ։ൃମݧΛྑ͍ͨ͘͠💪
։ൃମݧʹ͔ܽͤͳ͍ • ڧྗͳΤϥʔνΣοΫ • ิ • ϑΥʔϚολ • ύϑΥʔϚϯε্ •
ͳͲ
ใ ߏจɾɾܕ औಘ ར༻
ใ ߏจɾɾܕ औಘ ར༻ PPI Compiler::Lexer PPR
ใ ߏจɾɾܕ औಘ ར༻ Perl::Critic Perl::Lint Perl::MinimumV ersion Perl::LanguageS erver
Spellunker::Pe rl
ใ ߏจɾɾܕ औಘ ར༻ RBS steep Sorbet RBI TypeProf ࢀߟɿhttps://techlife.cookpad.com/entry/2020/12/09/120454
ใ ߏจɾɾܕ औಘ ར༻ Sub::Meta
ใ ߏจɾɾܕ औಘ ར༻ Sub::Meta Types::TypedCodeRef Boundary Types::HasTypedMethods
খ·ͱΊ • PerlͰ։ൃମݧΛྑ͍͖ͯ͘͠💪 • ͦͷͨΊʹɺϓϩάϥϜ͔Βใ Λऔಘ͠ར༻͢ΔྲྀΕΛଊ͑Δ • Sub::Metaɺ͜ͷྲྀΕͰ͍͏ਅ ΜதͷཱͪҐஔ •
ؔͷϝλใΛར༻͘͢͠ ΔͨΊͷΦϒδΣΫτ܅
PerlͰؔͷϝλใΛ ѻ͏ͱ͖ͷࠞཚ ಛʹҾɺฦΓ
None
ؔaddͷϝλใ ໊ؔʁ add ύοέʔδʁ Foo Կߦ͔Βఆٛ͞Ε͍ͯΔʁ 3ߦ
use Sub::Identify; sub_name(\&add) # => add stash_name(\&add) # => Foo
my ($file, $line) = get_code_location(\&add)
my $meta = Sub::Meta->new( sub => \&add ); $meta->subname #
=> add $meta->stashname # => Foo $meta->line # => 3
ͰɺҾʁ
None
None
None
None
ࢁ͋ΔPerlͷ όϦσʔγϣϯϞδϡʔϧୡ
None
None
None
ҾόϦσʔγϣϯ܅͝ͱʹ ϝλใͷऔΓѻ͏ͷ໘
ใ ؔͷϝλ Sub::Meta Data::Validator Smart::Args Type::Params Function::Parameters Sub::WrapInType …
DEMO
ฦΓόϦσʔγϣϯ܅ ಉ༷ͷΞϓϩʔνͰղܾ
ใ ؔͷϝλ Sub::Meta Return::Type Function::Return Sub::WrapInType …
·ͱΊ • Perlͷ։ൃମݧΛྑ͍͖ͯ͘͠ 💪 • Sub::MetaɺؔͷҾɺฦ ΓؚΊͨϝλใΛ Sub::Metaʹू͠ɺ౷Ұతͳ ΠϯλʔϑΣʔεͰؔͷϝλ ใΛѻ͑ΔΑ͏ʹ͢Δ܅
ࠓޙʁ • Sub::MetaͷܕදݱΛ҆ఆͤ͞ Δ(issue #42) • Boundary ( Interface࣮ )ʹؔ
໊͚ͩͰͳ͘ɺฦΓɺҾ ͷܕՃຯ͢Δ #1 • Ruby3 steepͷΑ͏ͳ੩తͳ νΣοΧʔͷPoC