chumsky icon indicating copy to clipboard operation
chumsky copied to clipboard

`no-alloc` support

Open al8n opened this issue 2 months ago • 1 comments

Hi,

I recently need to work with a simple parser in no-alloc environment, I really enjoy chumsky, but unfortunately, currently, chumsky does not support it. Is it possible to support the no-alloc environment? If it possible and acceptable, I can give a try for it.

al8n avatar Nov 10 '25 10:11 al8n

It's certainly true that the vast majority of chumsky combinators don't require the allocator. However, this isn't true of:

  • The Rich error type (severity: low, Rich is just a nice-to-have)
  • The .boxed() combinator (severity: medium, it's often useful for reducing parser sizes)
  • The recursive parser (severity: high, recursive parsers are needed to parse any recursive grammar)

So far, we've worked under the assumption that no_std would be enough for most users. But since that's clearly not the case, I'd be happy to accept an MR that adds a default-enabled alloc feature - if you think these constraints are ones you can work under.

zesterer avatar Nov 10 '25 15:11 zesterer