A Brutal Look at Balanced Parentheses, Computing Machines, and Pushdown Automata

warrenm | 36 points

"But on a day-to-day basis, if asked to recognize balanced parentheses?"

On day-to-day basis you will never encounter this problem in pure form. As the consequence the solutions are not good for the day-to-day stuff.

Even if you only are only writting a verifier (which is already a bit unrealistic), you'll need to say something more than "not balanced". Probably rather something along the lines of "closing brace without a matching opening at [position]" or "[n] unclosed parentheses at <end of stream>" which rules out the simple recursive regex approach (counter still works).

praptak | 8 minutes ago

One of the few lessons I distinctly remember from college was finite automata in my PL class. I really enjoyed exploring the concepts and writing a grep tool; we were supposed to write either a NFA or DFA processing application, but I decided to write both.

20 years later I got to apply some of the same ideas to a language processing application, and it was such a pleasure to actually use something conceptual like that. Made me briefly regret landing in more hybrid infrastructure/automation roles instead of pure software development.

Somewhere I may still have my copy of Preperata and Yeh that my professor recommended at the time for further reading. Like most of my books, it was never actually read, just sat around for years.

macintux | 5 hours ago

we’ll ask, “What’s the simplest possible computing machine that can recognize balanced parentheses?”

A counter. That's the difference between theory and practice. Because in practice, everything is finite.

userbinator | 2 hours ago

The pictures of Brutalist architecture are awesome!

senorqa | 2 hours ago

What is some further reading y'all could recommend on formal languages?

Antibabelic | an hour ago
[deleted]
| 2 hours ago