Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: c,c++5,c#.

Author: Sune Fischer

Date: 16:48:52 08/13/04

Go up one level in this thread


On August 13, 2004 at 06:01:49, Tord Romstad wrote:

>On August 12, 2004 at 15:07:51, Sune Fischer wrote:
>
>>On August 12, 2004 at 06:01:32, Tord Romstad wrote:
>>
>>>On August 11, 2004 at 15:33:16, Sune Fischer wrote:
>>>
>>>>For chess, since you ask, it must be fast so either C or C++.
>>>
>>>I don't quite agree.  Speed is vastly overrated in computer chess.
>>>Except for a few games between the top professional engines, speed
>>>is rarely the decisive factor.  Bugs and efficiency on a higher
>>>level (i.e. good algorithms) are far more important.
>>
>>I know what you mean of course, but speed really is a factor in computer chess.
>>It's not the most important factor, but not something to be ignored either.
>
>I think it is something that can and should be ignored, until you have a
>rather strong engine.  Bugs is one factor, as mentioned above.  Another
>important point, which you bring up later in the thread, is testing and
>experimentation.  For a not very strong engine, it is not a bad idea to
>sacrifice some speed in return for flexibility.

I don't think it should be ignored, it's a factor in the equation just like so
much else.

Wouldn't it be silly to develop a strong 50000 line engine and then have to
rewrite all of that to a different language?
When would be a good time to make this conversion, how strong should the engine
become?

I don't think there is an easy answer to that question, so you'd probably end up
never converting to a faster language and end up living with the slowdown
forever.

I agree with you that nps isn't everything in the sense that a slowdown can
sometimes be well spent on e.g. better evaluation.
But on the question if a lower development time by using a highlevel language is
worth a speed sacrifice, my answer would be that it isn't.

>>Do you not want to write the best engine you can?
>
>Not if it means writing everything in assembly language.  A few other
>people might reply "not if it means writing everything in C/C++" (for
>me, however, C is OK).  This does not mean that there projects are doomed
>to failure.  After all, there is at least one Delphi chess engine which
>is far stronger than both of our engines.  ;-)

I thought Delphi was comparable to C in speed.

If it's slower than C, then we must just count ourselves lucky Delfi is not
written in a faster language :)

>>Learning a new language is never a bad idea anyway. :)
>
>I used to think so, but I am no longer sure.  I have ended up as a
>programming language junkie, who always needs to learn something new.
>It's great fun, but it consumes so much time that there is often no
>time left for those things I really should do.  :-)

I consider it time well spent if you learn the language well.

>>If they are as fast as C, then yes.
>
>Why is "as fast as C" a requirement, when "as fast as assembly language"
>is not?  I see no reason to regard the speed of compiled C code as some
>sort of magic limit.

AFAIK C is just one abstraction layer on top of assembly, so if you want to go
faster you have to go assembly.

I don't like assembly because it's hard to debug, it's not portable, and it's
nearly impossible to beat a good compiler anyway.

If I thought I could get 2x the nps I'd write it in asm for sure though :)

>>Three times faster is a lot.
>>Ask any employer if he would like to be able to cut down his staff by 66% due to
>>increased efficiency. :)
>
>Unfortunately, employers are not always the most rational of beings, as I
>learned during my time I worked as a Lisp hacker in Telenor.

Hehe, "Lisp hacker"?

>Some of the
>people in our management (the kind of managers who knows nothing whatsoever
>about programming or other technical topics) had a religious conviction
>that all development tasks should be done in Java (probably because it
>was the only programming language ever mentioned by name in the business
>magazines they read).  Several times, very expensive Java consultants
>were hired in order to replace working, stable, efficient and bug-free
>code with a Java equivalent.  The Java guys would typically work for
>months before they had a slow and buggy implementation of half the
>functionality of the original program (which of course was written by
>a much smaller team of programmers in much shorter time), before the
>whole project was canceled because of some reorganization of the company.

It sounds to me like those Java programmers probably weren't very good.
Fast development should be one of Java's strengths.

-S.



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