Email or username:

Password:

Forgot your password?
Top-level
Joshua Barretto

@janriemer Neat! Let me know if you run into any issues, I tend to respond to issues/discussions on the repo within a few hours. You might enjoy giving some of the examples a look/run to see what the crate can do, there's quite a lot there :)

7 comments
Joshua Barretto

@janriemer Oh also, make sure you're using one of the 1.0 alpha releases. 1.0 is basically a whole new crate, with pretty radical improvements on the old API. There's a guide here: docs.rs/chumsky/1.0.0-alpha.6/

Jan :rust: :ferris:

@jsbarretto Thank you for the hint! Yes, I'd have chosen 1.0 api anyway. 🙂

Jan :rust: :ferris:

@jsbarretto Thank you so much for your help, Joshua! That's so nice! I really appreciate it! ❤️

What I'm really curious about are those advanced error recovery strategies in chumsky. :awesome:
But I'll probably only look into those, after the "first iteration" is done to not get overwhelmed with new concepts.😄

Joshua Barretto

@janriemer chumsky lets you do quite a lot with error recovery, including using fallback patterns defined using parsers to catch common cases, as well as giving pretty fine-grained control over errors. Thankfully it's not something you need to jump into at first, but there's there if you need it :) The result can be neat: recovered ASTs can go on to inform later passes, allowing your compiler to emit errors from many passes at once, like this:

Jan :rust: :ferris:

@jsbarretto Whoa, this looks and sounds so fancy! :awesome:

Don't make me so curious!😜

Jan :rust: :ferris:

@jsbarretto #Parsers are so fascinating, aren't they!? At first you think: "Hm...what should be so special about a parser?", but then you go down the rabbit hole and you'll probably never return to the surface. 😄

Regarding error recovery: You probably already know the following article, by matklad, but just in case you don't:

Resilient LL Parsing Tutorial
matklad.github.io/2023/05/21/r

Probably one of the best tutorials I've read in a long time.

#Parser #Compiler

@jsbarretto #Parsers are so fascinating, aren't they!? At first you think: "Hm...what should be so special about a parser?", but then you go down the rabbit hole and you'll probably never return to the surface. 😄

Regarding error recovery: You probably already know the following article, by matklad, but just in case you don't:

Joshua Barretto

@janriemer I'm aware of it, yes. chumsky doesn't try to do this sort of thing, it's strictly a top-down parser and everything is geared around that. I would say it's definitely intended more for compilers ingesting mostly-correct code rather than, say, an LSP operating on very broken fragments of code. That said, if used right, its error recovery can be surprisingly resilient.

Go Up