Annotated Bibliography of Regular Expression Engines

Cox, Russ (Jan 2007). “Regular Expression Matching Can Be Simple And Fast”. Retrieved 17 July 2020. Russ Cox demonstrates a case where a short regular expression can cause some regex engines to take an unreasonably long time to complete a search, while others can complete the search in microseconds. The article starts with the theory of regular expressions and how they can be expressed as deterministic and non-deterministic finite automata, then builds up the code of a simple regex engine step by step from there....

Handling Interrupts in Go

This little Go program does not run the defer statement when you interrupt by pressing ctrl-C: package main import "fmt" func main() { defer fmt.Println("Shutting down...") for { } } > go run interrupt.go ^Csignal: interrupt > You have to actually trap the signal and handle it. Fortunately that’s super simple in Go: package main import "fmt" import "os" import "os/signal" var shutdown = make(chan struct{}) func main() { defer fmt....