Hacker News new | ask | show | jobs
by barrkel 3788 days ago
The chapter on formal languages is almost entirely about the mapping between regular languages and finite state automata.

While the section on grammars is yet to be written, what's there is still one of the less practically useful parts of language theory. It's nice to know how to direct-encode a regex matcher as an FSA using the program counter as the implicit state register, but it's exceedingly rare that you need that level of performance. And that's pretty much the only time you really need to know the fine details of regular language <-> FSA.

However, quite apart from working as a compiler engineer for 7 years or so, I've found formal languages come up quite a bit. Not necessarily regular languages, but ad-hoc languages and parsing issues are very common if you do much work involving data from third parties. I continually build ASTs and AST-like things to solve everything from client-side routing + module systems to ad-hoc query UIs.