Crate of the Week


Ok, so we have quickcheck, capnproto-rust, and sprocketnes.

I’d like to have some more nominations here, so hopefully bumping this will motivate people to join.


pcwalton’s IPC channel library, ipc-channel.


Nice idea! I have some suggestions:

  • droundy/onionsalt
  • pnkfelix/tango
  • ticki/soundex-rs
  • mystor/slag
  • kbknapp/cargo-count


Please only one suggestion! People vote by :heart:ing the nominations, so if you nominate five crates, I’ll have to either pick one or write about all of them! :sweat_smile:


I’m going to say kbknapp’s Clap crate - I have never, in any language I have ever worked in, had an argument parsing library that was so completely painless.

I’ve found it especially nice for mocking up the skeleton of a tool where all roads lead to panic!(), then splitting it up further and further, pushing the panic!()s down the branching logic of what to actually do, until a whole utility has appeared from nowhere.


This is so perfect, I think we should quote it directly. Are you OK with that?


I’d be honored!


I know this question probably shouldn’t be here, but I wonder why people are so enthusiast about clap. As the rust community has a port of docopt for rust, it make me wonder how clap compares to docopt-rs.
Has anyone tried and could give some feedback in terms of usage convenience / drawbacks / advantages?

Sorry again for the off-topic question.


Sorry, I haven’t tried either, so I’m not qualified to say anything enlightening on the topic. All I can say is from a cursory glance at the README, clap appears a little more full-featured than docopt.

With that said, nominations for next week’s Crate of the Day are opened! I’m curious what you folks will come up with.

Docopt and clap: feedback

This is indeed off-topic. I’d suggest creating a new thread if you (or anyone else) wants to talk about it more.

Briefly: in my experience, most folks either love or hate docopt. Generating a parser from the usage string is quite a bit different than building one up explicitly like in clap. In particular, docopt is a black box. If it does something you don’t like, it is hard to tweak it because its internals are so complex. Sub-commands also don’t have a great story, but are doable. I bet @kbknapp could give a better comparison. :slight_smile:

Docopt and clap: feedback

To get us back on topic: I’d still like to see nominations! :smile:


I haven’t used it yet, but I was always looking for a comfortable scraping lib, and select looks neat.

  • logger/env_logger - There’s not a lot guiding newbies to these crates.
  • tempdir - A crucial tool.
  • tango and/or skeptic. These are tools for documenting and testing arbitrary markdown files.
  • pulldown-cmark. Dead-simple markdown parser.
  • rust-url. This is a production-quality URL parser, used by Hyper.
  • fnvhash. A very simple case - when the default hash map seems slow and you’ve got small keys, you might want this. I’m not sure this is the canonical implementation though. It looks unmaintained.
  • gcc-rs. Crates that want to build native code should use this.

Edit: missed the ‘one suggestion per post’ rule. Sorry.


fnv. This is the proper FnvHasher implementation. Maintained by Servo.


There is a wiki page at clap repo with brief comparison between docopt vs clap and getopts vs clap.
Maybe it will answer your questions.


lazy_static at least until we get better CTFE. This crate seems to creep into most of my projects.


So lazy_static it is.

I hereby declare the nominations for week 39 open. Perhaps we can rid ourselves of the tradition of winning last-minute nominations this time?


And it’s Thursday and we don’t have any nominations! Come on, people! Don’t leave me hanging here.


You could always go back through the older nominations that didn’t get chosen for that particular week. It seems like crates tend to get nominated once, then never again.

Aside: come to think of it, the forum structure itself is a rather poor way of organising this. For example, there are several crates that don’t have their own post, so you can’t vote for them directly. You can’t “reset” votes for each week, nor can you tell how long ago the last vote was made (maybe a crate almost qualified for CoTW status a while ago, but is no longer relevant?).

Anyway, going through the backlog and checking the TWiR posts, I’d say … well actually, I’ll put it in a separate post so it can be voted for independently of the above rambling. :stuck_out_tongue:


Re-nomination for quickcheck. “Automatic property based testing with shrinking.”

It helps write property-based tests: you define some property and how to test it, and quickcheck feeds your test random inputs as it tries to narrow down the ranges within which the property fails to hold. Handy when the set of possible test cases is very large.