Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Do have the Crafty the Assembler written core?

Author: Christophe Theron

Date: 18:38:55 11/01/99

Go up one level in this thread


On November 01, 1999 at 19:50:12, leonid wrote:

>
>Hi!
>I have the Crafty game in my Hiarcs 7.32 package. When I plyed with Crafty I was
>impressed and puzzled. Impressed with the game that I found quick and good but
>doubtful about the central part of the game. In what language it was really
>written? Core part in Assembler, or 100% on C?
>
>Just can't retain me to not mention what really puzzled me in the game. It was
>one idea that never went away. Why to write so good game in so slow language? To
>use the C in this case is like to do the premeditated suicide. Like willingly
>leaving your first place to somebody else. But maybe I rush to the conclusion.
>
>Leonid.

I think that using C (not C++) is the most sensible choice.

Compilers today are very good and I doubt a program well written in C could be
much faster in assembly, except for some architecture details.

My program is written in C, and would be weaker if I had chosen assembly.
Instead of spending my time coding in assembly and debugging, I can easily try
my ideas and keep the ones that work.

What I do from time to time is to have a look at the generated code for very
time critical parts. Also I do time measurements do check that a change behaves
as expected, and sometimes I try different ways to achieve the same task and
pick the one that the compiler likes the most.

I'm quite satisfied with C. I could port my program to another system (Linux for
example) in a reasonnable time, and even port for another family of processors
probably with little changes in the code.

C++ is good too but basically you don't need it. However if you are inclined to
think "object oriented" this will be your choice. I prefer C because I know that
it exists on more platforms, but I honestly don't even know if this feature will
be useful for me some day.



    Christophe



This page took 0 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.