I hand rolled the lexer and parser for Curv in C++, because I didn't want to fight tool limitations in defining the syntax or implementing error recovery. In retrospect,
• A regex-based scanner generator like re2c would have made the scanner easier to write.
• My hand-written recursive descent parser was easy to write and continues to be easy to modify. No regrets.
• After hanging out in FoC for a year, I have IDE envy. To properly implement completions and hints, I need an incremental parser. So maybe I should switch to the tree-sitter parser generator?
https://github.com/tree-sitter/tree-sitter
• For me, the hard part is the back end, not the parser/lexical analyser. What are the libraries/DSLs for semantic analysis, optimization and code generation?