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
sre_introduction.pdf
Search
Niyarin
July 06, 2019
Programming
0
550
sre_introduction.pdf
Niyarin
July 06, 2019
Tweet
Share
More Decks by Niyarin
See All by Niyarin
Scheme用nREPLの開発(エラー出力の改善)
niyarin
0
170
bel lispの紹介
niyarin
0
770
nanopass-compiler-frameworkを使ってみました
niyarin
0
460
Gorgos-parser-combinator-written-in-scheme
niyarin
0
400
outputting-beautiful-s-expression
niyarin
0
410
Serialisp
niyarin
1
690
Mongo DBとS式検索
niyarin
0
340
goodbye-python-repl
niyarin
0
380
SchemeのEphemeronとWeak Pairの説明
niyarin
0
1.1k
Other Decks in Programming
See All in Programming
CSC307 Lecture 04
javiergs
PRO
0
660
Oxlintはいいぞ
yug1224
5
1.3k
Implementation Patterns
denyspoltorak
0
280
CSC307 Lecture 08
javiergs
PRO
0
670
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
dchart: charts from deck markup
ajstarks
3
990
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
150
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
CSC307 Lecture 07
javiergs
PRO
0
550
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
Featured
See All Featured
Faster Mobile Websites
deanohume
310
31k
HDC tutorial
michielstock
1
360
Darren the Foodie - Storyboard
khoart
PRO
2
2.3k
Leo the Paperboy
mayatellez
4
1.4k
Un-Boring Meetings
codingconduct
0
200
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
410
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
820
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Transcript
SchemeのS式正規表現は良いぞ (本当はClojureに移植した話をするつもりだった) Niyarin
SREとは ・正規表現をS式で表現したもの [ABC]+[0-9]{0,3}.? `(: (+ ,char-set:ABC) (repeated 0 3 num)
(? any)) 1
・SRFI115 あるいは R7RS large (scheme regex) Sagittarius Scheme、Chibi Schemeとか ・Guileのirregex
文法はSREとだいたい同じ SREの仕様 2
・たとえば、1文字以上の繰り返しは、+だけでなく、 one-or-moreという表現ができる --> 不慣れでも読みやすい正規表現が書ける SREの紹介(1)シンボルが使えるメリット1 (+ “abc”) (one-or-more “abc”) 3
・文字列とシンボルの2つあるのはいいことだ ・無制限に名前付けができる SREの紹介(2)シンボルが使えるメリット2 任意の一文字: any アルファベット:alphabetic 16進数文字:hex-digit 単語:word 4
・部分的にSchemeコードを挿入して評価で展開できる SREの紹介(3)quasi-quote `(one-or-more “abc” ,something “def”) 5
・SRFI44(scheme set char) 文字の集合データ構造 ・[ ] ⇐よりも自由に文字の集合を使える SREの紹介(4)データ構造の挿入ができる (char-set #\a
#\b #\c) ;a,b,cの文字の集合 (char-set-filter (lambda (c ) (not (char=? c #\z))) char-set:letter) ;z以外のレターの集合 6
・のんびりしていたから ・当初SRE->Clojure(Java)正規表現をやるつもりだった マッチングは実装しなくてよいしすぐ終わると思っていた.. X SREの表現力の幅のほうが大きかった Clojureへの移植が遅れた言い訳 無理ではないけど、表現を落とす実装コストがかかる 7
・S式なのでパーサ実装コストは省ける ・マッチングはNFA/DFA、VM 、微分型とかで実装できる “正規表現技術入門 ――最新エンジン実装と理論的背景” という本が良い → CLに移植しませんか? それでも実装は楽 8
・S式で表現するとのはよいこと ・実装遅れたのはSREが良すぎたせい ・暇な人は実装しよう まとめ
・S式にするとよいものは他になにがあるのか? SXML(S式XML文法) おわり (tag (@ (attr1 "value1") (attr2 "value2")) (nested
"Text node") (empty)) DBクエリとか? SXQL