Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Developer Experience #559

Open
NicholasLYang opened this issue Oct 29, 2023 · 1 comment
Open

Better Developer Experience #559

NicholasLYang opened this issue Oct 29, 2023 · 1 comment

Comments

@NicholasLYang
Copy link

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!

@zesterer
Copy link
Owner

zesterer commented Oct 29, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants