Skip to content
0:00 / 0:00

#regularexpressions#llvm#jit

redgrep: from regular expression derivatives to LLVM

Linux.conf.au 2013 -- Canberra, Australia

1K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Paul Wankadia

Advanced. Deep dive for people who know the field.

2.7K views11 years ago2 recommendations

Systems programmingComputer scienceCompilers and interpretersAlgorithmsComputation and complexity

Paul Wankadia explains how redgrep uses regular expression derivatives to construct DFAs and leverages LLVM to JIT compile them for linear-time matching.

Presenter(s): Paul Wankadia URL: lca2013.linux.org.au/schedule/30022/view_talk redgrep is a grep based on regular expression derivatives. That is, it uses regular expression derivatives to construct the DFA†. It then uses LLVM to JIT‡ the DFA. Since regular expression derivatives permit the three basic Boolean operations of disjunction (|), conjunction (&) and complement (!), redgrep enables you to write very powerful regular expressions very easily and guarantees to match them in linear time. In this talk, we will cover how regular expression derivatives work, then dive into their implementation in redgrep. Resurfacing after a look at code generated by LLVM, we will conclude with benchmarks. † Deterministic Finite Automaton ‡ Just-In-Time compile lca2013.linux.org.au/ - linux.org.au CC BY-SA - creativecommons.org/licenses/by-sa/4.0/legalcode.txt

Why it's here

2 people recommend this

What people say. Recommended as an accessible explanation of regular expression derivatives and their practical implementation using LLVM.

u/beeshevik_partyin r/haskell • Recommends

On “What are some research papers that every haskeller should read?”

regexp derivatives are so cool, i went down this rabbithole last summer and i'm still in it. highly recommend this video that walks through a C++ implementation and compares it to re2. extremely easy to digest. there is also really cool work being done that adapts these ideas to cfgs, pdf warning that i hope to start exploring this year

u/_jackdk_in r/haskell • Recommends

On “Writing and debugging Megaparsec parsers for grep - Impure Pics [YouTube]”

Regex derivatives are really cool, and it's actually possible to extend them to context-free grammars, see Yacc is Dead. They also (also!) let you say things that aren't possible with the traditional NFA->DFA construction, see this talk on `redgrep`.