Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: WHAT'S THE BEST COMPUTER LANGUAGE TO PROGRAM CHESS?

Author: David Dory

Date: 02:10:44 01/13/02

Go up one level in this thread


On January 13, 2002 at 01:53:02, emerson tan wrote:

>What's the best computer language to program a chess software in terms of speed
>of execution? Is it FORTRAN? C++? C? or any other language I dont know? What are
>the advantages and disadvantages of each language? What languages does FRITZ,
>SHREDDER, REBEL, TIGER, JUNIOR, HIARCS, CRAFTY, CHESSMATER AND OTHER FAMOUS
>PROGRAMS USE?
>
>Thanks

Most of the top amateur and pro programs are written in C. Many sprinkle in some
assembly language in very time-critical sections. Some very good programs have
been written in assembly - which is blazingly fast. Unfortunately when the
computer it was written for becomes obsolete, so does the program. Another
disadvantage of using assembly is that the program becomes more difficult to
modify.

The advantage of using C? First, C is available for every general purpose
computer. Second, the resulting program can be re-compiled and run on so many
different kinds of computers, and third, C is well known for it's speed, and
overall robustness of expression. Most operating systems software are written in
C.

C++ is another good choice. It can be quite quick, and is wonderfully powerful.
Personally, I believe C++ is best suited for modeling, and I do not think chess
is a great example of something to model. Despite my beliefs, some good programs
have been written in C++, which shows you how much I know!! :-))

Programs have also been written in Fortran, BASIC, Pascal, Delphi, Modulo2, and
LISP (and several more I haven't mentioned, I'm sure). The biggest problem with
most of these languages is that the resulting programs just aren't as fast as an
equivalent program written in 'C'. Speed is quite critical in chess programming,
and the fastest general purpose and best known language is 'C'.

I can't personally state what language is used by every program*,but I would be
surprised if ANY top program was written in anything other than C, assembly, or
C++.

*Crafty, Beowolf, Rival, TSCP, Nimzo, and Green Light Chess programs are all
written in 'C'. Some with a sprinkling of assembly as well. Rebel apparently has
a heavier dose of assembly language code, if I remember Mr. Schroeder's comments
correctly.

Dave



This page took 0.02 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.