A chess interface powered by the Xilem GUI framework for the lightweight Salewski Chess Engine.
xilem-chess is a Rust-based chess GUI built with Xilem, a declarative UI toolkit.
It connects to the compact “Salewski chess engine” and displays a clean, responsive chessboard with live engine moves handled through multi-threading and message passing.
Key highlights:
- Unicode chess piece rendering
- Play modes for Player vs Engine and Engine vs Engine
- Adjustable engine move timing
- Move highlighting for suggestions and last moves
- A simple (inacurate) chess clock
- Display of movelist, and option to print the list in the terminal
- Thread-safe engine communication via Rust’s
mpscchannels
- ✅ Fully interactive chessboard
- ✅ Customizable seconds-per-move for the engine
- ✅ Board rotation toggle
- ✅ Move list output to the terminal
- ✅ Responsive board built with Xilem’s flex/grid system
⚠️ Only click-to-move input (no drag-and-drop yet)⚠️ No save/load or PGN export functionality- ❌ Dynamic scaling and window title updates are not yet supported by Xilem
- Rust 1.78+ (2024 edition)
- Xilem (latest from GitHub)
- masonry for layout
tokio,num-traits,winitfor async and platform integration
Chess pieces are drawn using Unicode symbols. Most systems already have suitable fonts, but the Google font Noto Sans Symbols is bundled and used by default (under Google’s copyright). A future update may allow switching to system fonts.
git clone https://github.com/stefansalewski/xilem-chess.git
cd xilem-chess
RUST_LOG=off cargo runWhen launched, the left panel provides game controls; the right displays the interactive board.
| Control | Action |
|---|---|
| Engine plays White | Enable/disable engine control of white pieces |
| Engine plays Black | Enable/disable engine control of black pieces |
| Rotate | Flip the board’s orientation |
| New game | Reset to starting position |
| Print movelist | Output move history to terminal |
| Sec/move | Adjust engine’s thinking time per move |
Moves are made by clicking a piece’s square, then its destination square.
AppState— manages the board, settings, and UI stateengine::Game— contains chess rules and logic- Threaded messaging —
task(...)withmpsc::Receiver<Move>for engine responses engine_to_board(...)— converts engine’s internal state to UI data structures- UI layout — composed using Xilem’s
grid,button,checkbox,label, etc.
- ✅ Linux (X11 and Wayland)
- ✅ Windows (expected to run without issues)
⚠️ macOS (not tested, should work)⚠️ Android (android_main, experimental)
- No dynamic widget scaling or runtime window title changes
- Missing promotion UI, PGN handling, and drag-and-drop support
This UI was inspired by the stopwatch.rs and calc.rs examples from Xilem, as well as the previous egui-based tiny-chess.
The focus is on keeping engine logic separate from UI state for maintainability.
Debug mode:
RUST_LOG=debug cargo runThe same engine code can be used with:
- Egui UI — https://github.com/StefanSalewski/tiny-chess
- 3D Bevy UI — https://github.com/StefanSalewski/Bevy-3D-Chess
Older Nim, GTK, and blocking egui versions are now deprecated and will be removed.
Copyright © 2015–2032 Dr. Stefan Salewski Licensed under MIT or Apache 2.0 (same as Rust).
Bundled font: Noto Sans Symbols 2 — see Google’s license for details.