chumsky icon indicating copy to clipboard operation
chumsky copied to clipboard

Better Developer Experience

Open NicholasLYang opened this issue 8 months ago • 1 comments

Hey, huge fan of this library. I'm using it in my programming language, vicuna. However, there are some issues that I've started experiencing. It seems like the library uses a lot of traits and complicated types, which leads to massive, massive type errors. Like...really really big errors.

ChumskyError

Normally I can stare at the code and reason it out without the actual error message, but it does make things more challenging.

More importantly, these complicated types seem to really affect IDE performance. Like to the point where Intellij and RustRover are not usable on my M1 Macbook Air. Intellij will struggle along, but RustRover straight up crashes or freezes. Granted, that's partially an issue with RustRover being alpha software.

It appears that you're planning a 1.0 release. I'd only ask that developer experience be considered alongside other concerns. Also, happy to help in any way possible!

NicholasLYang avatar Oct 29 '23 04:10 NicholasLYang

Hey, sorry about that. Unfortunately a lot of this sort of thing is unavoidable: you just end up with very large types when dealing with combinator APIs. This is also a problem for Rust's Iterator trait and the types that implement too, for what it's worth (although chumsky's types often end up being particularly large since it's common to chain together many dozens of parsers).

That said, there are specific things you can do to radically improve your experience. Take a look at the recommendations in the Getting Started section of the guide.

Really, making these errors tractable requires more to be done upstream in rustc itself. There are quite a specific specific things that I think rustc needs to do to improve outputs for these sort of APIs. Things are improving though, if slowly!

zesterer avatar Oct 29 '23 16:10 zesterer