Moderator: Andres Valverde
Betsemes wrote:I'm just barely begun all this thing about chess engine programming. I now wonder whether the compiler I'm using is the right one. I was under the impression that C++ was the primary choice of languages to provide fast executable code as well as flexibility on what can be done. Now I'm wondering whether there is a better choice out there. So could someone post a guide of programming languages related to chess engine programming? Their pros and cons. I'm still not sure what I want my engine to be. I only know that I have loved chess since I was 15 years old and I was a fairly good programmer back in college. But I had not touched a compiler since December 1989, so I have much to learn.
Ron Murawski wrote:What programming languages do you already know? It is always easier to create a project in a familiar language.
C will generate the fastest code but you need to dot every i and cross every t. There are plenty of IDEs and debuggers and other development tools.
C++ is a very complex language. It is very easy to write less efficient code in C++ using OOP features, but you can program in a subset of the language and circumvent that problem -- it's like writing C code, but using a C++ compiler to do it. There are plenty of IDEs and debuggers and other development tools for C++.
D is a very good alternative to C++. D is the language C++ should have been. On Linux and Mac it is 32/64-bit. The last time I looked at the language, the Windows version was 32-bit only. There's only a couple of IDEs that support D. I have not used D, so I can't comment on the quality of the IDEs or on the debugging.
Vala/Genie - For Vala you program in a C#-like language - it transpiles to C code and then compiles the C code for you. The generated C code is very clear and very efficient. There is also the Genie language which is a Python-like language and also transpiles to C. Both Vala and Genie use the exact same compiler. Debugging can be problematic due to using a C debugger and not having a 1-to-1 relationship with your source code. I developed (and debugged) my move generator in the Genie language using the Geany IDE. It worked but was not ideal. On Linux you can use Anjuta as your IDE.
There are other choices, but they start getting esoteric. Like the Shedskin Python transpiler, etc.
Betsemes wrote:May I correctly assume we may write less efficient code too with D?
Return to Chess Programming Lessons
Users browsing this forum: No registered users and 2 guests