I found that there was no pure representation of Chess written in Erlang/OTP.
So, now I would like to announce my implementation… Binbo.
It’s available on Github:
Binbo is a Chess representation written in pure Erlang using Bitboards. It is basically aimed to be used on game servers where people play chess online.
It’s called Binbo because its ground is a binary board containing only zeros and ones (0 and 1) since this is the main meaning of Bitboards as an internal chessboard representation.
Binbo also uses the Magic Bitboards approach for a blazing fast move generation of sliding pieces (rook, bishop, and queen).
Note: it’s not a chess engine but it could be a good starting point for it. It can play the role of a core (regarding move generation and validation) for multiple chess engines running on distributed Erlang nodes, since Binbo is an OTP application itself.
Features:
Blazing fast move generation and validation.
No bottlenecks. Every game is an Erlang process (gen_server) with its own game state.
Ability to create as many concurrent games as many Erlang processes allowed in VM.
Unicode chess symbols support for the board visualization right in Erlang shell.
I tried it and couldn’t help but try en passant (since that is usually a rule people skip in their implementation), but you got that Castling is probably also implemented?
Okay, whatever
But PGN is just a feature. I started this project not only to create a chess representation, but also to make it as performant as possible (thanks to Bitboards) since its mission to be running on game servers.
BTW, ChesLogic doesn’t recognize a draw by insufficient material, but Binbo does
Binbo is now armed with UCI protocol support and is able to communicate with chess engines such as Stockfish, Shredder, Houdini , etc.
You can therefore write your own client-side or server-side chess bot application on top of Binbo, or just play with engine right in Erlang shell.