PAGI で広がる Perl の Web 開発。quiche で HTTP/3 サーバーを作ってみた

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →
Kei Kamikawa
November 28, 2026

PAGI で広がる Perl の Web 開発。quiche で HTTP/3 サーバーを作ってみた

YAPC::Tokyo 2026 にて https://metacpan.org/pod/PAGI を紹介することをメインで、Webアプリケーションの開発としてまだまだ未来があることを広めたく話してきました

実験コード: https://github.com/Code-Hex/pagi-io-async-playground
Cloudflare Quiche の Perl binding: https://github.com/Code-Hex/p5-Net-Quiche

Kei Kamikawa

November 28, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

39 slides
  1. @codehex @Code-Hex • 沖縄から来ました🌺 • Okinawa.pm を運営していました • NOTA で建築

    FDE をしています • コーディング大好き • https://github.com/Code-Hex/MuseKnock • https://github.com/Code-Hex/vz
  2. なぜ PSGI が嬉しかったのか • フレームワーク サーバーの実装を 1 本化 • Starman

    や Starlet などサーバーを自由に選べる • Plack::Middleware・Plack::Test を共通化 • CGI::PSGI 等で既存資産からも移行できる
  3. PAGI 本体も AI と開発中 • https://github.com/jjn1056/pagi • 直近のコミットも Co-Authored-By Claude

    • AI エージェント向けの設計ドキュメントも進行中 • 明確な仕様とテストが AI 共創の土台になる
  4. HTTP なら、ヘッダーとボディを順に送る async sub ($scope, $receive, $send) { await $send->({

    type => "http.response.start", status => 200, headers => [] }); await $send->({ type => "http.response.body", body => "Hello, PAGI!" }); }
  5. PAGI で書く最小の WebSocket エコー my $app = async sub ($scope,

    $receive, $send) { return unless $scope->{type} eq 'websocket'; my $ev = await $receive->(); return unless $ev->{type} eq 'websocket.connect'; await $send->({ type => 'websocket.accept' }); while (1) { my $msg = await $receive->(); last if $msg->{type} eq 'websocket.disconnect'; await $send->({ type => 'websocket.send', text => $msg->{text} }); } };
  6. Plack で見た、あの玉ねぎ WSGI の図が Perl にも 2009年、Plack Advent Calendar が

    この図でミドルウェアを紹介した 芯にアプリハンドラ その外をラップするイメージ 図 Pylons Project「Concepts of Pylons」
  7. fl fl Cloud are quiche とは? • Cloud are 公開の

    Rust 製 QUIC / HTTP/3 実装 • 暗号化・再送・ストリーム管理を丸ごと担当 • I/O を持たず、UDP とタイマーは呼び出し側が駆動 • C API を公開しており、Perl の XS から呼べる
  8. PAGI アプリを動かして、わかったこと PAGI 玉ねぎ & AI 共通仕様があれば、WebSocket も HTTP も同じ約束事

    で書ける ミドルウェアは $send を包む。問いと仕様があれば AI と組める HTTP/3 デモ 1 接続に複数ストリーム、more => 1 でリアルタイム配信が 動いた テストと仕様 Future 完了 相手に届いた。仕様どおりかテストで確認

More Decks by Kei Kamikawa

Other Decks in Programming