Hello. I got myself into Rust recently and started my first project: parser for a scripting language.
I found a parser combinators library and was very excited, however after first successful steps compile times for my simple parser, which can currently only parse include statements and class declarations, are over 5 minutes.
I heard Rust has big compile times, but I didn’t expect to experience several minutes long at this stage. I’m afraid implementing more grammar will increase them even more.
I’m using macros extensively, since lack of anonymous return types, closure cloning and inference outside of function bodies makes it very painful, if not impossible at some times, to write composable parsers.
Here is my code.
I’m wondering if I’m doing it horribly wrong. What is the idiomatic way to write a simple parser in Rust? Are the compile times I get normal, will they be much bigger if I continue to implement parser this way?
Thank you in advance