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
66
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
970
p5-Lodash!
kfly8
2
840
Other Decks in Technology
See All in Technology
Frontier Airlines Customer®️ USA Contact Numbers: Complete 2025 Support Guide
frontierairlineswithflyagent
0
100
Introduction to Bill One Development Engineer
sansan33
PRO
0
270
AIエージェントが書くのなら直接CloudFormationを書かせればいいじゃないですか何故AWS CDKを使う必要があるのさ
watany
19
7.7k
LIXIL基幹システム刷新に立ち向かう技術的アプローチについて
tsukuha
1
570
Semantic Machine Intelligence for Vision, Language, and Actions
keio_smilab
PRO
2
300
AWS Well-Architected から考えるオブザーバビリティの勘所 / Considering the Essentials of Observability from AWS Well-Architected
sms_tech
1
570
低レイヤソフトウェア技術者が YouTuberとして食っていこうとした話
sat
PRO
6
5.5k
20250708オープンエンドな探索と知識発見
sakana_ai
PRO
5
1.1k
Autify Company Deck
autifyhq
2
44k
20250718_ITSurf_“Bet AI”を支える文化とコストマネジメント
helosshi
0
110
ソフトウェアQAがハードウェアの人になったの
mineo_matsuya
3
230
ClaudeCode_vs_GeminiCLI_Terraformで比較してみた
tkikuchi
1
2.7k
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Site-Speed That Sticks
csswizardry
10
710
Documentation Writing (for coders)
carmenintech
72
4.9k
Navigating Team Friction
lara
187
15k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
KATA
mclloyd
30
14k
Docker and Python
trallard
45
3.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
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