In class today, I sat through my second lecture on the power behind Regular
Expressions with derivatives. The professor live coded a Regular Expression
engine in Python during class that has all of the regular language functionality
and more than the ones you will find in perl, ruby, python, java, boost, etc.
Why would language
implementers not use the more powerful way? Because long ago it was
thought that Brzozowski’s derivative method was too costly so everyone used
Thompson’s method which is fast for most operations but suffers from possible
exponential blowup with some operations.
With derivatives we get those operations back (Intersection, Difference,
Complement) and significantly decrease the complexity of implementing regular
Ruby for fun and posterity.