Skip to content

0.10.0

Latest
Compare
Choose a tag to compare
@zesterer zesterer released this 22 Mar 18:23
· 39 commits to main since this release

The 0.10.0 release of chumsky is a from-scratch rewrite of the crate based on the work that's been ongoing for several years in the 1.0.0 alpha builds. The release of 0.10.0 is, in many ways, a concession to a few inconvenient facts:

  • Users were rightly complaining that the latest stable release of chumsky (i.e: that which docs.rs shows by default) was the 0.9.x release, despite the fact that we've been recommending that new users use 1.0.0 alpha builds for a long time now. Many users have accidentally tried to run code taken from the 1.0.0 examples, only to find that they don't work with 0.9.
  • 1.0.0 has been in development for a long time, and there are still some breaking changes left to make (although we're getting closer!). Users wants to be able to pull in a stable version and start working productively, and the existing situation was becoming cumbersome.
  • Although 1.0.0 is not yet finished, it is moving closer and closer to its final form. It is unlikely that much about the surface API will change between 0.10.0 and 1.0.0, although some changes left to be made are technically breaking.

We recommend that users of chumsky depend on 0.10.0, if they can. Despite that, there are a few things to consider:

  • (This has now been resolved) Not all documentation has been properly updated yet. Some docs still reference 0.9.x concepts or are not yet complete.
  • Some features are still in a state of partial completeness. We don't anticipate significant breakage going forwards, but some features are explicitly in need of more work and future 0.x releases will address them.

Any help from the community to assist in resolving these points is greatly appreciated!

Here follows the changelog for 0.10.0. I also wrote up an informal migration guide.

Added

  • Support for zero-copy parsing (i.e: parser outputs that hold references to the parser input)
  • Support for parsing nested inputs like token trees
  • Support for parsing context-sensitive grammars such as Python-style indentation, Rust-style raw strings, and much
    more
  • Support for parsing by graphemes as well as unicode codepoints
  • Support for caching parsers independent of the lifetime of the parser
  • A new trait, IterParser, that allows expressing parsers that generate many outputs
  • Added the ability to collect iterable parsers into fixed-size arrays, along with a plethora of other container types
  • Support for manipulating shared state during parsing, elegantly allowing support for arena allocators, cstrees,
    interners, and much more
  • Support for a vast array of new input types: slices, strings, arrays, impl Readers, iterators, etc.
  • Experimental support for memoization, allowing chumsky to parse left-recursive grammars and reducing the
    computational complexity of parsing certain grammars
  • An extension API, allowing third-party crates to extend chumsky's capabilities and introduce new combinators
  • A pratt parser combinator, allowing for conveniently and simply creating expression parsers with precise operator
    precedence
  • A regex combinator, allowing the parsing of terms based on a specific regex pattern
  • Properly differentiated ASCII and Unicode text parsers

Removed

  • Parser::then_with has been removed in favour of the new context-sensitive combinators

Changed

  • Performance has radically improved
  • Error generation and handling is now significantly more flexible