User:Colby Russell/Limits

trplkt should be featureful while remaining comprehensible and small.

The following soft limits should be taken into consideration when extending the language:

The size of the lexer should not exceed 1 KLOC. It is currently ~750 LOC and solves essentially all anticipated needs for the foreseeable future.

The parser should aim to stay under 2.5 KLOC or so. It is currently around the same size as the lexer (smaller, actually, with a couple hundred lines for both IR forms), but the parser is not a "total" parser—it doesn't fully validate the input against a well-defined grammar (because the grammar has yet to be defined in a concrete form)—so it is expected to grow substantially. We *do* want high-quality error reporting, but this should not be at odds with our desire to keep the parser small. It should be possible to achieve friendly error output without completely entangling the parser implementation with such concerns. I've already started filling out a `NiceErrors` module, but there's no reason that this should necessarily contain all things related to errors and error recovery, so long as a reasonable separation is maintained between the parser's happy (and hot) path versus the path that involves error reporting.