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
PPRとKeyword::Simpleと あとVariable::Declaration
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kenta Kobayashi
March 03, 2018
Technology
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PPRとKeyword::Simpleと あとVariable::Declaration
Kenta Kobayashi
March 03, 2018
More Decks by Kenta Kobayashi
See All by Kenta Kobayashi
Perlの生きのこり - YAPC::Fukuoka 2025
kfly8
0
2.1k
プロジェクトの空気を読んで開発してくれるPerlのAIツールがほしい
kfly8
2
990
Perlの生きのこり - エンジニアがこの先生きのこるためのカンファレンス2025
kfly8
4
3.2k
Tシャツに書かれたコードを読む
kfly8
0
1.5k
Introduce Sub::Meta
kfly8
0
110
研修はイベントでなくコミュニティ作り
kfly8
0
2.3k
明日からできる新人のオンボーディングガイド
kfly8
0
910
メンター成長のためのふりかえり会
kfly8
0
1.4k
Interfaces in Perl5 at The Perl Conference 2019 in Pittsburgh
kfly8
0
3.4k
Other Decks in Technology
See All in Technology
LLM/Agent評価:トップ営業の発言を「正解」にする 〜暗黙的正解による評価を営業資産に変える〜
takkuhiro
1
230
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
1
220
OpenTelemetryにおけるGoのゼロコード・コンパイル時計装について #fukuokago
quiver
0
120
AI時代のPlaywright活用(システムテストを自動化する ー 実行エンジンにPla ywrightを選んだ理由)
ynisqa1988
1
560
オブザーバビリティ、本当に活用できてる? 〜API連携×生成AIで成熟度を自動評価〜
dmmsre
1
3.6k
Data + AI Summit 2026 イベントレポート: 「AIがビジネスで意思決定するデータ基盤」へ
nek0128
0
280
AIレビューはどこまで任せられるのか?自動化と人が背負うレビューの境界
sansantech
PRO
3
1.1k
Control Planeで育てるBtoB SaaSの認証基盤 - SRE NEXT 2026
pokohide
1
2.6k
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
150
【Claude Code】鹿野さんに聞く 私の推しの並行開発環境 大公開 / claude-code-parallel-2026-07-15
tonkotsuboy_com
12
8.7k
Kaggleで成長するために意識したこと
prgckwb
2
420
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
430
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Navigating Team Friction
lara
192
16k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
260
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
180
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Amusing Abliteration
ianozsvald
1
230
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Transcript
PPR と Keyword::Simple と あと Variable::Declaration YAPC::Okinawa 2018 / LT
@k y8
k y8 2 歳の娘の父になった モバファク JPA
agenda 1. PPR 2. Keyword::Simple 3. Variable::Declaration
PPR
PPR Perl の静的解析モジュー ル 類似モジュー ルは、PPI 正規表現を使った、 解析ができる Statement,Variable,Block,etc
PPR example use PPR; my $s = 'my $yapc:OKINAWA =
"OIST"'; print $s =~ m{ ((?&PerlAttributes)) $PPR::GRAMMAR }x; # => :OKINAWA
PPR pros/cons 意図はわかりやすく、 簡潔 意図通りに作るのが難しい( 主観) Perl が柔軟すぎて
Keyword::Simple
Keyword::Simple Pure Perl で Perl にキー ワー ド追加できる PL_keyword_plugin を利用
類似モジュー ル Devel::Declare Keyword::Declare
Keyword::Simple example package ExampleKeywordSimple; use Keyword::Simple; sub import { Keyword::Simple::define
'yapc' => sub { my $ref = shift; substr($$ref, 0, 0) = 'print " はいさい!";sub'; }; } 1; use ExampleKeywordSimple; yapc okinawa { } # => はいさい!
Keyword::Simple pros/cons Pure Perl で Perl を弄れる(2 回目) B::Deparse が手放せない(
主観) use ExampleKeywordSimple; BEGIN { $^H{'Keyword::Simple/keywords'} = 'HASH(0x7fc1b940a018)' } ; ; print " はいさい!"; sub okinawa { BEGIN { $^H{'Keyword::Simple/keywords'} = 'HASH(0x7fc1b940a018)' } }
PPR × Keyword::Simple Pure Perl で Perl を静的解析した結果を用いて Perl を拡張できる
Variable::Declaration
Variable::Declaration PPR × Keyword::Simple 変数宣言の拡張 use Type::Tie use Data::Lock
Variable::Declaration example use Variable::Declaration; use Types::Standard qw/Int/; let Int $foo
= 2018; $foo = 'YAPC'; # ERROR: Value "YAPC" did not pass type constraint "Int"
deparse example use Variable::Declaration; use Types::Standard ('Int'); use feature 'state';
BEGIN { $^H{'Keyword::Simple/keywords'} = 'HASH(0x7fc8de02e350)' } ; ; my $foo = 2018; croak(Int->get_message($foo)) unless Int->check($foo); ttie $foo, Int; $foo = 'YAPC';
Variable::Declaration pros/cons buggy ( v0.01 ) 静的型付き言語を使えば? と言われる
Thanks!!