Skip to content

impl Trait and making Chomp require nightly #50

@m4rw3r

Description

@m4rw3r

Using conservative impl Trait we can change Chomp from being a monad-like parser-combinator into a full-fledged monad. Current development can be found in the https://github.com/m4rw3r/chomp/tree/experiment/impl_trait branch.

The monad has several benefits; macro is simpler, parsers are easier to compose due to not being forced to pass around the input state, simpler type-signatures for more complex parsers (associated types) and so on. The downside is that it currently only works on nightly rust and is incompatible with the current (0.2.6) version of Chomp.

The question here is what to do with the monad-like version of Chomp? I am committed to finishing up version 0.3.0 of Chomp using the monad-like parser using an Input trait which is compatible with the Input trait of the monad version (if you change a few method names). The contents of the buffer module are also largely unchanged between the two.

I see two choices here:

  • Let 0.x.y versions of Chomp be monad-like, and release a monad-like 1.0.0 when it is equal to the functionality of Attoparsec, leaving 2.0.0 and up for the monad version which will require nightly until impl Trait has been stabilized.
  • Release the monad version under a new crate-name (eg. chomp2)

Essentially this boils down to the question: How important is support for stable rust for users of Chomp?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions