News for hackers. Stuff that matters.
Re:Less, a leaner CSS by mrkurt on Tuesday June 16, 2009 @05:37PM (#660944)
For once, I'd love to see one of these things built with a proper parser. The regex madness has to stop!
Re:Less, a leaner CSS by gamache on Tuesday June 16, 2009 @06:56PM (#661052)
Why? Sane regexes aren't all that inefficient, and here efficiency doesn't matter much anyhow.
Re:Less, a leaner CSS by dasil003 on Tuesday June 16, 2009 @09:27PM (#661222)
It's not about efficiency, it's about robust parsing.
Re:Less, a leaner CSS by boucher on Wednesday June 17, 2009 @03:07AM (#661494)
Actually, I think it's about ease of implementation.
Re:Less, a leaner CSS by stcredzero on Wednesday June 17, 2009 @08:50AM (#661716)
Correctness > Ease of implementation
Re:Less, a leaner CSS by gamache on Wednesday June 17, 2009 @08:05AM (#661687)
That statement is content-free. Robust parsing can be achieved using regexes as a tool. I want some reasoning better than "ew, regexes!"
Re:Less, a leaner CSS by stcredzero on Wednesday June 17, 2009 @08:56AM (#661722)
If the "regexes" can call each other recursively, then this is possible. If not, then it is theoretically impossible. The proof is often given as a problem in your basic automata class. "Regexes" are no longer the same as "Regular Expressions" in automata theory. But their origin is in automata theory. A lot of the "ew, regexes" reaction comes from this.

I'm skeptical that augmented "regexes" are any more maintainable than compiler compilers.

Re:Less, a leaner CSS by gamache on Wednesday June 17, 2009 @09:14AM (#661743)
Yes, I am talking about using regexes where a "standard" parser would use getc() and switch statements all over the place. You can't just write a clever regex and wrap it in a while loop and have a parser to go; as you mention, this is theoretically impossible.
Re:Less, a leaner CSS by chriseppstein on Tuesday June 16, 2009 @11:52PM (#661348)
I agree.