Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Lisp chess program

Author: Tord Romstad

Date: 08:24:23 09/30/03

Go up one level in this thread


On September 29, 2003 at 23:42:35, Dann Corbit wrote:

>http://clocc.sourceforge.net/clocc/src/games/cil/

I haven't read the source code very thoroughly, but here are some comments
after skimming through it:

Documentation strings are cool, but most programmers don't use them as often
as they should.  Nice to see a program where they are used consistently.

The source code contains lots of special variables which do not follow the
convention of using asterisks around the variable name.  This is extremely
dangerous.  You risk to introduce serious and hard-to-find bugs by binding a
variable with the same name in a 'let' form.

Using special variables for squares seems unneccesary and inelegant to me
(and this is also one of the many instances where the special variable
names are "un-asterisked").  Wouldn't it be cleaner to define a reader
macro?

I am not sure I think bitboards are a good idea in a Lisp program, at
least not in a portable one.  I don't see any way to do fast 64-bit
operations without using in-line assembly language or calling C code
with the help of a foreign function interface.  In both cases, you
will have to sacrifice portability.  I think a mailbox architecture
would be more successful in pure Lisp.

The code is rather voluminous.  My guess is that it would be possible
to make it much more compact and readable by using more macros (there
isn't a single defmacro form in the code).

It is nice to see a Lisp chess program -- there are too few of them
(afaik, the only other program is BCE, which is also very incomplete
and unoptimised).  Thanks to Steven for making it available!

Tord



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.