37 releases (6 breaking)

0.8.1 Mar 19, 2025
0.7.0 Mar 16, 2025
0.3.3 Sep 23, 2024
0.2.4 May 12, 2024

#447 in Parser implementations

Download history 3/week @ 2024-12-10 3/week @ 2025-02-04 211/week @ 2025-02-11 111/week @ 2025-02-18 150/week @ 2025-02-25 651/week @ 2025-03-04 510/week @ 2025-03-11 276/week @ 2025-03-18

1,591 downloads per month

GPL-3.0 license

115KB
2.5K SLoC

build coverage docs.rs crates.io license

ruci

Rust Universal Chess Interface.

This crate parses and creates UCI messages. It follows the UCI protocol and uses shakmaty for relevant types. The UCI protocol is the most widely used way for GUI's to communicate with engines and vice versa.

#![no_std] compatible, unless you enable the engine-connection feature.

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. Keep in mind that this is a shallow comparison, 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.
    • Doesn't separate the two types of messages (engine, GUI) and specific messages. It just has one big enum which mostly uses enum fields for message data. This is really inconvenient because you can't represent specific messages, only the whole Message enum.
    • Doesn't provide IO communication with an engine.
    • More dependencies; pest and chrono. ruci only has shakmaty and two macros, which don't get included in the final binary.
    • Not #![no_std] compatible.
    • More tests, but I don't know about the coverage.
  • shakmaty-uci: this library is based on/inspired by vampirc-uci, so all of the above bullet points apply, except:
    • Uses shakmaty.
    • Uses nom instead of pest and doesn't use chrono.
    • Is #![no_std] compatible.

ruci might also faster since it doesn't use a parsing library, but I'm not making any claims or showing results because I only have some toy benchmarks (but yes, they do technically favor ruci).

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 as a dependency.
  • serde: enables Serialize and Deserialize for most types. All the implementations are derived with no parameters.

Dependencies

~0.9–9MB
~80K SLoC