Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any idea's on how long it takes to learn C++, then create a chessmonster

Author: Dann Corbit

Date: 15:21:11 12/11/01

Go up one level in this thread


On December 11, 2001 at 18:01:16, Gareth McCaughan wrote:
>On December 11, 2001 at 17:25:26, Roy Eassa wrote:
>>On December 11, 2001 at 13:42:56, David Hanley wrote:
>>>On December 11, 2001 at 12:56:50, David Rasmussen wrote:
>>>>On December 11, 2001 at 11:47:19, David Hanley wrote:
>>>
>>>>>Yes.  C++ is assembler with objects.
>>>>
>>>>Not at all. Templates and generic programming alone is a revolution, that is
>>>>unique to C++,
>>>
>>>No, both were around long before C++, and i'd even say that the c++
>>>implementations of them are quite poor.
>>
>>
>> I was under the impression that templates were a new programming construct
>> with C++ (i.e., they did not exist in any language before they were
>> introduced into C++).  Am I incorrect?
>
>Templates as such are new with C++. Much of what they do can be done
>better by other means that have existed for ages.
>
>What templates give you is the ability to generate code at compile time
>on the basis of simple pattern matching that can make use of the declared
>types of objects. Apart from the "declared types of objects" thing, the
>same facilities are provided by (e.g.) Common Lisp's macros system, only
>less painfully. The type-dispatching thing is quite important to C++
>templates, though, and obviously you couldn't have that in a dynamically
>typed language. (You could have something like it, by exposing the
>compiler's type inferencing mechanism to the macro system. CL doesn't
>provide that.)

C++ has RTTI.

>I don't know of any other system that provided the exact same function
>that templates do, before templates. So yes, templates are new. It would
>be misleading to claim that (e.g.) "generative programming" or "generic
>programming" -- two buzzwords often associated with templates -- are new.

Here we agree completely.

I think it boils down to this:
1.  If you are already good at some computer language, write your chess program
in that language.
2.  If you are going to learn a language from the ground up for the expressed
purpose of writing a chess program, then C or C++ is the obvious choice because
all the good examples you are going to see will be in those two languages, and
the generated binaries will be faster.
3.  You can knock off a chess program faster in some other languages perhaps,
but it will be slow.
4.  If you *want* to learn another language, then a chess engine would be an
interesting project.  However, as a *first* project, I think a chess engine will
be very daunting.  If you write it from the ground up, then it will take at
least a year if you don't know anything about programming.  And even at that, it
will get the stuffings pounded out of it by TSCP.
5.  If you just want to fool around with chess engines, then take a simple one
like SCP or TSCP or MSCP and fool around with the eval or whatever.  However, I
propose that this approach will not be satisfying and eventually you will write
your own anyway.

Any Turing complete language can obviously be used to write a chess program.
Here are some mistakes to avoid:
1.  Don't use assembly language.  You'll be sorry later, I guarantee it.
Besides which, a C compiler will probably do better than you anyway, unless you
are a real guru at it.
2.  Don't use a scripting language if you want to compete for wins.  It is
probably the fastest way to have an engine, but it will never be any good.

Other than that, I don't think it matters much.
I think that perhaps the "academic" languages like Lisp or Snoball might be
interesting to play with ideas, since the engine is much more abstracted.




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.