4 ms·
The directory I linked shows Ragel lexers. It was a command line tool that fed a web app. All it had to do was count lines of code, blank lines, and comment lin
by tacos 10y ago
The directory I linked shows Ragel lexers. It was a command line tool that fed a web app. All it had to do was count lines of code, blank lines, and comment lines for a variety of languages.
It took years and they never got it right. Partly because every technical decision was based on neato-tool-of-the-month in the early Ruby/Zed Shaw era. But mostly because it's hard.
- jblow 10y agoCare to explain why you think it's hard? (For someone with a basic education in programming, say, someone with a bachelor's degree from a reasonable school). Exactly what part of this problem is hard?
- tacos 10y agoYou seem to be treating this like "Knuth solved it in 1965, how hard can it be?" I provided a link to 100 language parsers with commit history. A quick Google reveals the most frequent committer has a CS degree from Caltech. Either it's hard or they're idiots. (I suppose we both can be right.) Personally I wouldn't want to write something that can parse the Javascript embedded in the HTML emitted by a PHP script. Subtle details like "screw that, life's way too short" can conspire to make "easy" things hard.