# \[ANN\] Chess.jl - A Julia chess programming library

**URL:** https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221
**Category:** Package Announcements
**Tags:** package, announcement
**Created:** [September 27, 2019, 9:37am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221 "2019-09-27T09:37:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Tord](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tord/32/6809_2.png) [@Tord](https://discourse.julialang.org/u/Tord)
#### Post date: [September 27, 2019, 9:37am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221/1 "2019-09-27T09:37:16Z")

</div>

I just published the first version of [Chess.jl](https://github.com/romstad/Chess.jl), a library for computer chess. This is my first Julia project, and I am not a real programmer, so much of the code probably looks amateurish, but it works and performs surprisingly well.

Notable features:

- Efficient board representation with fast legal move generation.
- Import and export of games in PGN format, including support for comments and recursive annotation variations.
- Opening book trees generated from PGN databases.
- Basic support for interacting with UCI chess engines like [Stockfish](https://stockfishchess.org).

My motivation for creating this was doing machine learning experiments with computer chess, but I think the library should also be suitable for most other types of chess related applications.

---

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [September 27, 2019, 10:10am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221/2 "2019-09-27T10:10:56Z")

</div>

maybe try some reinforcement learning by copying the alphazero architecture using Flux.jl

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [September 27, 2019, 10:14am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221/3 "2019-09-27T10:14:32Z")

</div>

If this is your first Julia project then I have to congratulate you! This seems well made and the documentation clear! Congrats (I am just a chess enthusiast, but don’t know much about using engines, etc.)

---

<div class="post-metadata">

### Author: ![Tord](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tord/32/6809_2.png) [@Tord](https://discourse.julialang.org/u/Tord)
#### Post date: [September 27, 2019, 10:51am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221/4 "2019-09-27T10:51:55Z")

</div>

> [@xiaodai](#):
>
> maybe try some reinforcement learning by copying the alphazero architecture using Flux.jl

That would be great fun, but unfortunately, lacking DeepMind’s immense hardware resources, that’s not a realistic project.

My current goals are more in the line of using deep learning as a tool to better understand typical human mistakes, both in general and for specific players (I am sure even the best chess players have some systematic weaknesses that they are not aware of). This could be used both to make computer opponents more fun and human-like to play against, and to generate exercises and other training material for human chess players.

---

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [September 27, 2019, 11:00am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221/5 "2019-09-27T11:00:22Z")

</div>

> [@Tord](#):
>
> That would be great fun, but unfortunately, lacking DeepMind’s immense hardware resources

I believe alphzero was traied using 4tpus 2years ago.modern high end gpu might do a decent job!

---

<div class="post-metadata">

### Author: ![Tord](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tord/32/6809_2.png) [@Tord](https://discourse.julialang.org/u/Tord)
#### Post date: [September 27, 2019, 11:05am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221/6 "2019-09-27T11:05:09Z")

</div>

> [@xiaodai](#):
>
> I believe alphzero was traied using 4tpus 2years ago.

Unfortunately, this is wrong. It was _playing_ on 4 TPUs, but it was _trained_ on 5000 TPUs.

---

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [September 27, 2019, 11:27am UTC](https://discourse.julialang.org/t/ann-chess-jl-a-julia-chess-programming-library/29221/7 "2019-09-27T11:27:48Z")

</div>

Oh, you are right! I had this misconception for 2 years. Thanks
