New chess library Plisco (and toy engine plisco)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

gflohr
Posts: 57
Joined: Fri Jul 23, 2021 5:24 pm
Location: Elin Pelin
Full name: Guido Flohr

New chess library Plisco (and toy engine plisco)

Post by gflohr »

I have published today the library Chess::Plisco for Perl. It is available on CPAN (https://metacpan.org/dist/Chess-Plisco/ ... Plisco.pod) and on Github (https://github.com/gflohr/Chess-Plisco). It also contains a UCI-compatible toy engine "plisco" which is not meant to be a serious competitor, although it can surely be an adornment of the tail of any computer chess ratings list. ;)

The library contains a lot of things that you need for rapidly prototyping a chess engine or other chess software in Perl. Some features are:

* bitboards for board representation
* legal and pseudo-legal move generation
* generation of captures, promotions and (most) checks
* undoing moves
* static exchange evaluation
* overridable piece values
* position signatures/fingerprints using Zobrist hashing
* integrated perft interface
* parsing and generation of Standard Algebraic Notation as well as Long Algebraic Notation of moves
* parsing and generation of FEN

The software ships with a large test suite that ensures a high test coverage. Last but not least, it runs about 30 % faster than python-chess, Python's de-facto standard chess library.

Corrections, additions, and github stars if you like it, are always welcome!
tcusr
Posts: 323
Joined: Tue Aug 31, 2021 10:32 pm
Full name: tcusr

Re: New chess library Plisco (and toy engine plisco)

Post by tcusr »

i never understood why people use bitboards with dynamic languages
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: New chess library Plisco (and toy engine plisco)

Post by emadsen »

gflohr wrote: Sun Sep 19, 2021 6:07 pm I have published today the library Chess::Plisco for Perl. It is available on CPAN (https://metacpan.org/dist/Chess-Plisco/ ... Plisco.pod) and on Github (https://github.com/gflohr/Chess-Plisco). It also contains a UCI-compatible toy engine "plisco" which is not meant to be a serious competitor, although it can surely be an adornment of the tail of any computer chess ratings list. ;)
Cool. Perl is underrepresented in the chess engine community. So bravo for your contribution! Does Plisco understand regular expressions? :) Probably has better support for them than Stockfish.
My C# chess engine: https://www.madchess.net
gflohr
Posts: 57
Joined: Fri Jul 23, 2021 5:24 pm
Location: Elin Pelin
Full name: Guido Flohr

Re: New chess library Plisco (and toy engine plisco)

Post by gflohr »

emadsen wrote: Tue Sep 21, 2021 5:27 am Cool. Perl is underrepresented in the chess engine community. So bravo for your contribution! Does Plisco understand regular expressions? :) Probably has better support for them than Stockfish.
Where is a chess engine supposed to understand regular expressions? I didn't really get that.

In fact, the only place where I use regexes in the core chess code is the SAN parser. From the information that I find in the move I generate a string/regex like "B..c4" and match that against all valid moves of the position to see if I find exactly one match.
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: New chess library Plisco (and toy engine plisco)

Post by emadsen »

gflohr wrote: Tue Sep 21, 2021 12:08 pm Where is a chess engine supposed to understand regular expressions? I didn't really get that.
It's a joke. Hence the smiley face. Perl is known for text processing and RegEx.
My C# chess engine: https://www.madchess.net
gflohr
Posts: 57
Joined: Fri Jul 23, 2021 5:24 pm
Location: Elin Pelin
Full name: Guido Flohr

Re: New chess library Plisco (and toy engine plisco)

Post by gflohr »

emadsen wrote: Tue Sep 21, 2021 5:27 pm It's a joke. Hence the smiley face. Perl is known for text processing and RegEx.
Yes, sure. I just wasn't 100 % sure that you really meant it as a joke.

But as stated above, the project is not meant to be a serious competitor in computer chess. But just like with python-chess, it can be quite helpful tohave chess functionality available in a scripting language, because you can quickly try out new ideas, you can generate test data, write driver scripts and such stuff. I am not really a Python guy, and so I had used other Perl chess libraries for such purposes in the past. But they were all way to slow sooner or later, and so I decided to write something that is on par with python-chess. Some things just don't work, when a search to depth 3 takes you a minute already.