pointfreeco / swift-parsing

A library for turning nebulous data into well-structured data, with a focus on composition, performance, generality, and ergonomics.
https://www.pointfree.co/collections/parsing
MIT License
864 stars 77 forks source link

Generic `ParserBuilder` #279

Closed JaapWijnen closed 1 year ago

JaapWijnen commented 1 year ago

Since I had done some work to try and fix #278 Here's part of a stab at making the ParserBuilder generic over Input. I'm having some final issues however getting the tests and benchmark targets to compile unfortunately. Thought I'd share in case its useful to you and/or you may spot something obvious that's missing

JaapWijnen commented 1 year ago

Things sort of seem to work. There's a huge compile time regression however. Some setups seem to take a lot of time to compile. In my last commit I've disabled the benchmark target for now since that doesn't compile (The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions). The same holds for tests but I've only commented out the tests that don't compile due to the time out (the others are still compiling practically instantly) Hope this helps in order to narrow down what the issue is in terms of the compile performance.

stephencelis commented 1 year ago

@JaapWijnen Thanks again for triaging this issue. I've added you as a co-author to #289, which includes the changes you explored here and more. Going to close this out in favor of the newer PR!

JaapWijnen commented 1 year ago

Thanks @stephencelis! Much appreciated :)