|
Main
Date: 30 Jul 2006 22:12:39
From: Jaco van Niekerk
Subject: Delphi or C
|
Hello all Your recommendation please. I want to write a chess engine. I know Delphi very well. I know C a little. All major chess engines are written in C, but how does that compare to Delphi?? Do you think that it is worth learning C to implement a good engine (I'm aiming for 2100 elo at least) or will Delphi be good enough? In short - is the language a critical factor in writing chess engines?? Regards Sparky (my email is sparky at imaginet dot co dot za).
|
|
|
Date: 03 Aug 2006 10:00:03
From:
Subject: Re: Delphi or C
|
Jaco van Niekerk wrote: > All major chess engines are written in C, but how does that compare to Delphi?? Executables compiled with Borland Delphi were 60% slower than those compiled with Microsoft's C compiler in a recent shoot-out. > (I'm aiming for 2100 elo ... will Delphi be good enough? A 2100 ELO Java chess engine exists, so it's possible. However, unless you're a gemius it will never come close to the top chess engines. > In short - is the language a critical factor in writing chess engines?? Your algorithm, implementation skill, and language are critical factors.
|
|
Date: 03 Aug 2006 18:10:15
From: Thorsten Kiefer
Subject: Re: Delphi or C
|
Jaco van Niekerk wrote: > Hello all > > Your recommendation please. I want to write a chess engine. > > I know Delphi very well. I know C a little. All major chess engines are > written in C, but how does that compare to Delphi?? Do you think that it > is worth learning C to implement a good engine (I'm aiming for 2100 elo at > least) or will Delphi be good enough? In short - is the language a > critical factor in writing chess engines?? > > Regards > Sparky > (my email is sparky at imaginet dot co dot za). With Java you can concentrate more on the algorithm without the headaches of memory management, and your code will be structured very well, but Java is slow. I'm not sure, but I think C# has garbage collection, too, and is faster than java, but It's not protable. Regarding to my experiences the Delphi compiler produces slow code, and it's not portable. C compilers have made good progress and produce the fastest code, but you will run into trouble with memory management. C++ produces fast code and the source code will be more structured and with STL it can help you with memory management. Conclusion: If you can afford a performance loss, because you have a very good algorithm, use Java. If you need all performance you can get, use C++. Regards Thorsten
|
|
Date:
From: Martin Brown
Subject: Re: Delphi or C
|
|
|
Date: 30 Jul 2006 23:38:40
From: Simon Krahnke
Subject: Re: Delphi or C
|
* Jaco van Niekerk <[email protected] > (22:12) schrieb: > Your recommendation please. I want to write a chess engine. Fine. > I know Delphi very well. I know C a little. All major chess engines are > written in C, but how does that compare to Delphi?? Hard to tell when there are no major chess engines in Delphi. > Do you think that it is worth learning C to implement a good engine > (I'm aiming for 2100 elo at least) or will Delphi be good enough? IMHO writing a chess engine in some language only lets you exolore the limits of that language. That's not a good starter. And if you don't lose interest, your first chess will probably not be your last. > In short - is the language a critical factor in writing chess > engines?? We had a project at university, where the goal was to write a chess program. There were teams programming in C, in Smalltalk and in Java. The professor predicted the Smalltalk first, C second and Java last. I joined a Java team. At the final competition we placed first with two draws no losses and a lot of wins. Morale: The writer is more important than the language. mfg, simon .... l PS: I was not the top performer on the team.
|
|
Date: 30 Jul 2006 22:19:31
From: Dave (from the UK)
Subject: Re: Delphi or C
|
Jaco van Niekerk wrote: > Hello all > > Your recommendation please. I want to write a chess engine. > > I know Delphi very well. I know C a little. All major chess engines are > written in C, but how does that compare to Delphi?? Do you think that it is > worth learning C to implement a good engine (I'm aiming for 2100 elo at > least) or will Delphi be good enough? In short - is the language a critical > factor in writing chess engines?? There are two very obvious advantages in using C 1) You learn a useful language. 2) Portability. Do you really want to have to stick to whatever platforms Delphi supports? I would go with C partially for performance, but more than anything for portability. I think Delphi might support Linux, but are not sure. But for maximum portability I'd go with C. Chess engines tend to use a lot of CPU time and with multi-processor boxes getting cheaper, there are obvious advantages in making you program compatible with multiple CPUs. I'm not sure how good Delphi would be in that case. Writing parallel code is not trivial, so if you don't know it and want maximum performance, I'd look at pthreads. -- Dave K MCSE. MCSE = Minefield Consultant and Solitaire Expert. Please note my email address changes periodically to avoid spam. It is always of the form: [email protected] Hitting reply will work for a few months only - later set it manually. http://witm.sourceforge.net/ (Web based Mathematica front end)
|
|