Object model for chess GUI?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: Object model for chess GUI?

Post by gbtami »

lucasart wrote:
Steve Maughan wrote: I'd write it in Delphi / Object Pascal, and use the VCL as the GUI framework.

After giving it a little thought it's not obvious as to what is the best way to construct the underlying structure.
Delphi is mostly dead, so you risk being left with a compiler and toolkit that are stuck in the 90s... Not to mention portability limitations.

And you have lots of wheels to reinvent. Instead, write it Python, using the chess library. It does all the heavy lifting for you:
https://pypi.python.org/pypi/python-chess
This library is truly amazing!
I have to agree with Lucas here. While Lazarus the free alternative to Delphi exists I have a feeling that writing a chess GUI in it can be more problematic than in Qt/Gtk using Python. But this is just my feeling.

Chess GUIs using Python:
https://github.com/asdfjkl/jerry PyQt4
https://github.com/lukasmonk/lucaschess PyQt4
https://github.com/pychess/pychess Gtk3+

Another possible way can be html5/js as lichess.org works on client side.
https://github.com/ornicar/lila
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Object model for chess GUI?

Post by Dann Corbit »

Python, Gtk+ and Qt all install a mammoth pile on your machine and it is very, very fiddly to get it to work on Windows.

A lot easier on Linux, especially for Gtk+

On the other hand, the alternatives all have problems too.

Java? Interface to non-java stuff is fiddly.

Dotnet? The Mono stuff does not have the same custom controls.

wxWidgets? The fiddliest of all. I wanted this thing to work nicely, because it covers so many targets, but it is really hard to get something besides a trivial application to work.

If anyone knows of something that works smoothly on all platforms and integrates with existing tools easily, I would love to hear about it.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Arpad Rusz
Posts: 273
Joined: Sat Apr 17, 2010 2:34 pm
Location: Budapest

Re: Object model for chess GUI?

Post by Arpad Rusz »

Take a look at this nice open source project for a Chess GUI (it is written using Qt): http://sourceforge.net/projects/chessx/
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Object model for chess GUI?

Post by stegemma »

lucasart wrote:
Steve Maughan wrote: I'd write it in Delphi / Object Pascal, and use the VCL as the GUI framework.

After giving it a little thought it's not obvious as to what is the best way to construct the underlying structure.
Delphi is mostly dead, so you risk being left with a compiler and toolkit that are stuck in the 90s... Not to mention portability limitations.

And you have lots of wheels to reinvent. Instead, write it Python, using the chess library. It does all the heavy lifting for you:
https://pypi.python.org/pypi/python-chess
This library is truly amazing!
I'm not very sure for this. I've used Borland C++ Builder 6.0 until now and it is still usable, but with some limitations (BCB use same framework as Delphi). Embarcadero provides new version of Delphi/BCB promising portability (but the cost is too high, for me). I think that the best way to becomes portable starting from BCB is to switch to wxWidgets (in C++), not to Python. Because Delphi is based on Pascal and he want to "toy" with the GUI, why not in Delphi?
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Object model for chess GUI?

Post by mcostalba »

lucasart wrote: Delphi is mostly dead, so you risk being left with a compiler and toolkit that are stuck in the 90s... Not to mention portability limitations.

And you have lots of wheels to reinvent. Instead, write it Python, using the chess library. It does all the heavy lifting for you:
https://pypi.python.org/pypi/python-chess
This library is truly amazing!
I agree with Lucas here. Delphi is last century technology (but perhaps is what the author knows), but also Qt and friends represent an old approach nowdays.

I have nothing against Qt, indeed I know that library quite well and I think it is awsome, as is awsome cutechess that is based on it and written by a very good developer (so look at its sources for understanding how to design and architect the app), but if I had to write from scratch a GUI app today I would seriously considering cloud/web development, I would seriously consider using the browser as the GUI.

For me the most modern approach is to rely on the Python chess library posted by Lucas for the low level, chess specific stuff, and on the browser for the presantation to get something like lichess (http://en.lichess.org/) but of course you need some skills and being literate with this technology.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Object model for chess GUI?

Post by stegemma »

Dann Corbit wrote:[...]
If anyone knows of something that works smoothly on all platforms and integrates with existing tools easily, I would love to hear about it.
wxWidgets pay for its old style design but it works relatively well. I'm working now on a cutting solution: writing an http interface to my applications, so that I could run as desktop and as web server from the same code. This way, only standard C++ with sockets/pthreads is needed and I don't have to worry about tons of documentation. This project is more complex just for a GUI, so I suggest to keep Delphi or switch to wxWidgets.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: Object model for chess GUI?

Post by gbtami »

Dann Corbit wrote:Python, Gtk+ and Qt all install a mammoth pile on your machine and it is very, very fiddly to get it to work on Windows.

A lot easier on Linux, especially for Gtk+

On the other hand, the alternatives all have problems too.

Java? Interface to non-java stuff is fiddly.

Dotnet? The Mono stuff does not have the same custom controls.

wxWidgets? The fiddliest of all. I wanted this thing to work nicely, because it covers so many targets, but it is really hard to get something besides a trivial application to work.

If anyone knows of something that works smoothly on all platforms and integrates with existing tools easily, I would love to hear about it.
I don't know why do you think PyGobject and PyQt are "fiddly to get it work on windows". PyQt5 binary installer http://sourceforge.net/projects/pyqt/fi ... .1-x64.exe is 38MB http://sourceforge.net/projects/pygobje ... e/download is ~200MB, but you you can select componets you want to install from it. If these are mammoth for you, what is MS VisualStudio? :wink:
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: Object model for chess GUI?

Post by gbtami »

mcostalba wrote:
lucasart wrote: Delphi is mostly dead, so you risk being left with a compiler and toolkit that are stuck in the 90s... Not to mention portability limitations.

And you have lots of wheels to reinvent. Instead, write it Python, using the chess library. It does all the heavy lifting for you:
https://pypi.python.org/pypi/python-chess
This library is truly amazing!
I agree with Lucas here. Delphi is last century technology (but perhaps is what the author knows), but also Qt and friends represent an old approach nowdays.

I have nothing against Qt, indeed I know that library quite well and I think it is awsome, as is awsome cutechess that is based on it and written by a very good developer (so look at its sources for understanding how to design and architect the app), but if I had to write from scratch a GUI app today I would seriously considering cloud/web development, I would seriously consider using the browser as the GUI.

For me the most modern approach is to rely on the Python chess library posted by Lucas for the low level, chess specific stuff, and on the browser for the presantation to get something like lichess (http://en.lichess.org/) but of course you need some skills and being literate with this technology.
]

I think the key question is the goal of Steve. If he just wants to write a simple chess GUI to hes own pleasure, Delphi is ok. But if the goal is something more serious, then the future is the lichess.org way. Use some existing chess lib for backend (it can be hes own lib in Pascal or cutechess in C++ or python-chess in Python or lichess in Scala) and use web technologies (html5/js) to frontend.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Object model for chess GUI?

Post by hgm »

gbtami wrote:PyQt5 binary installer http://sourceforge.net/projects/pyqt/fi ... .1-x64.exe is 38MB http://sourceforge.net/projects/pygobje ... e/download is ~200MB, but you you can select componets you want to install from it. If these are mammoth for you, what is MS VisualStudio? :wink:
Well, WinBoard is only 1.3MB. So yes, I consider it awful to force a user to download and install hundreds of MB just to get a simple application working. This is the reason why we continue to supply WinBoard next to the GTK+ build of XBoard.
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: Object model for chess GUI?

Post by gbtami »

hgm wrote:
gbtami wrote:PyQt5 binary installer http://sourceforge.net/projects/pyqt/fi ... .1-x64.exe is 38MB http://sourceforge.net/projects/pygobje ... e/download is ~200MB, but you you can select componets you want to install from it. If these are mammoth for you, what is MS VisualStudio? :wink:
Well, WinBoard is only 1.3MB. So yes, I consider it awful to force a user to download and install hundreds of MB just to get a simple application working. This is the reason why we continue to supply WinBoard next to the GTK+ build of XBoard.
WinBoard is Windows only using native widgets. So this is not surprising. PyChess on Linux is similar (.deb is 2.4MB). But installer links I sent are for developers only. PyChess .msi for Windows is 22.4MB, not hundreds of MB. I think this is acceptable.