ruci 0.5.0

A UCI (Universal Chess Interface) crate.
Documentation

build coverage docs.rs crates.io license

RUCI

Rust Universal Chess Interface.

This crate parses and creates UCI messages. It follows the UCI standard and uses shakmaty for relevant types.

See the examples for a demo on how to send and receive messages.

Comparison

There's two other crates that I'm aware of which serve a similar purpose. Here's a shallow comparison but keep in mind I haven't looked extensively and I am not an expert.

  • vampirc-uci:
    • Doesn't use shakmaty, which AFAIK is the go-to chess crate now.
    • Uses pest for parsing (ruci does it manually).
    • More dependencies; pest and chrono. Ruci only has shakmaty and two macros which don't get included in the final binary.
    • Lot more tests than ruci. However, ruci has simpler parsing and less code. But yes, I am guilty.
    • Doesn't separate GUI and engine-bound messages.
    • Less direct implementation of the UCI standard.
    • Maybe a pet peeve, but sometimes uses enum fields instead of separate types. IMHO this is bad because you can't represent just an id message, because the fields are baked into the whole enum.
  • shakmaty-uci:
    • Very similar to vampirc, but uses shakmaty.
    • Uses nom for parsing.

Neither of these have the means to connecting to an engine.

Feature flags

  • engine-connection: enables a structs to manage the IO when it comes to working with a UCI engine. Note that this will add tokio and parking_lot as dependencies. If you're making an engine, listen to stdin and parse it into a gui::Message, then print a string representation of an engine::Message.