News for hackers. Stuff that matters.
Re:Experience porting 4k lines of C code to go by MostAwesomeDude on Wednesday June 22, 2011 @12:19AM (#2681703)
I'd like to point out that there are libraries (PyPEG, PyParsing, and PyMeta) which take EBNF-style descriptions of grammars and produce decently fast parsers, PEG-style. PyMeta's my personal favorite, since it both takes a straight text description, and also uses OMeta instead of ENBF, turning parse and lex into a single operation.

Of course, the downside is that formal grammars are often a bad fit for custom languages of the web, which tend to have incomplete/undecideable/context-dependent grammars. This would work for Markdown, though, since it does have a parseable grammar.

Re:Experience porting 4k lines of C code to go by keenerd on Wednesday June 22, 2011 @11:08AM (#2683432)
I agree. (Though my favorite is FuncParserLib, very haskellish.)

Using a real parser could probably cut half the code. Been meaning to make my own Markdown parser, everyone else's kind of sucks :-)