I've been writing a parser in Haskell Parsec to parse a subset of Haskell;<p>I didnt stick to anything like BNF and it turns out to be much more daunting task than expected.<p>When designing a parser for a (subset of) known language (or creating your own programming language), are things like BNF fundemental to a good design? What toolkits or frameworks can be employed in the planning process?<p>Any tips or approaches (or readings) on the best way to strike a balance between theoretical formalization v.s. implementing something that actually works and have good performance and easy to debug?
I haven't used parsec but I have used fparsec and I found that usage of the "operator precedence parser" was very useful in parsing expressions. It also sped up parsing a lot.<p>As for BNF, it is like a standard that your parser should follow. A map for when parsing gets complex. You may not need it for a simple parser.