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.
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.
- API problems:
- Doesn't separate GUI and engine messages. This is bad if you want to communicate with an engine/GUI, because you're going to need functions like
send_message
andread_message
, where you want to specify which type of message you are sending and receiving. It's not impossible to do this withvampirc-uci
, but you won't have strong type guarantees. - Doesn't have separate structs/enums for messages. Similar to the above, this is bad if you want to represent a specific message. With
vampirc-uci
, you can only represent the whole enum.
- Doesn't separate GUI and engine messages. This is bad if you want to communicate with an engine/GUI, because you're going to need functions like
- Doesn't provide IO communication with an engine.
- More dependencies;
pest
andchrono
. RUCI only has shakmaty and two macros which don't get included in the final binary. - Not
#![no_std]
compatible. - More tests than RUCI.
shakmaty-uci
:- This library is based on/inspired by
vampirc-uci
, so all of the above bullet points apply, except:- Uses shakmaty.
- Uses
nom
for parsing and doesn't have any other dependencies. - Is
#![no_std]
compatible.
- This library is based on/inspired by
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).
engine-connection
: enables a structs to manage the IO when it comes to working with a UCI engine. Note that this will addtokio
as a dependency.serde
: enablesSerialize
andDeserialize
for most types. All of the implementations are derived with no parameters.