Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Perl詩を味わう / Taste the Perl Poetry - YAPC::Japan::Online 2022 LT

take_3
March 06, 2022

Perl詩を味わう / Taste the Perl Poetry - YAPC::Japan::Online 2022 LT

LT slides in YAPC::Japan::Online 2022

YAPC::Japan::Online 2022
https://yapcjapan.org/2022online/

take_3

March 06, 2022
Tweet

More Decks by take_3

Other Decks in Programming

Transcript

  1. sleep, close together, sort of sin each spring & wait;

    50% die # 読み人知らず (フォートローダーデール在住), 1990年エイプリルフール Perl Poemの例 眠ってください、一緒に。 毎年春になると、ある種の罪を犯して、待ちます。 50%死ぬ https://docstore.mik.ua/orelly/perl/prog3/ch27_02.htm
  2. say(join(‘abc’, @some)); ↓ say join abc, @some 省略を許容 • 変数宣言省略

    • カッコ、末尾のセミコロン、etc 省略 • クォートのない裸のワード → 文字列扱い 裸のワード abc は 文字列 ‘abc’ とみなされる
  3. if (expired($job)) { die; } ↓ die if expired $job

    後置構文 if, while, forなど。自然な英文に近い表現
  4. You -say "yes"; I -say "no"; You -say "stop" and

    I -say "go" x 3, (Oh.. NO); You -say "goodbye" and I -say "hello"; # Original: `Hello, Goodbye` (The Beatles, 1967) # Code by @take_3, 2021 味わい方 唯一のお約束: syntax OK 範囲演算子 繰り返し演算子 組み込み関数 裸のワードと、あえて クォートしている箇所 https://gist.github.com/htaketani/1cee546a18c79ad6e376bd01a20c6996#file-hello-goodbye-pl
  5. Sharon Hopkins • 最も多作なPerl詩人 • Usenix Winter1992技術会議で発表したPerl詩に関す る論文「Camels and Needles:

    Computer Poetry Meets the Perl Programming Language」 • 代表作 listen はエコノミスト紙とガーディアン紙の両 方で掲載された。 https://docstore.mik.ua/orelly/perl/prog3/ch27_02.htm http://www.digitalcraft.org/iloveyou/images/Sh.Hopkins_Perl_Poetry.pdf
  6. #!/usr/bin/perl APPEAL: listen (please, please); open yourself, wide; join (you,

    me), connect (us,together), tell me. listen by Sharon Hopkins, 1995 APPEAL(アピール)。 聴いてください(please, please)。 自分を、大きく開く。 join (あなた, 私), つなぐ(私たち、一緒に)。 教えてください。
  7. do something if distressed; @dawn, dance; @evening, sing; read (books,$poems,stories)

    until peaceful; study if able; write me if-you-please; listen by Sharon Hopkins, 1995 悩んだら何かする。 夜明けには、踊りましょう。 夕方、歌う。 平和になるまで本を読む。 可能なら、勉強する。 もしよければ、私に手紙を書いてください。
  8. sort your feelings, reset goals, seek (friends, family, anyone); do*not*die

    (like this) if sin abounds; keys (hidden), open (locks, doors), tell secrets; do not, I-beg-you, close them, yet. accept (yourself, changes), bind (grief, despair); listen by Sharon Hopkins, 1995 自分の気持ちを整理する、目標を 再設定する、(友人、家族、誰にでも)相談する。 死ぬな(このように) 罪が多ければ 隠された)鍵を開ける、(鍵やドアを)開ける、秘 密を打ち明ける。 まだ、閉めないでください。 自分自身を、変化を)受け入れなさい。 縛る(悲しみ、絶望)。
  9. require truth, goodness if-you-will, each moment; select (always), length(of-days) #

    listen (a perl poem) # Sharon Hopkins # rev. June 19, 1995 listen by Sharon Hopkins, 1995 真実、善意が必要な瞬間がある。 選択する (常に), 長さ (日) # listen (a perl poem) # シャロン ホプキンス # 改訂版 1995年6月19日
  10. unshift @pool,$sky,$clouds; bless {sleep my $love and study}; each %willow

    and carp; # Steve Trigg, 2000 by Steve Trigg, 2000 プールで一休み、空と雲 私の愛と努力よ祝福のうちに眠れ 柳と鯉の一匹一匹に # スティーブ トリッグ、2000年 https://history.perl.org/CHI/
  11. comments: A Japanese maiden, comforts her samurai husband as he

    lies dying by a shady pool. The ornamental fish tangle themselves in the fronds of a weeping willow as they rise to taste the blood of the fallen warrior (which has spilled) into the limpid waters. by Steve Trigg, 2000 (作者による)コメント 日本の乙女が、日陰の池のほとり で死にゆく侍の夫を慰めている。 観賞魚(鯉)は、しだれ柳の葉に絡み つきながら、清流にこぼれた武士 の血を味わおうと(水面に)上がる。
  12. References • 小林一茶の似顔絵イラスト ©いらすとや https://www.irasutoya.com/2015/10/blog-post_163.html • Programming Perl, 27.2. Perl

    Poetry http://docstore.mik.ua/orelly/perl/prog3/ch27_02.htm • Perl Conference 4.0 Haiku Contest Finalists http://history.perl.org/CHI/ • Perl Poem Hello Goodbye (The Beatles) https://gist.github.com/htaketani/1cee546a18c79ad6e376bd01a20c6996#file-hello-goodbye-pl • Perl keywords https://learn.perl.org/docs/keywords.html • Camels and Needles: Computer Poetry Meets the Perl Programming Language http://www.digitalcraft.org/iloveyou/images/Sh.Hopkins_Perl_Poetry.pdf