5 ms·
When I was an undergrad at Université de Montréal, the theory of computation class which dealt with automata was called "Informatique Théorique"; literally, "th
by gnuvince 11y ago
When I was an undergrad at Université de Montréal, the theory of computation class which dealt with automata was called "Informatique Théorique"; literally, "theoretical computer science". "Why do theoretical computer science," I'd ask, "let's do practical computer science instead!" However, thanks to the enthusiasm of my professor and his teaching assistant and the very interesting nature of the subject, it became the class that I enjoyed the most of my whole undergrad! And to this day, some of the lessons I learned remain important in my day to day work for some of the reasons mentioned by prof Ullman in the video: I now know that some problems can't be solved, some take too long to solve, and some problems require less powerful mechanisms to solve. And knowing this, I'm able to recognize when they are applicable or at least have an intuition that maybe they could be applicable and thus I have a clearer idea of how to solve certain problems.
I highly encourage you to learn about this stuff, it's a lot of fun and is actually practical!
- userbinator 11y agoRegular expressions are probably one of the most practical and immediately obviously useful things to come out of automata theory.
- jimhefferon 11y agoI'm interested to hear you say this. I teach this course, to students who mostly go on to do Java coding. I have several times run into an old student who told me that they never once used regexes after my class, either in school or in work.
- manish_gill 11y agoThat is very surprising to hear. Regular expressions are used all over the place! I wouldn't want to work with a person who does not have at least the basic workings of Regex down pat.
- iso8859-1 11y agoOne reason may be that practical regexes have so many extensions that you can't many of the usual tricks on them. http://stackoverflow.com/questions/6363397/how-to-tell-if-one-regular-expression-matches-a-subset-of-another-regular-expres http://stackoverflow.com/questions/6363397/how-to-tell-if-on...
- brudgers 11y agoI find it helpful to distinguish between "regular expressions" as something mathematical and "regexes" as nebulous more-than an NFA and less than a Turing complete grammar...DFA regex engines being the Platypus that proves the rule. As soon as you have backtracking and capture groups it's not a regular expression in the mathematical sense. These features make regexes more useful in many simple cases at the cost of making them harder to reason about in more difficult cases.
- varlock 11y agoI'm surprised - Did you ask them how do they search for patterns? Entries in log files, function definitions or usage in code, matching files in a shell?
- jimhefferon 11y ago> Did you ask them how do they search for patterns? Entries in log files, function definitions or usage in code, matching files in a shell? You know, I have. In some ways it is like communicating across cultures in that the question does not seem to make all that much sense to them. That I can tell, they don't ever search for patterns. The would look for that feature in their GUI log reading program, I suppose. Failing that, they would write code, 100% in Java I think, and I suppose that if they had to do what I would reach for a regex to do, they would write code to do it. (Is this what jwz means by "Now they have two problems," that they should do the job in code?) But, again, I don't think there is a real communication there. I'm not too sure what they mean and they look like they do not recognize the situations I ask about.
- forgettableuser 11y agoI already knew Perl and Posix regex when I took automata. I cruised through the initial basics of regular expressions faster than my peers. But I got into trouble after I learned that regex contains a bunch of features (hacks) that have no grounding in pure automata theory. I had to unlearn a whole bunch of things.
- dottrap 11y agoProfessor Roberto Ierusalimschy (creator of Lua), was bothered by the problems of regex deviating from (real) regular expressions, like how captures create non-determinism, back references make pattern matching algorithms NP complete, no formally defined performance model, and so on. This led him to revisit prior research on PEGs (Parseable Expression Grammars) which are akin to Context-Free Grammars. He created a library called LPeg which was a PEG for Lua. He gave a talk about all this which can be found here: https://vimeo.com/1485123 https://vimeo.com/1485123 So he basically realized people were hacking regular expressions to get more power. So rather than playing that game, he climbed up a level on the automata ladder to get a more mathematically sound approach to the problem.
- gnuvince 11y agoRegarding that, since I took that class I've been careful about using the term "regular expression" for expressions that describe a NFA and "regex" for what popular languages implement.
- yashwant123 11y agofgjutyhgki